/* CSS pour header et footer - Utilise les variables globales depuis base.css */

/* ===== HEADER STYLES ===== */

/* Styles de base pour le header */
.theme-toggle {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--border-radius-small);
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
}

.theme-toggle:hover {
    background-color: rgba(125, 125, 125, 0.2);
}

/* Structure de base du header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    box-shadow: var(--card-shadow);
}

/* Permettre le défilement horizontal uniquement pour le contenu */
body {
    overflow-x: hidden;
}

.content-wrapper {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 1rem;
}

/* Tables responsives pour les données administratives */
.surveys-table {
    min-width: 100%;
    width: auto;
}

/* Sur très petits écrans, compacter encore plus les cellules */
@media (max-width: 480px) {
    .surveys-table th,
    .surveys-table td {
        padding: 8px 6px;
        font-size: 0.9rem;
    }
    
    .mobile-hide {
        display: none;
    }
    
    .note-stars {
        font-size: 0.8rem;
    }
}

/* Indiquer à l'utilisateur qu'il peut faire défiler horizontalement */
.scroll-indicator {
    display: none;
    text-align: center;
    padding: 8px;
    background-color: rgba(108, 117, 125, 0.1);
    border-radius: var(--border-radius-small);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .scroll-indicator {
        display: block;
    }
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px;
    width: 100%;
}

/* Assurer que le footer reste fixé en bas sur toutes les largeurs */
.site-footer {
    width: 100vw;
    left: 0;
    right: 0;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    z-index: 1002;
}

.logo img {
    height: 40px;
    width: auto;
    transition: filter 0.3s ease;
}

/* Filtre pour inverser le logo en thème sombre */
:root[data-theme="dark"] .logo img {
    filter: invert(1) brightness(1);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Structure du menu principal */
.main-nav {
    display: flex;
    align-items: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #495057;
}

:root[data-theme="dark"] .main-nav a:hover {
    color: #e9ecef;
}

/* Bouton hamburger pour mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
}

/* Style pour la zone utilisateur connecté */
.user-info {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--border-radius-small);
    background-color: rgba(108, 117, 125, 0.1);
    position: relative;
}

.user-info i {
    margin-right: 8px;
    color: var(--info-color);
}

.user-name {
    font-weight: 500;
    margin-right: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.user-name:after {
    content: "\f0d7";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-left: 5px;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.user-info:hover .user-name:after {
    transform: rotate(180deg);
}

.admin-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    box-shadow: var(--card-shadow);
    border-radius: var(--border-radius-small);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    margin-top: 5px;
    transition: all 0.3s ease;
    transform: translateY(-10px);
    pointer-events: none;
}

.user-info:hover .admin-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.admin-dropdown:before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
}

.admin-dropdown:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.admin-dropdown-header {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    color: #495057;
}

:root[data-theme="dark"] .admin-dropdown-header {
    color: #e9ecef;
}

.admin-dropdown-item {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.2s;
}

.admin-dropdown-item:hover {
    background-color: rgba(108, 117, 125, 0.1);
}

.admin-dropdown-item i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.admin-dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 5px 0;
}

.logout-item {
    border-top: 1px solid var(--border-color);
}

.logout-item i {
    color: var(--error-color);
}

/* Séparateur pour le menu utilisateur */
.nav-separator {
    border-left: 1px solid rgba(125, 125, 125, 0.3);
    height: 24px;
    margin: 0 10px;
}

/* Éléments spécifiques pour mobile - cachés en version desktop */
.menu-close,
.user-welcome,
.mobile-theme-toggle,
.menu-overlay {
    display: none;
}

/* Cacher le header mobile du menu admin en desktop */
.admin-dropdown-header {
    display: none;
}

/* Styles pour la version mobile */
@media (max-width: 768px) {
    .site-header .container {
        padding: 15px 15px;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
    
    /* Afficher le bouton hamburger */
    .menu-toggle {
        display: block;
        margin-left: auto;
        transition: opacity 0.3s ease;
    }
    
    /* Classe pour masquer le bouton hamburger quand le menu est ouvert */
    .menu-toggle.hidden {
        opacity: 0;
        pointer-events: none;
    }
    
    /* Masquer le bouton de thème sur mobile - sera déplacé dans le menu */
    .theme-toggle-wrapper {
        display: none;
    }
    
    /* Réorganiser le menu principal pour mobile */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--card-bg);
        box-shadow: var(--card-shadow);
        transition: all 0.3s ease;
        z-index: 1001;
        padding-top: 60px;
        overflow-y: auto;
        text-align: center;
    }
    
    /* Quand le menu est ouvert */
    .main-nav.active {
        right: 0;
    }
    
    /* Overlay quand le menu est ouvert */
    .menu-overlay.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }
    
    /* Bouton de fermeture du menu */
    .menu-close {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        color: var(--text-color);
        font-size: 1.3rem;
        cursor: pointer;
        padding: 5px;
        z-index: 1003;
    }
    
    /* Réorganiser la liste du menu */
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .main-nav li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
        text-align: center;
    }
    
    .main-nav li a {
        display: flex;
        padding: 15px 20px;
        width: 100%;
        justify-content: center;
        align-items: center;
    }
    
    .main-nav li a i {
        margin-right: 10px;
    }
    
    /* Adaptations pour les séparateurs et menus déroulants */
    .nav-separator {
        display: none;
    }
    
    .user-info {
        flex-direction: column;
        align-items: center;
        background: none;
        padding: 0;
        width: 100%;
    }
    
    .user-welcome {
        display: flex;
        padding: 15px 20px;
        width: 100%;
        justify-content: center;
        align-items: center;
        font-weight: 500;
        border-bottom: 1px solid var(--border-color);
    }
    
    .user-welcome i {
        margin-right: 10px;
        color: var(--info-color);
    }
    
    /* Le menu déroulant devient une liste déployable sur mobile */
    .user-name {
        display: none;
    }
    
    .admin-dropdown {
        position: static;
        background: none;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        margin: 0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        text-align: center;
    }
    
    /* Quand le sous-menu est déplié */
    .admin-menu-open .admin-dropdown {
        max-height: 500px;
    }
    
    /* Adapté pour mobile - afficher le header mobile du menu admin */
    .admin-dropdown-header {
        display: flex;
        padding: 15px 20px;
        cursor: pointer;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .admin-dropdown-header i {
        margin-right: 10px;
    }
    
    .admin-dropdown-header:after {
        content: "\f0d7";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        transition: transform 0.3s;
        margin-left: 10px;
    }
    
    .admin-menu-open .admin-dropdown-header:after {
        transform: rotate(180deg);
    }
    
    .admin-dropdown-item {
        padding: 12px 20px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Ajouter le bouton de thème dans le menu mobile */
    .mobile-theme-toggle {
        display: flex;
        padding: 15px 20px;
        justify-content: center;
        align-items: center;
        width: 100%;
        margin-top: 20px;
        border-top: 1px solid var(--border-color);
        cursor: pointer;
        background: none;
        border-left: none;
        border-right: none;
        border-bottom: none;
        color: var(--text-color);
        font-size: inherit;
    }
    
    .mobile-theme-toggle i {
        margin-right: 10px;
    }
}

/* ===== FOOTER STYLES ===== */

/* Footer simple et moderne */
.site-footer {
    background: linear-gradient(135deg, #495057 0%, #6c757d 50%, #343a40 100%);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

:root[data-theme="dark"] .site-footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #000000 100%);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-logo {
    height: 35px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer-brand p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #adb5bd;
}

:root[data-theme="dark"] .footer-links a:hover {
    color: #ced4da;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-small);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #adb5bd;
    transform: translateY(-2px);
}

:root[data-theme="dark"] .social-link:hover {
    background: #ced4da;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.footer-legal {
    display: flex;
    gap: 20px;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.footer-legal a:hover {
    color: #adb5bd;
}

:root[data-theme="dark"] .footer-legal a:hover {
    color: #ced4da;
}

/* Responsive pour footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 25px;
        text-align: center;
    }

    .footer-brand {
        flex-direction: column;
        gap: 10px;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .footer-legal {
        gap: 15px;
    }
}