﻿/* Variables CSS pour le thème Rouge, Blanc, Bleu - BOUTONS EN BLEU */
:root {
    --primary-red: #1f4788; /* Changé de rouge à bleu */
    --primary-blue: #1f4788;
    --primary-white: #ffffff;
    --secondary-red: #2d5aa0; /* Changé de rouge à bleu */
    --secondary-blue: #2d5aa0;
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --dark-gray: #343a40;
    --success-green: #28a745;
    --warning-yellow: #ffc107;
    --danger-red: #dc3545; /* Conservé pour les erreurs */
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: transform 0.15s ease, opacity 0.15s ease;
    --transition-colors: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
    --transition-fast: transform 0.1s ease, opacity 0.1s ease;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sections principales avec fond blanc */
.main {
    background: white;
    min-height: calc(100vh - 200px);
}

.main section {
    background: white;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-gray);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--medium-gray);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-blue);
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    min-width: 120px;
    will-change: transform, box-shadow, background;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red), var(--secondary-red));
    color: var(--primary-white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-red), var(--primary-red));
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
    color: var(--primary-white);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--primary-white);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
    color: var(--primary-white);
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: var(--primary-white);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.125rem;
}

.btn-full {
    width: 100%;
}

.btn-danger {
    background: var(--danger-red);
    color: var(--primary-white);
}

.btn-danger:hover {
    background: #c82333;
    color: var(--primary-white);
}

/* Header */
.header {
    background: linear-gradient(135deg, #1a2d4f, #234a7a, #2d5aa0);
    background-size: 200% 200%;
    /* Removed gradientShiftNav animation for performance */
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 1px 40px rgba(59, 130, 246, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    /* backdrop-filter: blur(10px); - Removed for performance */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* @keyframes gradientShiftNav - Removed for performance */

.header .container {
    padding: 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem 1.25rem 0;
    gap: 2rem;
    position: relative;
}

.header-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2) 20%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0.2) 80%, 
        transparent);
    /* Removed shimmerLine animation for performance */
}

/* @keyframes shimmerLine - Removed for performance */

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: -200px;
    position: relative;
    z-index: 10;
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    /* Removed logoGlow animation for performance */
}

/* @keyframes logoGlow - Removed for performance */

.logo-text h1 {
    color: var(--primary-white);
    font-size: 1.75rem;
    margin: 0;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ffffff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.logo-text span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 400;
    display: block;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.05);
    /* backdrop-filter: blur(10px); - Removed for performance */
    border-radius: 50px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.main-nav a {
    color: var(--primary-white);
    font-weight: 500;
    padding: 0.875rem 1.75rem;
    border-radius: 25px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    display: block;
    background: transparent;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.main-nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
    border-radius: 25px;
    transform: scale(0);
    transition: transform 0.3s ease;
    z-index: -1;
}

.main-nav a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-white);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(59, 130, 246, 0.3),
        0 4px 10px rgba(0, 0, 0, 0.2);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.main-nav a:hover::before,
.main-nav a.active::before {
    transform: scale(1);
}

.main-nav a:hover::after {
    left: 100%;
}

.main-nav a.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(147, 51, 234, 0.3));
    font-weight: 600;
    box-shadow: 
        0 0 20px rgba(59, 130, 246, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-buttons .btn {
    padding: 0.875rem 2rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 25px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.auth-buttons .btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--primary-white);
    /* backdrop-filter: blur(5px); - Removed for performance */
}

.auth-buttons .btn-outline:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(255, 255, 255, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

.auth-buttons .btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.auth-buttons .btn-primary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 0 20px rgba(59, 130, 246, 0.6),
        0 8px 25px rgba(59, 130, 246, 0.4),
        0 4px 10px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #4f87ff, #6366f1);
}

.auth-buttons .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-buttons .btn:hover::before {
    left: 100%;
}

.user-menu {
    position: relative;
}

.user-info {
    color: var(--primary-white);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    border-radius: 25px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    /* backdrop-filter: blur(10px); - Removed for performance */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.user-info:hover {
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 8px 25px rgba(255, 255, 255, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.2);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.user-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    border-radius: 25px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-info:hover::before {
    opacity: 1;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-info::after {
    content: '▼';
    font-size: 0.75rem;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.user-info:hover::after {
    transform: translateY(1px);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    display: none;
    z-index: 1001;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-family: 'Poppins', sans-serif;
}

.user-menu:hover .user-dropdown {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Créer un "pont invisible" pour éviter la fermeture du menu */
.user-dropdown::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
}

/* Flèche du dropdown */
.user-dropdown::after {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #ffffff;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
}

.user-dropdown button,
.user-dropdown a {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 400;
    color: #374151;
    text-decoration: none;
    gap: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    font-family: 'Poppins', sans-serif;
    justify-content: flex-start;
}

.user-dropdown button:last-child,
.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown button:hover,
.user-dropdown a:hover {
    background: #f8fafc;
    color: #1f2937;
    padding-left: 1.75rem;
}

.user-dropdown button::before,
.user-dropdown a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.user-dropdown button:hover::before,
.user-dropdown a:hover::before {
    transform: scaleY(1);
}

.btn-admin a {
    color: #3b82f6 !important;
    font-weight: 500;
}

.btn-admin a:hover {
    color: #1d4ed8 !important;
}

.btn-logout {
    color: #ef4444 !important;
    font-weight: 500;
}

.btn-logout:hover {
    color: #dc2626 !important;
    background: #fef2f2 !important;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 12px;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    gap: 3px;
    /* backdrop-filter: blur(10px); - Removed for performance */
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-white);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Animation hamburger quand actif */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Footer */
.footer {
    background: var(--dark-gray);
    color: var(--primary-white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--primary-white);
    margin-bottom: 1rem;
}

.footer-section h3 {
    color: var(--primary-red);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-white);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    padding: 0.5rem 1rem;
    background: var(--primary-blue);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--secondary-blue);
    color: var(--primary-white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

/* Utilitaires */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--medium-gray);
    font-style: italic;
}

.text-center {
    text-align: center;
}

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    font-weight: 500;
}

.alert.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-green);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.alert.alert-error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-red);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.alert.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.alert.alert-info {
    background: rgba(31, 71, 136, 0.1);
    color: var(--primary-blue);
    border: 1px solid rgba(31, 71, 136, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    header {
        position: relative;
    }
    
    .header-content {
        flex-wrap: wrap;
        padding: 0.5rem 1rem 0.5rem 1rem;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Correction du logo sur mobile */
    .logo {
        margin-left: 0 !important;
        gap: 0.5rem;
    }
    
    .logo-text h1 {
        font-size: 1.2rem;
    }
    
    .logo-text span {
        font-size: 0.75rem;
    }
    
    .logo-icon {
        font-size: 1.8rem;
    }
    
    /* Masquer la section auth sur mobile pour gagner de la place */
    .auth-section {
        display: none;
    }
    
    /* Afficher seulement le bouton mobile menu */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .main-nav {
        display: none;
        width: 100%;
        order: 3;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .main-nav.active {
        display: block !important;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        background: white;
        border-radius: 0;
        margin: 0;
        padding: 1rem;
    }
    
    .main-nav a {
        padding: 0.875rem 1rem;
        border-radius: 0;
        border-bottom: 1px solid #eee;
        display: block;
        color: #333;
        text-decoration: none;
    }
    
    .main-nav a:hover {
        background: #f8f9fa;
        color: #007bff;
    }
    
    .main-nav a::before {
        display: none;
    }
    
    .main-nav li:last-child a {
        border-bottom: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }
    
    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 10px 20px;
        min-width: 100px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Améliorations générales pour mobile */
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* Espacement des sections */
    section {
        padding: 2rem 0;
    }
    
    /* Améliorer les cartes d'articles sur mobile */
    .article-card {
        margin-bottom: 1rem;
    }
}