/* =========================================================
   TCG SIDEBAR
   Black / Yellow / Premium Dashboard
   ========================================================= */

:root {
    --sidebar-width: 88px;
    --sidebar-bg: #0a0a0a;
    --sidebar-bg-secondary: #101010;
    --sidebar-border: rgba(244, 196, 48, 0.14);
    --sidebar-text: #8b8b8b;
    --sidebar-text-hover: #ffffff;
    --sidebar-yellow: var(--color-primary-yellow);
    --sidebar-yellow-soft: rgba(244, 196, 48, 0.10);
    --sidebar-yellow-glow: rgba(244, 196, 48, 0.20);
}

/* =========================================================
   CONTAINER
   ========================================================= */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient( 180deg, #080808 0%, #0d0d0d 50%, #080808 100% );
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 10px;
    z-index: 1000;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35);
    transition: width 0.25s ease, background-color 0.25s ease;
}

    /* Ligne jaune très discrète sur le bord */

    .sidebar::after {
        content: '';
        position: absolute;
        top: 0;
        right: -1px;
        width: 1px;
        height: 100%;
        background: linear-gradient( 180deg, transparent, rgba(244, 196, 48, 0.35), transparent );
        pointer-events: none;
    }

/* =========================================================
   BRAND
   ========================================================= */

.sidebar-brand {
    width: 100%;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    position: relative;
}

    .sidebar-brand::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 20%;
        right: 20%;
        height: 1px;
        background: linear-gradient( 90deg, transparent, var(--sidebar-border), transparent );
    }

.sidebar-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient( 145deg, rgba(244, 196, 48, 0.16), rgba(244, 196, 48, 0.04) );
    border: 1px solid rgba(244, 196, 48, 0.35);
    color: var(--sidebar-yellow);
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    box-shadow: inset 0 0 20px rgba(244, 196, 48, 0.04);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

    .sidebar-logo:hover {
        transform: translateY(-2px);
        background: linear-gradient( 145deg, rgba(244, 196, 48, 0.24), rgba(244, 196, 48, 0.08) );
        border-color: var(--sidebar-yellow);
        box-shadow: 0 8px 25px rgba(244, 196, 48, 0.12);
    }

/* =========================================================
   NAVIGATION
   ========================================================= */

.sidebar-nav {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* =========================================================
   NAV ITEM
   ========================================================= */

.sidebar-nav-item {
    position: relative;
    width: 100%;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 5px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--sidebar-text);
    text-decoration: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* Icône */

.sidebar-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    transition: transform 0.2s ease, color 0.2s ease;
}

    .sidebar-icon svg {
        width: 20px;
        height: 20px;
        stroke-width: 1.8;
    }

/* Texte */

.sidebar-label {
    display: block;
    max-width: 76px;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
}

/* =========================================================
   HOVER
   ========================================================= */

.sidebar-nav-item:hover {
    color: var(--sidebar-text-hover);
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

    .sidebar-nav-item:hover .sidebar-icon {
        color: var(--sidebar-yellow);
        transform: translateY(-1px);
    }

/* =========================================================
   ACTIVE
   ========================================================= */

.sidebar-nav-item.active {
    color: var(--sidebar-yellow);
    background: linear-gradient( 90deg, rgba(244, 196, 48, 0.13), rgba(244, 196, 48, 0.035) );
    border-color: rgba(244, 196, 48, 0.18);
    box-shadow: inset 0 0 18px rgba(244, 196, 48, 0.025);
}

    /* Barre jaune active */

    .sidebar-nav-item.active::before {
        content: '';
        position: absolute;
        left: -10px;
        top: 12px;
        bottom: 12px;
        width: 3px;
        background: var(--sidebar-yellow);
        border-radius: 0 4px 4px 0;
        box-shadow: 0 0 10px rgba(244, 196, 48, 0.45);
    }

    /* Icône active */

    .sidebar-nav-item.active .sidebar-icon {
        color: var(--sidebar-yellow);
        filter: drop-shadow( 0 0 5px rgba(244, 196, 48, 0.25) );
    }

/* =========================================================
   DIVIDER
   ========================================================= */

.sidebar-divider {
    width: 70%;
    height: 1px;
    margin: 12px auto;
    background: linear-gradient( 90deg, transparent, rgba(244, 196, 48, 0.22), transparent );
}

/* =========================================================
   ADMIN ITEMS
   ========================================================= */

.sidebar-nav-item.admin-item {
    color: #777;
    background: rgba(244, 196, 48, 0.015);
}

    .sidebar-nav-item.admin-item:hover {
        color: var(--sidebar-yellow);
        background: rgba(244, 196, 48, 0.06);
    }

/* =========================================================
   FOOTER
   ========================================================= */

.sidebar-footer {
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid rgba(244, 196, 48, 0.10);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* =========================================================
   LOGOUT
   ========================================================= */

.sidebar-logout {
    color: #777;
}

    .sidebar-logout:hover {
        color: #ef4444;
        background: rgba(239, 68, 68, 0.06);
        border-color: rgba(239, 68, 68, 0.12);
    }

        .sidebar-logout:hover .sidebar-icon {
            color: #ef4444;
        }

    .sidebar-logout.active {
        color: #ef4444;
        background: rgba(239, 68, 68, 0.08);
        border-color: rgba(239, 68, 68, 0.15);
    }

/* =========================================================
   MAIN CONTENT OFFSET
   ========================================================= */

.main-with-sidebar {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

    .main-with-sidebar main {
        flex: 1;
    }

    .main-with-sidebar footer {
        flex-shrink: 0;
    }

/* =========================================================
   SCROLLBAR
   ========================================================= */

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(244, 196, 48, 0.20);
    border-radius: 10px;
}

    .sidebar-nav::-webkit-scrollbar-thumb:hover {
        background: rgba(244, 196, 48, 0.40);
    }

/* =========================================================
   FOCUS
   ========================================================= */

.sidebar-nav-item:focus-visible,
.sidebar-logo:focus-visible {
    outline: 2px solid var(--sidebar-yellow);
    outline-offset: 3px;
}

/* =========================================================
   ANIMATION
   ========================================================= */

@keyframes sidebarItemAppear {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-nav-item {
    animation: sidebarItemAppear 0.3s ease-out both;
}

    .sidebar-nav-item:nth-child(1) {
        animation-delay: 0.03s;
    }

    .sidebar-nav-item:nth-child(2) {
        animation-delay: 0.06s;
    }

    .sidebar-nav-item:nth-child(3) {
        animation-delay: 0.09s;
    }

    .sidebar-nav-item:nth-child(4) {
        animation-delay: 0.12s;
    }

    .sidebar-nav-item:nth-child(5) {
        animation-delay: 0.15s;
    }

    .sidebar-nav-item:nth-child(6) {
        animation-delay: 0.18s;
    }

    .sidebar-nav-item:nth-child(7) {
        animation-delay: 0.21s;
    }

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar-logo,
    .sidebar-nav-item,
    .sidebar-icon {
        transition: none;
        animation: none;
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1024px) {

    :root {
        --sidebar-width: 76px;
    }

    .sidebar {
        padding: 10px 8px;
    }

    .sidebar-brand {
        height: 58px;
    }

    .sidebar-logo {
        width: 44px;
        height: 44px;
    }

    .sidebar-nav-item {
        min-height: 58px;
    }

    .sidebar-icon svg {
        width: 19px;
        height: 19px;
    }
}

@media (max-width: 768px) {

    :root {
        --sidebar-width: 64px;
    }

    .sidebar {
        padding: 8px 6px;
    }

    .sidebar-brand {
        height: 52px;
        margin-bottom: 10px;
    }

    .sidebar-logo {
        width: 40px;
        height: 40px;
        border-radius: 11px;
        font-size: 20px;
    }

    .sidebar-nav-item {
        min-height: 54px;
        padding: 7px 3px;
        gap: 4px;
        border-radius: 10px;
        font-size: 8px;
    }

    .sidebar-icon {
        width: 20px;
        height: 20px;
    }

        .sidebar-icon svg {
            width: 18px;
            height: 18px;
        }

    .sidebar-label {
        max-width: 58px;
    }
}

@media (max-width: 640px) {

    :root {
        --sidebar-width: 56px;
    }

    .sidebar {
        padding: 6px 4px;
    }

    .sidebar-brand {
        height: 46px;
    }

    .sidebar-logo {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .sidebar-nav-item {
        min-height: 48px;
        padding: 5px 2px;
    }

    .sidebar-icon svg {
        width: 17px;
        height: 17px;
    }

    .sidebar-label {
        font-size: 7px;
        max-width: 50px;
    }

    .main-with-sidebar {
        margin-left: var(--sidebar-width);
    }
}
