.side-nav .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--primary);
    transition: color 0.3s ease;
}@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Palette violet pastel moderne */
    --primary: #a68dd2;
    --primary-hover: #8f76c7;
    --primary-light: #a78bfa;
    --primary-ultralight: #f3f0ff;
    
    --secondary: #7ea3ff;
    --secondary-light: #f472b6;
    
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Backgrounds */
    --bg-primary: #fefefe;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #ffffff;
    --bg-card: #ffffff;
    
    /* Text colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-white: #ffffff;
    
    /* Borders */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-strong: #94a3b8;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(166, 141, 210, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(166, 141, 210, 0.1), 0 2px 4px -1px rgba(166, 141, 210, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(166, 141, 210, 0.1), 0 4px 6px -2px rgba(166, 141, 210, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(166, 141, 210, 0.1), 0 10px 10px -5px rgba(166, 141, 210, 0.04);
    --shadow-hover: 0 20px 25px -5px rgba(166, 141, 210, 0.15), 0 10px 10px -5px rgba(166, 141, 210, 0.08);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    --gradient-hover: linear-gradient(135deg, var(--primary-hover) 0%, #d946ef 100%);
    
    /* Legacy compatibility (pour éviter les bugs) */
    --bg: var(--bg-primary);
    --text: var(--text-primary);
    --text-light: var(--text-secondary);
    --card-bg: var(--bg-card);
    --dropdown-bg: var(--bg-card);
    --dropdown-border: var(--border-light);
    --text-dark: var(--text-primary);
    --border: var(--border-medium);
    --icon-color: var(--text-primary);
}

html.dark {
    --primary: #bb86fc;
    --primary-hover: #9b6fe7;
    --primary-light: #c4b5fd;
    --primary-ultralight: #1e1b24;
    
    --secondary: #f472b6;
    --secondary-light: #ec4899;
    
    --bg-primary: #1e1b24;
    --bg-secondary: #2a2733;
    --bg-tertiary: #352f44;
    --bg-card: #2a2733;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    
    --border-light: #334155;
    --border-medium: #475569;
    --border-strong: #64748b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    
    --gradient-card: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    
    /* Legacy compatibility */
    --bg: var(--bg-primary);
    --text: var(--text-primary);
    --text-light: var(--text-secondary);
    --card-bg: var(--bg-card);
    --dropdown-bg: var(--bg-card);
    --dropdown-border: var(--border-light);
    --text-dark: var(--text-primary);
    --border: var(--border-medium);
    --icon-color: var(--text-primary);
}

/* ===== BASE STYLES ===== */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    align-items: center;
    justify-content: space-between;
    padding: clamp(15px, 3vw, 20px) clamp(20px, 5vw, 40px);
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    flex-wrap: nowrap;
    gap: clamp(15px, 3vw, 20px);
    width: 100%;
    min-height: 60px;
}

.header-left,
.header-center,
.header-right {
    box-sizing: border-box;
}

/* ===== HEADER SECTIONS ===== */
.header-left {
    display: flex;
    align-items: center;
    gap: clamp(15px, 3vw, 20px);
    flex-shrink: 0;
}

.logo {
    font-size: clamp(20px, 4vw, 24px);
    font-weight: 700;
    background: var(--primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

/* Hamburger menu moderne */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.hamburger-menu:hover {
    transform: scale(1.05);
}

.hamburger-menu .bar {
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-menu:hover .bar {
    background: var(--gradient-hover);
}

/* ===== SIDE NAVIGATION ===== */
.side-nav {
    position: fixed;
    top: 0;
    left: -260px;
    height: 100vh;
    width: 260px;
    padding-top: 80px;
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl);
    border-right: 1px solid var(--border-light);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
}

.side-nav.open {
    left: 0;
}

.side-nav ul {
    list-style: none;
    margin: 0;
    padding: 0 20px;
}

.side-nav ul li {
    margin-bottom: 8px;
}

.side-nav ul li a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.side-nav ul li a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    z-index: -1;
}

.side-nav ul li a:hover::before {
    opacity: 1;
}

.side-nav ul li a:hover {
    color: var(--text-white);
    transform: translateX(4px);
}

.side-nav ul li a:hover .icon {
    color: var(--text-white);
}

main {
    padding-top: 80px;
}

/* ===== BARRE DE RECHERCHE ===== */
.header-center {
    flex-grow: 1;
    max-width: 400px;
    width: 100%;
    order: 2;
}

.search-form {
    position: relative;
    width: 100%;
}

.search-form input {
    width: 100%;
    padding: clamp(10px, 2vw, 12px) clamp(12px, 3vw, 16px) clamp(10px, 2vw, 12px) clamp(36px, 8vw, 40px);
    border-radius: 20px;
    border: 2px solid var(--border-light);
    background: var(--bg-secondary);
    font-size: clamp(14px, 2.5vw, 16px);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(166, 141, 210, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

.search-form input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.search-form button {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-form button:hover {
    color: var(--primary);
    background: var(--primary-ultralight);
}

.search-form button svg {
    width: 16px;
    height: 16px;
}

/* Mode sombre pour la recherche */
html.dark .search-form input {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-light);
}

html.dark .search-form input:focus {
    background: var(--bg-card);
    border-color: var(--primary);
}

/* ===== AUTOCOMPLETE ===== */
.autocomplete-results {
    position: absolute;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 999;
    width: 100%;
    top: calc(100% + 8px);
    left: 0;
    box-shadow: var(--shadow-lg);
}

.autocomplete-results div {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    margin: 4px;
    font-weight: 500;
}

.autocomplete-results div:hover {
    background: var(--gradient-primary);
    color: var(--text-white);
    transform: translateX(4px);
}

/* ===== BOUTON CREATE ===== */
.create-dropdown-container {
    position: relative;
    display: inline-block;
}

.create-btn {
    background: var(--gradient-primary);
    color: var(--text-white);
    font-size: clamp(24px, 5vw, 28px);
    font-weight: 700;
    border-radius: 50%;
    width: clamp(36px, 8vw, 42px);
    height: clamp(36px, 8vw, 42px);
    margin-right: clamp(8px, 2vw, 10px);
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    line-height: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    flex-shrink: 0;
    border: none;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.create-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-hover);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.create-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-hover);
}

.create-btn:hover::before {
    opacity: 1;
}

.create-btn > * {
    position: relative;
    z-index: 1;
}

.create-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xl);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    min-width: 200px;
    z-index: 1000;
    padding: 8px;
    overflow: hidden;
}

.create-dropdown a {
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    display: block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.create-dropdown a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    z-index: -1;
}

.create-dropdown a:hover {
    color: var(--text-white);
    transform: translateX(4px);
}

.create-dropdown a:hover::before {
    opacity: 1;
}

/* ===== HEADER RIGHT ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2.5vw, 15px);
    flex-shrink: 0;
    order: 3;
    min-width: 120px;
}

/* ===== ACCOUNT & AVATAR ===== */
.account {
    position: relative;
}

.avatar-container {
    position: relative;
    display: inline-block;
}

.avatar {
    width: clamp(36px, 8vw, 42px);
    height: clamp(36px, 8vw, 42px);
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.avatar:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ===== DROPDOWN ACCOUNT ===== */
.dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    min-width: 220px;
    padding: 16px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dropdown a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    z-index: -1;
}

.dropdown a:hover {
    color: var(--text-white);
    transform: translateX(4px);
}

.dropdown a:hover::before {
    opacity: 1;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
}

.toggle {
    width: 60px;
    height: 30px;
    background: var(--border-medium);
    border-radius: 30px;
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.toggle .slider {
    width: 26px;
    height: 26px;
    background: var(--text-white);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

#darkModeToggle {
    display: none;
}

input[type="checkbox"]:checked + .toggle {
    background: var(--gradient-primary);
    box-shadow: inset 0 2px 4px rgba(166, 141, 210, 0.3);
}

input[type="checkbox"]:checked + .toggle .slider {
    transform: translateX(30px);
    background: var(--text-white);
    box-shadow: var(--shadow-lg);
}

/* ===== BOUTONS LOGIN/LOGOUT ===== */
.login-btn, .logout {
    padding: 10px 18px;
    background: var(--gradient-primary);
    color: var(--text-white);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.login-btn::before, .logout::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-hover);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    z-index: -1;
}

.login-btn:hover, .logout:hover {
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.login-btn:hover::before, .logout:hover::before {
    opacity: 1;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        padding: 15px 20px;
        align-items: center;
        min-height: 60px;
    }

    .logo {
        display: block;
        font-weight: 700;
        flex-shrink: 0;
        font-size: 23px;
    }

    .hamburger-menu {
        display: flex;
    }

    .side-nav {
        position: fixed;
        top: 60px;
        left: -260px;
        width: 260px;
        height: calc(100vh - 60px);
        padding-top: 20px;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        overflow-y: auto;
    }

    .side-nav.open {
        left: 0;
    }

    .header-center {
        order: 3;
        width: 100%;
        max-width: 95%;
        margin-top: 15px;
        flex-grow: 1;
        padding-right: 0;
    }

    .search-form input {
        width: 100%;
        padding: 10px 16px 10px 36px;
        font-size: 14px;
    }

    .header-right {
        order: 2;
        display: flex;
        gap: 10px;
        flex-grow: 1;
        justify-content: flex-end;
        min-width: auto;
    }

    .create-btn {
        width: 36px;
        height: 36px;
        font-size: 24px;
        margin-right: 8px;
    }

    .dropdown, .create-dropdown {
        min-width: 180px;
        right: 0;
    }

    main {
        padding-top: 90px;
    }
}

@media (min-width: 769px) {
    header {
        flex-wrap: nowrap;
        padding: 20px 40px;
        align-items: center;
        min-height: 70px;
    }

    .hamburger-menu {
        display: flex;
        cursor: pointer;
        flex-shrink: 0;
    }

    .side-nav {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        width: 260px;
        padding-top: 80px;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .side-nav.open {
        left: 0;
    }

    .logo {
        display: block;
        font-weight: 700;
        flex-shrink: 0;
        font-size: 24px;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 20px;
        flex-shrink: 0;
    }

    .header-center {
        order: 2;
        max-width: 400px;
        width: 100%;
        margin-top: 0;
        flex-grow: 1;
        flex-shrink: 1;
        min-width: 220px;
    }

    .search-form input {
        width: 100%;
        padding: 12px 16px 12px 40px;
        font-size: 16px;
    }

    .header-right {
        order: 3;
        display: flex;
        align-items: center;
        gap: 15px;
        min-width: 120px;
        flex-shrink: 0;
        justify-content: flex-end;
    }

    .create-btn {
        width: 42px;
        height: 42px;
        font-size: 28px;
        margin-right: 10px;
    }

    main {
        padding-top: 80px;
    }
}

/* ===== OVERLAY POUR MOBILE ===== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    transition: opacity 0.3s ease;
}

.overlay.show {
    display: block;
}

@media (max-width: 768px) {
    .side-nav.open ~ .overlay {
        display: block;
    }
}
@media (max-width: 321px) {
        .logo {
        display: block;
        font-weight: 700;
        flex-shrink: 0;
        font-size: 20px;
    }
        .create-btn {
        width: 32px;
        height: 32px;
        font-size: 28px;
        margin-right: 10px;
    }

}