/* ==========================================================================
   HEADER - LE DOSSIER MAROC
   ========================================================================== */

/* Top Bar */
.top-bar {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    border-bottom: 2px solid var(--primary-color);
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-bar-left i {
    color: var(--primary-color);
}

#current-date {
    font-weight: 500;
    text-transform: capitalize;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-link,
.btn-back,
.premium-link,
.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-link,
.btn-back {
    background: rgba(255, 255, 255, 0.1);
}

.admin-link:hover,
.btn-back:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.admin-link i,
.btn-back i {
    font-size: 1rem;
}

/* Main Header */
.main-header {
    background: white;
    padding: 1.25rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

/* Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.menu-toggle:hover {
    color: var(--primary-color);
}

/* Logo */
.logo {
    flex: 0 0 auto;
}

.logo a {
    display: flex;
    align-items: baseline;
    text-decoration: none;
    font-family: 'Merriweather', serif;
    font-weight: 900;
    letter-spacing: -1px;
}

.logo-le {
    font-size: 2rem;
    color: var(--primary-color);
    margin-right: 0.25rem;
}

.logo-matin {
    font-size: 2rem;
    color: var(--text-dark);
}

.logo-i {
    color: var(--primary-color);
    font-style: italic;
}

.logo-ma {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-left: 0.25rem;
    font-weight: 700;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-toggle,
.newsletter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-toggle:hover,
.newsletter-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.search-toggle i,
.newsletter-btn i {
    font-size: 1.1rem;
}

/* Navigation */
.main-nav {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu a:hover {
    background: rgba(39, 174, 96, 0.15);
    color: var(--primary-color);
}

.nav-menu a:hover::before {
    width: 80%;
}

.nav-menu a i {
    font-size: 1rem;
}

/* Catégorie active */
.nav-menu a.active {
    background: rgba(39, 174, 96, 0.2);
    color: var(--primary-color);
}

.nav-menu a.active::before {
    width: 80%;
}

/* Search Bar */
.search-bar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.search-bar.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.search-form {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.search-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-form button[type="submit"] {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-form button[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.search-close {
    padding: 1rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-close:hover {
    background: #c0392b;
}

/* Responsive */
@media (max-width: 1200px) {
    .nav-menu a {
        padding: 0.875rem 1.25rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 992px) {
    .btn-text {
        display: none;
    }
    
    .search-toggle,
    .newsletter-btn {
        padding: 0.75rem;
    }
    
    .nav-menu {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu a {
        padding: 0.875rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .top-bar {
        font-size: 0.75rem;
        padding: 0.375rem 0;
    }
    
    .admin-link span,
    .btn-back span {
        display: none;
    }
    
    .admin-link,
    .btn-back {
        padding: 0.375rem 0.625rem;
    }
    
    .main-header {
        padding: 1rem 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .logo-le {
        font-size: 1.5rem;
    }
    
    .logo-matin {
        font-size: 1.5rem;
    }
    
    .logo-ma {
        font-size: 1rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .main-nav {
        display: none;
    }
    
    .main-nav.mobile-active {
        display: block;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-menu a {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 480px) {
    .search-form {
        flex-direction: column;
    }
    
    .search-form button[type="submit"],
    .search-close {
        width: 100%;
    }
}

/* Animation de chargement */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-menu li {
    animation: fadeIn 0.3s ease forwards;
}

.nav-menu li:nth-child(1) { animation-delay: 0.05s; }
.nav-menu li:nth-child(2) { animation-delay: 0.1s; }
.nav-menu li:nth-child(3) { animation-delay: 0.15s; }
.nav-menu li:nth-child(4) { animation-delay: 0.2s; }
.nav-menu li:nth-child(5) { animation-delay: 0.25s; }
.nav-menu li:nth-child(6) { animation-delay: 0.3s; }
.nav-menu li:nth-child(7) { animation-delay: 0.35s; }
