/* ==========================================
   STYLES CENTRALISÉS POUR LE PROJET ZOLA
   ==========================================

   Fichier regroupant tous les styles CSS précédemment inline
   dans les templates HTML du projet labo-emc

   Note: Assurez-vous d'importer la police Google Fonts Jost dans votre HTML:
   <link href="https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700&display=swap" rel="stylesheet">

   Sections:
   1. CSS Variables & Global Styles
   2. Back Button (Macro)
   3. Portfolio Index Page
   4. Timeline Recherche Page
   5. Collaborations Page
   6. Plateformes Page
   7. Material Page
   8. Participer Page
   9. LaRuche Agencement Page
   ========================================== */

/* ==========================================
   1. CSS VARIABLES & GLOBAL STYLES
   ========================================== */

:root {
    /* Primary Colors */
    --color-primary: #5d2f86;
    --color-primary-light: #efeaf3;
    --color-primary-dark: #4a266b;

    /* Team Colors */
    --color-unite: #03396c;
    --color-team-cal: #ff9800;
    --color-team-mea: #4caf50;
    --color-team-ncc: #2196f3;
    --color-team-nshm: #9c27b0;
    --color-team-cosy: #e91e63;

    /* UI Colors */
    --color-border: #e2e8f0;
    --color-border-light: #f7fafc;
    --color-text-dark: #2d3748;
    --color-text-medium: #4a5568;
    --color-text-light: #555;

    /* Spacing */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --transition-fast: all 0.2s;
    --transition-smooth: all 0.3s ease;
}

body.page {
    font-family:
        "Jost",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

* {
    box-sizing: border-box;
}

/* ==========================================
   2. BACK BUTTON STYLES (from macros/back_button.html)
   ========================================== */
.back-button {
    position: fixed;
    top: 95px;
    left: 30px;
    width: 60px;
    height: 60px;
    background-color: transparent;
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 999;
}

.back-button:hover {
    background-color: var(--color-primary);
}

.back-button .chevron {
    font-size: 32px;
    line-height: 1;
}

.back-button:hover .chevron {
    color: white;
}

/* ==========================================
   3. PORTFOLIO INDEX PAGE STYLES (from portfolio/index.html)
   ========================================== */
.portfolio-index h2 {
    text-align: left;
    color: primary;
}

.portfolio-index hr {
    max-width: 100%;
    border: 0.5px dashed #ccc;
}

.portfolio-height {
    max-height: 100px;
    width: fit-content;
    margin: 0 auto;
}

/* Team & Unite Links - Base Styles */
a.unite,
a.team-cal,
a.team-mea,
a.team-ncc,
a.team-nshm {
    padding: 10px 15px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
}

/* Team Colors - Normal State */
a.unite {
    background-color: #03396c11;
    color: var(--color-unite);
}
a.team-cal {
    background-color: #ff980011;
    color: var(--color-team-cal);
}
a.team-mea {
    background-color: #4caf5011;
    color: var(--color-team-mea);
}
a.team-ncc {
    background-color: #2196f311;
    color: var(--color-team-ncc);
}
a.team-nshm {
    background-color: #9c27b011;
    color: var(--color-team-nshm);
}

/* Team Colors - Hover State */
a:hover.unite {
    background-color: var(--color-unite);
    color: white;
}
a:hover.team-cal {
    background-color: var(--color-team-cal);
    color: white;
}
a:hover.team-mea {
    background-color: var(--color-team-mea);
    color: white;
}
a:hover.team-ncc {
    background-color: var(--color-team-ncc);
    color: white;
}
a:hover.team-nshm {
    background-color: var(--color-team-nshm);
    color: white;
}

/* ==========================================
   4. TIMELINE RECHERCHE PAGE STYLES (from portfolio/recherche.html)
   ========================================== */

/* Timeline Styles */
#timeline {
    min-height: 10px;
}

#timeline .vis-panel.vis-background,
#timeline .vis-timeline {
    border: none !important;
    box-shadow: none !important;
}

#timeline .vis-grid.vis-vertical {
    border-left-style: dashed !important;
    border-left-width: 1px !important;
    border-left-color: #b2b2b2 !important;
}

/* Info Card Popup */
.info-card {
    position: fixed;
    left: 50%;
    top: 140px;
    z-index: 1000;
    min-width: 280px;
    max-width: 420px;
    background: #fff;
    border-radius: 13px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.17);
    padding: 20px 20px 12px 20px;
    transform: translateX(-50%);
    display: none;
    animation: popIn 0.14s;
}

@keyframes popIn {
    0% {
        transform: translateX(-50%) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

.info-card.visible {
    display: block;
}

.info-card .close {
    position: absolute;
    top: 9px;
    right: 16px;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
    font-weight: bold;
    background: none;
    border: none;
}

.info-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 2px;
    color: #222;
}

.info-sub {
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
}

.info-row {
    font-size: 12px;
    color: #444;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 4px;
}

/* Vis.js Timeline Items */
.vis-item .vis-item-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    padding: 0 !important;
}

.vis-item {
    border: 2px solid #fff !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    transition: box-shadow 0.14s;
}

/* Tab Button Styles */
.tab-button {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    background-color: #f5f5f5;
    color: #555;
    border: 1px solid #f5f5f5;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-button:hover {
    background-color: #e9e9e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tab-button.active {
    background-color: #03396c;
    border: 1px solid #03396c;
    color: white;
    box-shadow: 0 3px 6px rgba(3, 57, 108, 0.25);
}

.tab-button:active {
    transform: scale(0.95);
}

/* Mobile Adaptation */
@media (max-width: 768px) {
    .tab-button {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* Team-specific Tab Styles */
.tab-button[data-team="CAL"],
.tab-button[onclick*="'CAL'"] {
    border-bottom: 3px solid #ff9800;
}
.tab-button[data-team="MEA"],
.tab-button[onclick*="'MEA'"] {
    border-bottom: 3px solid #4caf50;
}
.tab-button[data-team="NCC"],
.tab-button[onclick*="'NCC'"] {
    border-bottom: 3px solid #2196f3;
}
.tab-button[data-team="NSHM"],
.tab-button[onclick*="'NSHM'"] {
    border-bottom: 3px solid #9c27b0;
}
.tab-button[data-team="COSy"],
.tab-button[onclick*="'COSy'"] {
    border-bottom: 3px solid #e91e63;
}

.tab-button.active[data-team="CAL"],
.tab-button.active[onclick*="'CAL'"] {
    border: 1px solid #ff9800;
    background-color: #ff9800;
}
.tab-button.active[data-team="MEA"],
.tab-button.active[onclick*="'MEA'"] {
    border: 1px solid #4caf50;
    background-color: #4caf50;
}
.tab-button.active[data-team="NCC"],
.tab-button.active[onclick*="'NCC'"] {
    border: 1px solid #2196f3;
    background-color: #2196f3;
}
.tab-button.active[data-team="NSHM"],
.tab-button.active[onclick*="'NSHM'"] {
    border: 1px solid #9c27b0;
    background-color: #9c27b0;
}
.tab-button.active[data-team="COSy"],
.tab-button.active[onclick*="'COSy'"] {
    border: 1px solid #e91e63;
    background-color: #e91e63;
}

/* ==========================================
   5. COLLABORATIONS PAGE STYLES (from portfolio/collaborations.html)
   ========================================== */

.collaborations-container {
    padding: 2rem 0;
}

.lead {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #555;
}

.collaboration-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 3rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #03396c;
}

.stat-label {
    font-size: 1rem;
    color: #555;
}

#world-map,
#france-map {
    margin-bottom: 1rem;
    overflow: hidden;
}

.map-tooltip {
    position: absolute;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    pointer-events: none;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 400px;
}

.top-collaborations {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.collab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.collab-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.collab-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.flag {
    width: 48px;
    height: 48px;
    margin-right: 1rem;
    overflow: hidden;
    border-radius: 4px;
}

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

.tooltip-header strong {
    font-size: 16px;
    color: #333;
}

.collab-count {
    background-color: #03396c;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.tooltip-teams {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.tooltip-team {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

.team-badge {
    color: white;
    font-weight: bold;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 5px;
}

.team-count {
    font-size: 10px;
    color: #666;
}

.tooltip-universities {
    margin-top: 8px;
}

.tooltip-university {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
    padding: 2px 0;
}

.more-universities {
    font-style: italic;
    color: #888;
}

.team-badge.team-cal {
    background-color: #ff9800;
}

.team-badge.team-mea {
    background-color: #4caf50;
}

.team-badge.team-ncc {
    background-color: #2196f3;
}

.team-badge.team-nshm {
    background-color: #9c27b0;
}

.team-badge.team-cosy {
    background-color: #e91e63;
}

.tooltip-university-sub {
    font-size: 10px;
    color: #777;
    font-style: italic;
    margin-bottom: 8px;
    margin-left: 8px;
}

.table-flag {
    width: 24px;
}

.top-colab-flag {
    width: 40px;
}

.collab-tabs,
.collab-type-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* Mobile Adaptation for Collaborations */
@media (max-width: 768px) {
    .collab-tabs,
    .collab-type-tabs {
        justify-content: center;
    }
}

/* ==========================================
   6. PLATEFORMES PAGE STYLES (from portfolio/plateformes.html)
   ========================================== */

.big-card {
    display: flex;
    box-shadow: 0 4px 32px #0002;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    min-width: 640px;
    max-width: 900px;
    width: 100%;
    min-height: 380px;
    margin-bottom: 20px;
    position: relative;
}

.tree-panel {
    background: #f3f4f6;
    padding: 32px 24px;
    min-width: 230px;
    max-width: 260px;
    border-right: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tree-cat {
    margin-bottom: 2px;
    border-bottom: 1.5px solid #e5e7eb;
    padding-bottom: 7px;
}

.tree-cat-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-list {
    list-style: none;
    padding: 0 0 0 22px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}

.tree-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #444;
    font-size: 1em;
    padding: 3px 5px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.18s;
    text-align: left;
    width: 100%;
    font-weight: 500;
}

.tree-btn:hover,
.tree-btn.active {
    background: #6366f1;
    color: #fff;
}

.pcontent-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 32px 36px;
    min-width: 300px;
    max-width: 700px;
    justify-content: flex-start;
    align-items: flex-start;
    position: relative;
    background: #fff;
}

.details-card {
    background: #f1f5f9;
    border-radius: 15px;
    padding: 30px 28px 26px 28px;
    min-width: 320px;
    box-shadow: 0 2px 10px #6366f115;
    animation: fadein 0.24s;
    min-height: 120px;
    position: relative;
}

.equipment-image {
    width: auto;
    height: auto;
    max-width: 400px;
    max-height: 400px;
    border-radius: 8px;
    margin: 15px auto;
    display: block;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.details-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.details-desc {
    font-size: 1.13em;
    color: #444;
    line-height: 1.5;
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    padding: 5px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.close-btn:hover {
    background: #4338ca;
}

/* Mobile Adaptation for Plateformes */
@media (max-width: 700px) {
    .big-card {
        flex-direction: column;
        min-width: 0;
    }
    .tree-panel {
        min-width: 0;
        max-width: none;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 18px 12px;
        border-right: none;
        border-bottom: 2px solid #e5e7eb;
    }
    .tree-cat {
        min-width: 140px;
    }
    .pcontent-panel {
        padding: 18px 7vw;
    }
    .details-card {
        min-width: 0;
        width: 100%;
    }
    .equipment-image {
        max-width: 180px;
        max-height: 120px;
    }
}

/* ==========================================
   7. HELPER CLASSES & UTILITIES
   ========================================== */

/* Country Flag Styles */
.country-flag-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.country-flag-name img {
    width: 20px;
    height: auto;
}

/* Maps Container */
.maps-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

/* General responsive improvements */
@media (max-width: 768px) {
    .maps-container {
        flex-direction: column;
    }

    #world-map,
    #france-map {
        width: 100% !important;
        height: 350px !important;
    }
}

/* Table utilities for collaboration tables */
.collab-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.collab-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.collab-table th,
.collab-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.collab-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.collab-table th:hover {
    background-color: #e9ecef;
}

/* ==========================================
   BOOTSTRAP BADGE STYLES (for material cards)
   ========================================== */
.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    transition:
        color 0.15s ease-in-out,
        background-color 0.15s ease-in-out,
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
}

.badge-primary {
    color: #fff;
    background-color: #007bff;
}

.badge-secondary {
    color: #fff;
    background-color: #6c757d;
}

.badge-success {
    color: #fff;
    background-color: #28a745;
}

.badge-warning {
    color: #212529;
    background-color: #ffc107;
}

.badge-danger {
    color: #fff;
    background-color: #dc3545;
}

.badge-online {
    color: #fff;
    background: linear-gradient(135deg, #4caf50, #45a049);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    font-weight: 600;
    transition: all 0.3s ease;
}

.badge-online:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

/* ==========================================
   COMMON POPUP STYLES (Material, Participer, Help)
   ========================================== */

/* Base Popup Overlay - Shared by all popups */
.material-popup,
.participer-popup,
.help-panel {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.material-popup.active,
.participer-popup.active,
.help-panel.active {
    display: flex;
    opacity: 1;
}

/* Popup Content Containers - Shared styles */
.material-popup-content,
.participer-popup-content,
.help-panel-container {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Size overrides */
.participer-popup-content {
    max-width: 900px;
}
.help-panel-container {
    max-width: 90vw;
}

.material-popup.active .material-popup-content,
.participer-popup.active .participer-popup-content,
.help-panel.active .help-panel-container {
    transform: scale(1);
}

/* Popup Headers - Shared styles */
.material-popup-header,
.participer-popup-header,
.help-panel-header {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 1rem;
}

.material-popup-header h2,
.participer-popup-header h2,
.help-panel-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    color: #333;
}

/* Close Buttons - Shared styles */
.close-material-btn,
.close-participer-btn,
.close-panel-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-material-btn:hover,
.close-participer-btn:hover,
.close-panel-btn:hover {
    color: #333;
    background-color: #f5f5f5;
}

/* ==========================================
   STYLES MATÉRIEL PAGE (from templates/material/index.html)
   ========================================== */

.material-card {
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border 0.3s ease;
    border: 2px solid #dee2e6;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1 / 1;
    transform-origin: center center;
    will-change: transform;
}

.material-card:hover {
    transform: translateY(-10px) rotate(2deg) scale(1.1);
    box-shadow: 0 10px 15px rgba(93, 47, 134, 0.3);
    border: 2px solid #5d2f86;
    z-index: 100;
}

.card-img-overlay-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.card-img-overlay-container .card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        transparent 100%
    );
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: background 0.3s ease;
}

.material-card:hover .card-overlay {
    background: linear-gradient(
        to top,
        rgba(93, 47, 134, 0.6) 0%,
        rgba(93, 47, 134, 0.3) 50%,
        transparent 100%
    );
}

.card-title-overlay {
    color: white;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.availability-badge-overlay {
    display: flex;
    gap: 5px;
}

.material-index .badge {
    font-size: 0.75em;
    margin-right: 5px;
    margin-bottom: 3px;
}

.specifications {
    font-size: 0.9em;
}

.specifications ul {
    list-style: none;
    padding-left: 0;
}

.specifications li {
    padding: 5px 0;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.card-img-placeholder {
    border-bottom: 1px solid #dee2e6;
}

/* ==========================================
   STYLES PARTICIPER PAGE (from templates/participer/index.html)
   ========================================== */

.etudes-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.etude-banner {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.etude-banner:hover {
    border-color: #5d2f86;
    box-shadow: 0 8px 20px rgba(93, 47, 134, 0.2);
    transform: translateY(-5px);
}

.etude-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.etude-banner-main {
    flex: 1;
}

.etude-title {
    color: #5d2f86;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.etude-excerpt {
    color: #555;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.etude-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.info-item {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-item i {
    color: #5d2f86;
}

.etude-banner-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    min-width: 200px;
}

.etude-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.etude-badges .badge {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.btn-view {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .etude-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .etude-banner-side {
        width: 100%;
        align-items: flex-start;
    }

    .etude-badges {
        flex-direction: row;
        align-items: flex-start;
    }
}

.badges-container .badge {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.study-description {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #5d2f86;
}

.study-description h5 {
    color: #5d2f86;
    margin-bottom: 1rem;
}

.study-description p {
    line-height: 1.8;
    color: #333;
    margin: 0;
}

.study-details {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.study-details p {
    margin: 0.5rem 0;
    color: #555;
}

.study-details i {
    color: #5d2f86;
    margin-right: 0.5rem;
}

.contact-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.contact-section h5 {
    color: #5d2f86;
    margin-bottom: 1rem;
}

.contact-section .btn {
    margin: 0.5rem;
    display: inline-block;
}

.contact-section .btn i {
    margin-right: 0.5rem;
}

/* ==========================================
   STYLES LARUCHE AGENCEMENT PAGE (from templates/laruche-agencement.html)
   ========================================== */

.agencement-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 80vh;
}

.workspace {
    flex: 1;
    background: rgba(255, 255, 255, 0);
    padding: 32px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.view-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    gap: 8px;
}

.help-btn {
    padding: 10px 16px;
    background: #5d2f86;
    border: 1px solid #5d2f86;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    color: white;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.help-btn:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.help-overlay {
    display: none;
}

.room-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 80px;
    overflow: auto;
    min-height: 500px;
}

.toolbar {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px solid var(--color-border);
    flex-wrap: wrap;
    align-items: center;
}

.toolbar-label {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-right: 8px;
}

.room {
    border: 3px solid var(--color-border);
    background: #fafafa;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 49px,
            var(--color-border) 49px,
            var(--color-border) 50px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 49px,
            var(--color-border) 49px,
            var(--color-border) 50px
        );
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

.room.trapezoid {
    border: none;
    background: #fafafa;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 49px,
            var(--color-border) 49px,
            var(--color-border) 50px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 49px,
            var(--color-border) 49px,
            var(--color-border) 50px
        );
}

.polygon-wall {
    position: absolute;
    background: var(--color-border);
    z-index: 15;
}

.room-dimension {
    position: absolute;
    background: #5d2f86;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(93, 47, 134, 0.3);
}

.room-dimension.horizontal {
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
}

.room-dimension.vertical {
    left: -70px;
    top: 50%;
    transform: translateY(-50%);
}

.window-wall {
    position: absolute;
    background: repeating-linear-gradient(
        0deg,
        var(--color-primary),
        var(--color-primary) 20px,
        var(--color-primary-light) 20px,
        var(--color-primary-light) 40px
    );
    z-index: 20;
}

.window-wall.left {
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        var(--color-primary),
        var(--color-primary) 20px,
        var(--color-primary-light) 20px,
        var(--color-primary-light) 40px
    );
}

.window-wall.bottom {
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        var(--color-primary),
        var(--color-primary) 20px,
        var(--color-primary-light) 20px,
        var(--color-primary-light) 40px
    );
}

.window-wall.right {
    right: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        var(--color-primary),
        var(--color-primary) 20px,
        var(--color-primary-light) 20px,
        var(--color-primary-light) 40px
    );
}

.door {
    position: absolute;
    background: rgba(139, 69, 19, 0.2);
    border: 2px solid #8b4513;
    z-index: 20;
}

.door.wall-top,
.door.wall-bottom {
    width: calc(0.93 * 1px);
    height: calc(0.93 * 1px);
}

.door.wall-left,
.door.wall-right {
    width: calc(0.93 * 1px);
    height: calc(0.93 * 1px);
}

.door::after {
    content: "";
    position: absolute;
    border: 2px solid #8b4513;
}

.door.wall-top::after {
    width: 100%;
    height: 100%;
    border-left: none;
    border-top: none;
    border-right: none;
    transform-origin: top left;
}

.door.wall-bottom::after {
    width: 100%;
    height: 100%;
    border-left: none;
    border-bottom: none;
    border-right: none;
    transform-origin: bottom left;
}

.door.wall-left::after {
    width: 100%;
    height: 100%;
    border-left: none;
    border-top: none;
    border-bottom: none;
    transform-origin: top left;
}

.door.wall-right::after {
    width: 100%;
    height: 100%;
    border-right: none;
    border-top: none;
    border-bottom: none;
    transform-origin: top right;
}

.wall-label {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text-dark);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 25;
}

.window-label {
    color: #5d2f86;
    border: 2px solid #5d2f86;
}

.door-label {
    color: #8b4513;
    border: 2px solid #8b4513;
    background: rgba(255, 255, 255, 0.95);
}

#windowLabelsContainer .window-label:first-child {
    left: 5px;
    bottom: -35px;
}

#windowLabelsContainer .window-label:nth-child(2) {
    right: -90px;
    bottom: 5px;
}

.furniture {
    position: absolute;
    border: none;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 8px;
    user-select: none;
    transition: all 0.2s;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.furniture:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transform: translateZ(0);
}

.furniture.selected {
    box-shadow:
        0 0 0 3px rgba(93, 47, 134, 0.5),
        0 6px 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.furniture.bureau {
    background: linear-gradient(135deg, #d2691e 0%, #b8581a 100%);
    color: white;
}

.furniture.armoire {
    background: linear-gradient(135deg, #8b4513 0%, #6d3610 100%);
    color: white;
}

.furniture.chaise {
    background: linear-gradient(135deg, #696969 0%, #555555 100%);
    color: white;
}

.furniture.custom {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.furniture.round {
    border-radius: 50%;
}

.furniture.semicircle {
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: flex-start;
    padding-top: 30px;
    clip-path: circle(50% at 50% 100%);
}

.furniture.bureau.semicircle {
    background: linear-gradient(135deg, #d2691e 0%, #b8581a 100%) !important;
}

.furniture.armoire.semicircle {
    background: linear-gradient(135deg, #8b4513 0%, #6d3610 100%) !important;
}

.furniture.chaise.semicircle {
    background: linear-gradient(135deg, #696969 0%, #555555 100%) !important;
}

.furniture.custom.semicircle {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
}

.furniture.semicircle.selected {
    box-shadow:
        0 0 0 3px rgba(93, 47, 134, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.25);
}

.furniture.semicircle.collision {
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.4) !important;
}

.furniture.collision {
    border-color: #f56565 !important;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.4) !important;
}

.btn {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn-add {
    background: #198754;
}
.btn-add:hover:not(:disabled) {
    background: #157347;
}

.btn-rotate {
    background: var(--color-primary);
}
.btn-rotate:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.btn-delete {
    background: #dc3545;
}
.btn-delete:hover:not(:disabled) {
    background: #b02a37;
}

.btn:disabled {
    background: var(--color-border);
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.furniture-btn {
    padding: 8px 12px;
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 12px;
    color: var(--color-text-dark);
    white-space: nowrap;
}

.furniture-btn:hover {
    background: #f7fafc;
    border-color: #5d2f86;
    transform: translateY(-2px);
}

.add-btn {
    padding: 8px 12px;
    background: #198754;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 12px;
    color: white;
    display: flex;
    align-items: center;
    gap: 4px;
}

.add-btn:hover {
    transform: translateY(-2px);
    background: #157347;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.form-group {
    margin: 16px 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-dark);
    font-weight: 600;
    font-size: 13px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #5d2f86;
    box-shadow: 0 0 0 0.25rem rgba(93, 47, 134, 0.25);
}

.info {
    background: var(--color-primary-light);
    padding: 12px 16px;
    border-radius: 4px;
    margin: 12px 0;
    font-size: 13px;
    color: #1d2d35;
    border: 1px solid #5d2f86;
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff !important;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    filter: none !important;
    opacity: 1 !important;
    isolation: isolate;
    will-change: transform;
}

.modal-content *,
.modal-content *::before,
.modal-content *::after {
    filter: none !important;
    opacity: 1 !important;
    -webkit-filter: none !important;
}

.modal-content h2 {
    color: var(--color-text-dark) !important;
}

.modal-content label {
    color: var(--color-text-dark) !important;
}

.help-section {
    margin-bottom: 24px;
}

.help-panel h2,
.help-panel h3,
.help-panel p,
.help-panel li,
.help-panel div,
.help-panel button {
    filter: none !important;
    opacity: 1 !important;
}

.help-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section ul {
    list-style: none;
    margin-left: 0;
}

.help-section li {
    padding: 8px 0;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
}

.help-section li strong {
    color: var(--color-text-dark);
    font-weight: 600;
}

.keyboard-key {
    display: inline-block;
    padding: 2px 8px;
    background: #f7fafc;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: monospace;
    font-weight: 600;
    font-size: 12px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f7fafc;
    color: var(--color-text-dark);
}

.shape-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.shape-option {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background: white;
}

.shape-option:hover {
    border-color: #cbd5e0;
}

.shape-option.selected {
    border-color: #5d2f86;
    background: var(--color-primary-light);
}

.shape-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.shape-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-dark);
}

.selected-furniture-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.selected-furniture-info .info {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

/* Navigation ajoutée au thème (inc/navigation.php). */
.labo-compte-nav .nav-link { white-space: nowrap; }
.labo-compte { color: #6c757d; }
@media (min-width: 768px) { .labo-compte-nav { margin-left: 1rem; } }

/* Barre d'administration WordPress (utilisateur connecté), fixée en haut de page : les éléments
   fixes du thème descendent de sa hauteur (--wp-admin--admin-bar--height, 32 px ou 46 px,
   wp-includes/css/admin-bar.css). Sous 600 px, WordPress la fait défiler avec la page : on la
   garde fixe, sinon l'en-tête laisserait un vide au-dessus de lui en défilant. */
.admin-bar .fixed-top { top: var(--wp-admin--admin-bar--height, 32px); }
.admin-bar .back-button { top: calc(95px + var(--wp-admin--admin-bar--height, 32px)); }
.admin-bar .info-card { top: calc(140px + var(--wp-admin--admin-bar--height, 32px)); }
@media screen and (max-width: 600px) {
    .admin-bar #wpadminbar { position: fixed; }
}

.labo-ariane { font-size: .875rem; padding-top: 1rem; }
.labo-ariane ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.labo-ariane li + li::before { content: "›"; padding: 0 .5rem; color: #6c757d; }
.labo-ariane [aria-current] { color: #6c757d; }

/* Cartes de l'accueil réservées aux membres : cadenas pour les visiteurs. */
body:not(.logged-in) a#home[href="/material"] h2::after,
body:not(.logged-in) a#home[href="/wiki"] h2::after {
    content: "\f023";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: .8em;
    margin-left: .5rem;
    color: #6c757d;
}
