/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #1e293b;
    --accent-color: #ec4899;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #f8fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --success-color: #10b981;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    margin-left: 3rem;
    justify-content: flex-end;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
    font-weight: 600;
    letter-spacing: 0.025em;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #34495e;
}

.btn-outline {
    border: 2px solid var(--white);
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    font-weight: 600;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(255, 255, 255, 0.3);
}

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

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

/* Responsive */
@media (min-width: 768px) {
    .nav {
        display: block;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
    
    .header-actions {
        display: flex;
    }
}

@media (max-width: 767px) {
    .header-actions {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    /* Masquer le dropdown desktop sur mobile */
    .user-dropdown {
        display: none !important;
    }
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.user-menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.user-menu .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

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

.user-menu .user-name {
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu .fa-chevron-down {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.user-menu.active .fa-chevron-down {
    transform: rotate(180deg);
}

/* User menu position */
.user-menu {
    position: relative;
    margin-left: auto;
}

/* Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 280px;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

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

.dropdown-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.03) 0%, rgba(41, 128, 185, 0.03) 100%);
}

.dropdown-header .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.dropdown-header .user-details {
    flex: 1;
    min-width: 0;
}

.dropdown-header .name {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.dropdown-header .email {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
}

.dropdown-menu-items {
    padding: 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: rgba(52, 152, 219, 0.08);
    color: var(--primary-color);
    transform: translateX(4px);
}

.dropdown-item i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    opacity: 0.7;
}

.dropdown-item.admin {
    color: #9b59b6;
}

.dropdown-item.admin:hover {
    background-color: rgba(155, 89, 182, 0.1);
    color: #8e44ad;
}

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

.dropdown-item.logout:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem;
}

/* Dropdown overlay */
.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
    display: none;
}

.dropdown-overlay.active {
    display: block;
}

/* Image par défaut */
img[src="/images/default-avatar.svg"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Menu Mobile */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
    position: relative;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

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

.mobile-menu-toggle .hamburger-icon,
.mobile-menu-toggle .close-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

body.menu-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--white);
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        z-index: 999;
        padding: 2rem;
        overflow-y: auto;
        transition: right 0.3s;
        display: block;
        justify-content: flex-start;
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav.nav-open {
        right: 0;
    }
    
    .nav > * {
        display: block;
        margin-bottom: 1rem;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-bottom: 2rem;
    }
    
    .nav-link {
        display: block;
        padding: 0.75rem 0;
        font-size: 1.125rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-actions {
        display: none;
    }
    
    .user-menu {
        margin-top: 2rem;
        margin-left: 0;
    }
    
    .user-menu-toggle {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem;
        background: var(--bg-color);
        border-radius: 0.5rem;
    }
    
    .user-dropdown {
        position: static !important;
        display: none !important;
        margin-top: 1rem;
        box-shadow: none;
        border: 1px solid var(--border-color);
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
    
    .user-dropdown.active {
        display: block !important;
    }
    
    .dropdown-overlay {
        display: none !important;
    }
    
    .btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 1rem;
    }
}

/* Navigation links group */
.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-right: auto;
}

@media (min-width: 769px) {
    .nav {
        display: flex;
        align-items: center;
        gap: 2rem;
    }
    
    .header-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    /* Alignement des boutons connexion/inscription en desktop */
    .nav .btn {
        margin-bottom: 0;
        width: auto;
        display: inline-block;
    }
    
    .nav .btn:last-child {
        margin-left: 0.5rem;
    }
}