.score-value {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    text-align: center;
    line-height: 1.1;
    z-index: 1;
    position: relative;
}

.score-value small {
    font-size: 8px;
    font-weight: normal;
    opacity: 0.8;
}

.score-loading {
    font-size: 10px;
    color: #666;
    text-align: center;
    z-index: 1;
    position: relative;
}

.score-unavailable {
    font-size: 8px;
    color: #999;
    text-align: center;
    line-height: 1;
    z-index: 1;
    position: relative;
}/**
 * Styles pour le frontend du plugin Carbon Score Calculator
 */

/* Container principal */
#carbon-score-calculator {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Grille des propriétés */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Cards des propriétés */
.property-card {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 140px; /* Hauteur minimale pour la card */
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #0073aa;
}

.property-image {
    flex: 0 0 120px;
    background: #f5f5f5;
    display: flex; /* Pour centrer l'image */
    align-items: center; /* Centrage vertical */
}

.property-image img {
    width: 100%;
    height: 100%; /* Prendre toute la hauteur disponible */
    object-fit: cover;
}

.property-info {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.property-details {
    flex: 1;
}

.property-details h5 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.property-details p {
    margin: 4px 0;
    color: #666;
    font-size: 14px;
}

.property-details .address {
    color: #333;
    font-weight: 500;
}

.property-details .location {
    color: #666;
}

.property-details .country {
    color: #888;
    font-style: italic;
}

/* Score carbone */
.property-score {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 10px;
    min-height: 60px;
    flex-shrink: 0; /* Empêche le rétrécissement */
}

.score-badge {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0; /* Empêche le rétrécissement */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Score carbone - Version avec logo carbon score */
.score-badge {
    position: relative;
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Utiliser le logo carbon score comme arrière-plan */
    background-image: url('../logo_vide.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    
    /* Fallback si le logo ne charge pas */
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    background-color: #f8f9fa;
}

/* Quand le logo est chargé avec succès */
.score-badge.logo-loaded {
    border: none;
    background-color: transparent;
}

/* États du score avec couleurs appropriées */
.score-badge.score-good .score-value {
    color: #28a745;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.score-badge.score-good .score-value small {
    color: #28a745;
}

.score-badge.score-medium .score-value {
    color: #fd7e14;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.score-badge.score-medium .score-value small {
    color: #fd7e14;
}

.score-badge.score-bad .score-value {
    color: #dc3545;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.score-badge.score-bad .score-value small {
    color: #dc3545;
}

.score-badge.score-loading .score-loading {
    color: #6c757d;
    font-weight: 500;
}

.score-badge.score-unavailable .score-unavailable {
    color: #6c757d;
    font-weight: 500;
}

/* Boutons */
.button-primary {
    background: #0073aa;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.button-primary:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.button-secondary {
    background: #f1f1f1;
    color: #333;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.button-secondary:hover {
    background: #e9e9e9;
    border-color: #ccc;
    color: #333;
    text-decoration: none;
}

/* États de chargement */
#loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

#add-property-section {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

/* Formulaires */
.carbon-score-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.field-group {
    margin-bottom: 20px;
}

.field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.field-group input,
.field-group select,
.field-group textarea {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.field-group .description {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Résultats du calcul */
.carbon-score-result {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

.score-value {
    text-align: center;
    margin: 20px 0;
}

.score-number {
    font-size: 48px;
    font-weight: bold;
    color: #0073aa;
}

.score-unit {
    font-size: 18px;
    color: #666;
    margin-left: 10px;
}

.score-details,
.score-recommendations {
    margin: 20px 0;
}

.score-details h5,
.score-recommendations h5 {
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
}

.score-recommendations ul {
    list-style-type: disc;
    padding-left: 20px;
}

.score-recommendations li {
    margin-bottom: 8px;
    color: #555;
}

/* Messages d'erreur et de succès */
.message {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
}

.message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.message.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Navigation entre étapes */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.step-navigation .step-info {
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .properties-grid {
        grid-template-columns: 1fr;
    }
    
    .property-card {
        flex-direction: column;
        min-height: auto; /* Réinitialiser la hauteur minimale sur mobile */
    }
    
    .property-image {
        flex: none;
        height: 200px;
        width: 100%; /* Pleine largeur sur mobile */
    }
    
    .property-image img {
        height: 200px;
        width: 100%;
    }
    
    .step-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .field-group input,
    .field-group select,
    .field-group textarea {
        max-width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.property-card,
.carbon-score-form,
.carbon-score-result {
    animation: fadeIn 0.3s ease-out;
}

/* États de chargement pour les boutons */
.button-loading {
    position: relative;
    color: transparent !important;
}

.button-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Page de détails de la propriété */
.carbon-score-property-details {
    max-width: 1000px;
    margin: 0 auto;
}

.property-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.property-header h3 {
    margin: 0;
    color: #333;
}

.property-main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-bottom: 30px;
}

/* Section visuelle (image + score) */
.property-visual {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.property-image-large {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.property-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-score-large {
    text-align: center;
}

.score-badge-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    position: relative;
    
    /* Utiliser le logo carbon score comme arrière-plan */
    background-image: url('../logo_vide.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    
    /* Ombre pour donner du relief */
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.score-badge-large .score-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    text-align: center;
    line-height: 1.1;
    z-index: 2;
    position: relative;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.score-badge-large .score-value small {
    font-size: 12px;
    font-weight: normal;
    opacity: 0.8;
}

.score-badge-large .score-loading {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
    z-index: 2;
    position: relative;
    font-weight: 500;
}

.score-badge-large .score-unavailable {
    font-size: 13px;
    color: #6c757d;
    text-align: center;
    line-height: 1;
    z-index: 2;
    position: relative;
    font-weight: 500;
}

/* Classes de couleur pour le score large avec logo */
.score-badge-large.score-good .score-value {
    color: #28a745;
}

.score-badge-large.score-good .score-value small {
    color: #28a745;
}

.score-badge-large.score-medium .score-value {
    color: #fd7e14;
}

.score-badge-large.score-medium .score-value small {
    color: #fd7e14;
}

.score-badge-large.score-bad .score-value {
    color: #dc3545;
}

.score-badge-large.score-bad .score-value small {
    color: #dc3545;
}

.score-actions,
.no-score-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Formulaire de modification */
.property-form-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.form-section {
    padding: 25px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.readonly-section {
    background: #f8f9fa;
}

.readonly-field {
    padding: 12px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    color: #666;
    font-style: italic;
}

.readonly-field:empty::before {
    content: 'Non défini';
    color: #999;
}

/* Actions du formulaire */
.form-actions {
    padding: 25px;
    background: #f8f9fa;
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

.button-danger {
    background: #dc3545;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.button-danger:hover {
    background: #c82333;
    color: white;
    text-decoration: none;
}

/* Modales */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.modal-content h4 {
    margin: 0 0 20px 0;
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Boutons de partage */
.share-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.share-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.share-button.facebook {
    background: #1877f2;
    color: white;
}

.share-button.facebook:hover {
    background: #166fe5;
}

.share-button.twitter {
    background: #1da1f2;
    color: white;
}

.share-button.twitter:hover {
    background: #0d8bd9;
}

.share-button.linkedin {
    background: #0077b5;
    color: white;
}

.share-button.linkedin:hover {
    background: #006396;
}

.share-text {
    margin: 20px 0;
}

.share-text label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.share-text textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

/* Responsive pour la page de détails */
@media (max-width: 768px) {
    .property-main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .property-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .field-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .score-actions,
    .no-score-actions {
        flex-direction: column;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 20px;
        padding: 20px;
    }
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Styles pour le formulaire d'ajout de propriété */
.carbon-score-add-property {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
    max-width: 800px;
}

.carbon-score-add-property h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 24px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.property-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-control {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.form-control:hover {
    border-color: #999;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.btn-primary {
    background: #0073aa;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9e9e9;
    border-color: #ccc;
}

.loading-spinner {
    display: none;
}

.btn.loading .button-text {
    display: none;
}

.btn.loading .loading-spinner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.form-messages {
    margin-top: 20px;
}

.form-messages .message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.form-messages .success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.form-messages .error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Responsive pour le formulaire */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .carbon-score-add-property {
        padding: 20px;
        margin: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
}