/* ===============================
   SIDEBAR BASE
=============================== */

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background-color: #1c1c1c;
    color: #e7d0ac;
    border-right: 2px solid #3d3d3d;
    padding: 20px;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;

    display: flex;
    flex-direction: column; /* Required for sticky bottom */
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Header */
#sidebar img {
    display: block;
    margin: 0 auto 10px auto;
}

#sidebar h3 {
    margin-bottom: 10px;
    color: #E7D0AC;
    text-align: center;
}

/* ===============================
   MENU SECTIONS
=============================== */

.sidebar-section {
    margin-bottom: 4px;
}

.sidebar-toggle {
    width: 100%;
    background: none;
    border: none;
    color: #e7d0ac;
    text-align: left;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    padding: 6px 0;
}

.sidebar-toggle:hover,
.sidebar-toggle.active {
    color: #ffd89a;
}

/* Collapse list */
.sidebar-list {
    list-style-type: none;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
    padding-left: 10px;
    margin: 0;
}

.sidebar-list li {
    margin: 3px 0;
}

.sidebar-list a {
    color: #cfcfcf;
    text-decoration: none;
    font-size: 14px;
}

.sidebar-list a:hover {
    color: #ffd89a;
}

/* ===============================
   USERBOX (STICKY BOTTOM)
=============================== */

.sidebar-userbox {
    background: #2a2a2a;
    border-top: 1px solid #3d3d3d;
    padding: 14px;
    text-align: center;
    position: sticky;
    bottom: 0;
}

.sidebar-username {
    font-size: 15px;
    font-weight: bold;
    color: #ffd89a;
    margin-bottom: 10px;
}

/* Logout */
.sidebar-logout {
    display: block;
    padding: 8px 0;
    background: #6b1c1c;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: 0.2s;
}

.sidebar-logout:hover {
    background: #932626;
}

/* Login/Register */
.sidebar-auth {
    display: block;
    padding: 8px 0;
    margin: 6px 0;
    background: #3a3a3a;
    color: #e7d0ac;
    font-weight: bold;
    text-decoration: none;
    border-radius: 6px;
    transition: 0.2s;
}

.sidebar-auth:hover {
    background: #4d4d4d;
    color: #ffd89a;
}
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;   /* ✨ FIX horizontal scrollbar */
    padding-right: 5px;   /* prevents vertical scrollbar from overlapping text */
}
#sidebar {
    overflow-x: hidden; /* extra safety */
}
/* Profile link button */
.sidebar-link {
    display: block;
    padding: 8px 0;
    margin: 6px 0;
    background: #3a3a3a;
    color: #e7d0ac !important;
    font-weight: bold;
    text-decoration: none;
    border-radius: 6px;
    transition: 0.2s;
}

.sidebar-link:hover {
    background: #4d4d4d;
    color: #ffd89a !important;
}
