/* Layout CSS - Styles pour navigation, footer, messages système */

/* Styles globaux pour la navigation */
.main-nav {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-gold);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-2xl);
}

.nav-logo:hover {
    text-decoration: none;
    color: var(--primary-gold-dark);
}

.nav-logo i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.nav-item a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item a:hover {
    color: #b8956d;
    text-decoration: none;
}

.nav-item.active a {
    color: #b8956d;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu {
    position: relative;
}

.user-btn {
    background: #b8956d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
}

.user-btn:hover {
    background: #a68659;
    text-decoration: none;
    color: white;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    display: none;
    z-index: 1000;
    margin-top: 10px;
    /* Empêcher le débordement hors de l'écran */
    transform: translateX(0);
}

/* Ajustement automatique du dropdown sur les petits écrans */
@media (max-width: 480px) {
    .user-dropdown {
        right: -10px;
        min-width: 180px;
        transform: translateX(-50%);
    }
}

/* Solution alternative : positionner le dropdown à gauche sur très petits écrans */
@media (max-width: 380px) {
    .user-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        min-width: 160px;
    }
}

.user-dropdown.active {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
    border-bottom: 1px solid #f5f5f5;
}

.user-dropdown a:hover {
    background: #f8f9fa;
    color: #b8956d;
    text-decoration: none;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.logout-link {
    color: #e74c3c !important;
}

.logout-link:hover {
    background: #fdf2f2 !important;
    color: #c0392b !important;
}

.login-btn {
    background: #b8956d;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}

.login-btn:hover {
    background: #a68659;
    text-decoration: none;
    color: white;
}

/* Mobile menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 20px;
}

.mobile-menu.active {
    display: block;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-menu li {
    margin-bottom: 15px;
}

.mobile-nav-menu a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.mobile-nav-menu .logout-link {
    color: #e74c3c !important;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: white;
    margin-top: 80px;
    padding: 40px 0 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #b8956d;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
}

/* Messages système */
.messages {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.message {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #b8956d;
    animation: slideIn 0.3s ease;
}

.message.success {
    border-left-color: #27ae60;
}

.message.error {
    border-left-color: #e74c3c;
}

.message.warning {
    border-left-color: #f39c12;
}

/* Styles pour les alertes (compatibilité avec les classes alert) */
.alert {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #b8956d;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    border-left-color: #27ae60;
    background: #f8fff8;
    color: #155724;
}

.alert-error {
    border-left-color: #e74c3c;
    background: #fff8f8;
    color: #721c24;
}

.alert-warning {
    border-left-color: #f39c12;
    background: #fffaf0;
    color: #856404;
}

.alert-info {
    border-left-color: #3498db;
    background: #f0f8ff;
    color: #0c5460;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .user-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-container {
        padding: 0 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .user-dropdown {
        right: auto;
        left: 0;
    }
}

/* Masquer le footer en mode PWA */
@media (display-mode: standalone) {
    .main-footer {
        display: none;
    }
}

/* Masquer le footer sur mobile en général (optionnel - pour être plus agressif) */
@media (max-width: 768px) and (display-mode: standalone) {
    .main-footer {
        display: none;
    }
}

/* Prévention du zoom sur mobile */
@media (max-width: 768px) {
    /* Empêcher le zoom sur les inputs */
    input, select, textarea {
        font-size: 16px !important;
        transform-origin: left top;
        transform: scale(1);
    }

    /* Empêcher le zoom sur double-tap */
    * {
        touch-action: manipulation;
    }

    /* Stabiliser les éléments lors des interactions */
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}