/* ========================================
   CASA17 - Topbar Styles (Exact from index.html)
   Version: 2.0
   Description: Styles identiques à la topbar de l'index.html
   ======================================== */

/* TOPBAR */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: var(--z-topbar);
    animation: slideDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--padding-topbar);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-logo {
    display: flex;
    align-items: center;
}

.topbar-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s ease;
}

.topbar-logo a:hover {
    transform: scale(1.05);
}

.topbar-logo img {
    height: 50px;
    width: 50px;
    margin-right: 10px;
    /* Solution pour visibilité sur fond sombre */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #F4F4F4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* NAVIGATION */
.topbar-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Exceptions pour les liens de navigation qui doivent garder leur style */
.topbar-logo a {
    color: var(--text-primary);
}

.topbar-logo a:hover {
    text-decoration: none;
    opacity: 1;
}

.dropdown-container {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3a3a3a 0%, #2d2d2d 50%, #1a1a1a 100%);
    border: none;
    border-radius: 12px;
    color: #F4F4F4;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.icon-menu::before {
    content: '☰';  /* 3 lignes horizontales */
    font-size: 18px;
    color: #cad8da; /* Gris clair CASA17 - toujours visible sur topbar sombre */
}

.icon-tools::before {
    content: '⚙';  /* Engrenage */
    font-size: 18px;
    color: #cad8da; /* Gris clair CASA17 - toujours visible sur topbar sombre */
}

.icon-accessibility::before {
    content: '♿';  /* Symbole accessibilité universel */
    font-size: 18px;
    color: #cad8da; /* Gris clair CASA17 - toujours visible sur topbar sombre */
}

.icon-user::before {
    content: '☺';  /* Visage souriant simple */
    font-size: 20px;
    color: #cad8da; /* Gris clair CASA17 - toujours visible sur topbar sombre */
}

/* Icônes inline pour le contenu */
.icon-home::before { content: '⌂'; margin-right: 8px; }  /* Maison */
.icon-calendar::before {
    content: '▤';
    margin-right: 8px;
    font-size: 1.1em;
    position: relative;
    top: 1px;
}  /* Mini calendrier (grille) */
.icon-handshake::before { content: '✋'; margin-right: 8px; }  /* Main ouverte */
.icon-building::before { content: '█'; margin-right: 8px; }  /* Rectangle plein (bâtiment) */
.icon-people::before { content: '☺☺'; margin-right: 8px; font-size: 0.9em; }  /* Deux visages */
.icon-doc::before { content: '☐'; margin-right: 8px; }  /* Case à cocher vide (document) */
.icon-newspaper::before {
    content: '≡';
    margin-right: 8px;
    font-size: 1.4em;
    font-weight: bold;
    position: relative;
    top: -1px;
}  /* Journal (trois lignes = texte d'article) */
.icon-mail::before { content: '✉'; margin-right: 8px; }  /* Enveloppe */
.icon-search::before { content: '○'; margin-right: 8px; }  /* Cercle (loupe) */
.icon-location::before { content: '▲'; margin-right: 8px; }  /* Triangle (marqueur) */
.icon-clock::before { content: '○'; margin-right: 8px; }  /* Cercle (horloge) */
.icon-phone::before { content: '☎'; margin-right: 8px; }  /* Téléphone */
.icon-lock::before { content: '■'; margin-right: 8px; }  /* Carré plein (cadenas) */
.icon-sun::before { content: '☀'; margin-right: 8px; }  /* Soleil */
.icon-moon::before { content: '☾'; margin-right: 8px; }  /* Lune */
.icon-book::before { content: '☰'; margin-right: 8px; }  /* Lignes (livre) */
.icon-write::before { content: '✏'; margin-right: 8px; }  /* Crayon */
.icon-key::before { content: '†'; margin-right: 8px; }  /* Croix (clé) */
.icon-speaker::before { content: '♪'; margin-right: 8px; }  /* Note de musique */
.icon-factory::before { content: '██'; margin-right: 8px; font-size: 0.8em; }  /* Usine */

.dropdown-toggle:hover .icon-menu::before,
.dropdown-toggle:hover .icon-tools::before,
.dropdown-toggle:hover .icon-accessibility::before,
.dropdown-toggle:hover .icon-user::before {
    color: var(--casa17-orange-vif);
    text-shadow: 0 0 8px rgba(255, 132, 49, 0.6);
}

.dropdown-toggle:hover {
    background: linear-gradient(135deg, #4a4a4a 0%, #3d3d3d 50%, #2a2a2a 100%);
    color: var(--casa17-orange-vif);
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 15px rgba(255, 132, 49, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 250px;
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border: 1px solid #444;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-dropdown);
    overflow: hidden;
}

/* Menu à tiroir */
.drawer-menu {
    position: fixed;
    top: 70px;
    left: -400px;
    width: 380px;
    height: calc(100vh - 70px);
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-right: 2px solid #444;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.drawer-menu.show {
    left: 0;
}

.drawer-overlay {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.drawer-overlay.show {
    opacity: 1;
    visibility: visible;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--casa17-vert-fonce);
}

.drawer-title {
    color: var(--casa17-orange-vif);
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0;
}

.drawer-close {
    background: transparent;
    border: none;
    color: #F4F4F4;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.drawer-close:hover {
    background: rgba(255, 132, 49, 0.2);
    color: var(--casa17-orange-vif);
}

.drawer-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawer-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #444;
}

.drawer-section h3 {
    color: var(--casa17-orange-vif);
    font-size: 1.1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--casa17-vert-fonce);
}

.drawer-section a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #F4F4F4;
    border-radius: 6px;
    margin-bottom: 4px;
    font-family: var(--font-primary);
    transition: all 0.2s ease;
    font-size: var(--font-body);
    cursor: pointer;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.drawer-section a:hover {
    background: linear-gradient(90deg, rgba(255, 132, 49, 0.2) 0%, rgba(255, 132, 49, 0.1) 100%);
    color: var(--casa17-orange-vif);
    transform: translateX(8px);
    box-shadow: inset 3px 0 0 var(--casa17-orange-vif);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-section {
    padding: 10px 0;
    border-bottom: 1px solid var(--casa17-vert-fonce);
}

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

.dropdown-section h3 {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-title);
    margin: 0;
}

.dropdown-menu a,
.accessibility-btn {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #F4F4F4;
    border-bottom: 1px solid var(--casa17-vert-fonce);
    font-family: var(--font-primary);
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: var(--font-body);
}

.dropdown-menu a:last-child,
.accessibility-btn:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover,
.accessibility-btn:hover {
    background: linear-gradient(90deg, rgba(255, 132, 49, 0.2) 0%, rgba(255, 132, 49, 0.1) 100%);
    color: var(--casa17-orange-vif);
    padding-left: 25px;
    box-shadow: inset 3px 0 0 var(--casa17-orange-vif);
}

/* Bouton connexion avec style vert CASA */
.btn-connexion {
    background: var(--casa17-vert-fonce) !important;
    color: var(--casa17-blanc) !important;
    border-color: var(--casa17-vert-fonce) !important;
}

.btn-connexion:hover {
    background: #1a4d52 !important;
    transform: translateY(-2px);
}

/* Contrôles de taille de police */
.font-size-controls {
    padding: 12px 20px;
    border-bottom: 1px solid var(--casa17-vert-fonce);
    display: flex;
    align-items: center;
    gap: 10px;
    color: #F4F4F4;
}

.font-size-controls span {
    font-size: 0.9rem;
    margin-right: 10px;
}

.font-btn {
    background: var(--casa17-vert-fonce);
    color: var(--casa17-gris-clair);
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.font-btn:hover {
    background: var(--casa17-orange-vif);
    transform: scale(1.1);
}

/* Menu mobile */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: #cad8da; /* Gris clair CASA17 - toujours visible sur topbar sombre */
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Menu mobile overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mobile-menu-section {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid #444;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.mobile-menu-section h3 {
    color: var(--casa17-orange-vif);
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--casa17-orange-vif);
    text-align: center;
}

.mobile-menu-section .menu-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu-section a,
.mobile-menu-section button {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #F4F4F4;
    background: transparent;
    border: 1px solid #555;
    border-radius: 8px;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
    text-align: left;
    cursor: pointer;
    font-size: var(--font-body);
}

.mobile-menu-section a:hover,
.mobile-menu-section button:hover {
    background: linear-gradient(90deg, rgba(255, 132, 49, 0.2) 0%, rgba(255, 132, 49, 0.1) 100%);
    color: var(--casa17-orange-vif);
    border-color: var(--casa17-orange-vif);
    transform: translateX(5px);
}

.mobile-menu-section .accessibility-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu-section .font-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.mobile-menu-section .font-controls button {
    flex: 1;
    padding: 8px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .topbar-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        z-index: 1001;
    }

    .mobile-menu-grid {
        grid-template-columns: 1fr;
    }
}