:root {
    --k-black: #1A1A1A;
    --k-primary: #8B0000;
    --k-gold: #FFC107;
    --k-light: #F9FAFB;
    --k-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --font-display: 'Anton', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

body,
html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--k-light);
    overflow: hidden;
    color: #333;
}

#app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.app-header {
    height: 70px;
    min-height: 70px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: var(--k-shadow);
    z-index: 1000;
    position: relative;
    border-bottom: 2px solid var(--k-primary);
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 45px;
    width: auto;
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 2px solid #eee;
    border-radius: 50px;
    font-size: 0.95rem;
    background: #f8f9fa;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--k-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(139, 0, 0, 0.1);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.search-results {
    position: absolute;
    width: 100%;
    background: white;
    border-radius: 12px;
    top: 110%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    overflow: hidden;
    z-index: 2000;
}

.search-result {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.search-result:hover {
    background: #f0f4f8;
    border-left: 3px solid var(--k-primary);
}

.main-nav {
    display: flex;
    gap: 15px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-icon {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.nav-text {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.nav-item:hover {
    color: var(--k-primary);
    background: #fff0f0;
}


#map-container {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.map-legend {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: transparent;
    border-radius: 8px;
    z-index: 950;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.legend-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    color: var(--k-black);
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.legend-toggle:hover {
    transform: scale(1.1);
    color: var(--k-primary);
}

.legend-toggle.active {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.legend-content {
    width: 200px;
    padding: 15px;
    border-left: 4px solid var(--k-primary);
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: block;
}

.legend-content.active {
    display: block;
}

.legend-content:not(.active) {
    display: block;
}

.legend-header {
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
    text-align: center;
}

.legend-gradient {
    height: 10px;
    background: linear-gradient(to right, #d73027, #fee08b, #1a9850);
    border-radius: 5px;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.75rem;
    color: #666;
}

.mapboxgl-ctrl-top-right {
    top: 10px;
    right: 10px;
}

.map-controls-container {
    position: absolute;
    bottom: 120px;
    right: 30px;
    z-index: 950;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.map-controls-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    color: var(--k-black);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.map-controls-toggle:hover {
    transform: scale(1.1);
    color: var(--k-primary);
}

.map-controls-toggle.active {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.map-controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 260px;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.map-controls.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.control-header span {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--k-black);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.close-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.close-icon:hover {
    color: var(--k-primary);
}

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

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.slider-container {
    position: relative;
    padding: 0 5px;
}

input[type=range] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--k-primary);
    cursor: pointer;
    margin-top: -7px;
    box-shadow: 0 2px 6px rgba(139, 0, 0, 0.3);
    border: 2px solid white;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #eee;
    border-radius: 2px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--k-primary);
    border-color: var(--k-primary);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-label span {
    font-weight: 500;
    color: #444;
}


.sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    bottom: 0;
    width: 420px;
    background: white;
    box-shadow: var(--k-shadow);
    z-index: 900;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #eee;
}

.sidebar.open {
    transform: translateX(0);
}

#sidebar-content {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.sidebar-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s;
}

.sidebar-close-btn:hover {
    color: var(--k-primary);
}

.sidebar-header h2 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    margin: 0 0 10px 0;
    line-height: 1.1;
    color: var(--k-black);
}



.global-score-display {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 15px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.global-score-value {
    font-size: 3.5rem;
    font-family: var(--font-display);
    line-height: 1;
    font-weight: 700;
}

.global-score-label {
    text-transform: uppercase;
    color: #888;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.score-disclaimer {
    background-color: #fff8e1;
    border-left: 4px solid #FFC107;
    padding: 12px 15px;
    margin-bottom: 25px;
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
    color: #5d4037;
    line-height: 1.4;
    display: flex;
    gap: 10px;
}

.score-disclaimer i {
    color: #FFC107;
    font-size: 1.1rem;
    margin-top: 2px;
}

.pdf-btn {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    color: #8B0000;
    background-color: white;
    border: 2px solid #8B0000;
    background-image: linear-gradient(110deg, #ffffff 40%, #4B0082 40%, #4B0082 46%, #8B0000 46%, #8B0000 52%, #FFC107 52%, #FFC107 58%, #ffffff 58%);
    background-size: 250% 100%;
    background-position: 100% 0;
    transition: background-position 1.5s ease, transform 0.2s, box-shadow 0.2s;
}

.pdf-btn:hover {
    background-position: 0 0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(75, 0, 130, 0.15);
    color: #8B0000;
}

.pdf-btn:active {
    transform: translateY(0);
}


.detail-row {
    margin-bottom: 15px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
}

.progress-bg {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
}

.tree-bonus-display,
.cooling-bonus-display {
    background: #f0fdf4;
    border-left: 3px solid #2ecc71;
    padding: 10px;
    margin-top: 10px;
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
}

.cooling-bonus-display {
    background: #f0f9ff;
    border-color: #3498db;
}

.tree-emojis,
.fountain-emojis {
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 5px;
}


.equipment-section {
    border: 1px solid #eee;
    border-radius: 12px;
    margin-top: 25px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.equipment-main-title {
    padding: 18px 20px;
    background: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--k-black);
    text-transform: uppercase;
    font-size: 0.95rem;
    border-bottom: 2px solid #f0f0f0;
    transition: background 0.2s;
}

.equipment-main-title:hover {
    background: #f9f9f9;
    color: var(--k-primary);
}

.equipment-category {
    border-bottom: 1px solid #eee;
}

.equipment-category:last-child {
    border-bottom: none;
}

.equipment-category-header {
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    transition: all 0.2s;
}

.equipment-category-header:hover {
    background: #fafafa;
}

.equipment-category-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
}

.equipment-toggle {
    color: var(--k-primary);
    font-weight: bold;
    font-size: 1.1rem;
}

.equipment-content,
.equipment-category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: white;
}

.equipment-content.expanded {
    max-height: 3000px;
    transition: max-height 0.5s ease-in;
}

.equipment-category-content.expanded {
    max-height: 1500px;
    padding-bottom: 15px;
}

.equipment-subcategory {
    margin: 10px 20px;
}

.equipment-subcategory-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--k-primary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.equipment-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.equipment-detail-item {
    padding: 8px 12px;
    margin-bottom: 4px;
    color: #555;
    font-size: 0.85rem;
    background: #fcfcfc;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.equipment-detail-item::before {
    content: "•";
    color: #ccc;
    font-size: 1.2rem;
    line-height: 0;
}

.equipment-detail-item:hover {
    background: #fff;
    border-left-color: var(--k-primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: var(--k-black);
    transform: translateX(2px);
}

.equipment-total {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 0 10px 20px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #666;
}

.no-equipment-message {
    color: #999;
    font-style: italic;
    padding: 15px 20px;
    text-align: center;
    background: #fafafa;
    font-size: 0.85rem;
    margin: 10px 20px;
    border-radius: 6px;
}

.data-not-available {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 10px;
    margin: 15px 0;
    font-size: 0.85rem;
    color: #7d6608;
}

.pdf-container {
    font-family: var(--font-body);
    padding: 30px;
    background: white;
    color: #333;
    box-sizing: border-box;
    width: 100%;
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 4px solid var(--k-primary);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.pdf-title-container h1 {
    margin: 0;
    color: var(--k-primary);
    font-family: var(--font-display);
    font-size: 2rem;
    text-transform: uppercase;
}

.pdf-score-box {
    background: var(--k-primary);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
}

#pdf-global-score {
    font-size: 2rem;
    font-family: var(--font-display);
    font-weight: bold;
}

.pdf-map-container {
    width: 100%;
    height: 250px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 4px;
}

#pdf-map-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdf-analysis {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.pdf-column {
    flex: 1;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
}

.pdf-section-title {
    font-family: var(--font-display);
    border-bottom: 2px solid #eee;
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: var(--k-black);
}

.pdf-list {
    padding-left: 20px;
    margin: 0;
    font-size: 0.85rem;
}

.pdf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.85rem;
}

.pdf-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.7rem;
    color: #aaa;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

@media (max-width: 768px) {


    .app-header {
        height: auto;
        flex-wrap: wrap;
        padding: 10px 15px;
        gap: 10px;
    }


    .logo-link {
        order: 1;
        flex: 0 0 auto;
    }

    .header-logo {
        height: 35px;
    }

    .main-nav {
        order: 2;
        margin-left: auto;
        gap: 10px;
    }

    .nav-text {
        display: none;
    }

    .nav-item {
        padding: 8px;
        background: #f0f0f0;
    }

    .search-container {
        order: 3;
        margin: 0;
        width: 100%;
        max-width: none;
    }

    .search-input {
        padding: 10px 15px 10px 40px;
        font-size: 16px;
    }

    .sidebar {
        width: 100%;
        top: auto;
        bottom: 0;
        height: 80vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        z-index: 2000;
    }

    .sidebar.open {
        transform: translateY(0);
    }

    .sidebar-header h2 {
        font-size: 1.5rem;
    }

    .map-legend {
        bottom: 20px;
        right: 20px;
    }

    .legend-toggle {
        display: flex;
    }

    .legend-content:not(.active) {
        display: none;
    }

    .map-controls-container {
        bottom: 90px;
        right: 20px;
    }
}

.color-bar-signature {
    height: 4px;
    width: 100%;
    max-width: 250px;
    margin: 0rem auto;
    /* Espacement vertical et centrage horizontal */
    border-radius: 2px;
    background: linear-gradient(to right,
            #8B5CF6 0%, #8B5CF6 20%,
            /* Violet */
            #3B82F6 20%, #3B82F6 40%,
            /* Bleu */
            #22C55E 40%, #22C55E 60%,
            /* Vert */
            #FFDB59 60%, #FFDB59 80%,
            /* Orange */
            #EF4444 80%, #EF4444 100%
            /* Rouge */
        );
}