/* ============================================
   SERENZER - CSS COMMUN
   ============================================ */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Couleurs principales Serenzer */
    --primary-color: #32717b;
    --primary-dark: #255962;
    --primary-light: #4a9aa8;
    
    /* Couleurs sphères gamification */
    --sphere-red: #e74c3c;
    --sphere-yellow: #f39c12;
    --sphere-blue: #3498db;
    
    /* Couleurs UI */
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e1e8ed;
    --hover-bg: #f0f3f5;
    
    /* Alertes */
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    
    /* Espacements */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Bordures */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header Navigation */
.header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.25rem;
}

.logo img {
    height: 40px;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.nav a:hover {
    color: var(--primary-color);
    background-color: rgba(50, 113, 123, 0.05);
}

.nav a.active {
    color: var(--primary-color);
    font-weight: 600;
}

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

.user-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-normal);
    font-family: inherit;
}

.user-button:hover {
    border-color: var(--primary-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

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

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.user-button:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-normal);
    z-index: 1001;
    overflow: hidden;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

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

.dropdown-item.logout:hover {
    background: rgba(231, 76, 60, 0.05);
}

.dropdown-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0 1rem;
        height: 60px;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .nav a {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .user-name {
        display: none;
    }
    
    .user-button {
        padding: 0.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
}
