/* ============================================================
   SIDE PANEL
   ============================================================ */

#sidePanel {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--toolbar-height) - env(safe-area-inset-bottom, 0px));
    border-right: 1px solid var(--surface-border);
}

/* Top area */

#sidePanelScroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.side-panel-title {
    margin-top: 0;
    color: var(--text-primary);
}

/* Navigation buttons */

.side-panel-btn {
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: var(--accent-primary);
    color: white;
    border: 1px solid color-mix(in srgb, var(--accent-primary), transparent 30%);
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.side-panel-btn:hover {
    background: color-mix(in srgb, var(--accent-primary), #ffffff 10%);
    border-color: color-mix(in srgb, var(--accent-primary), #ffffff 20%);
    transform: translateY(-1px);
}

#helpTourBtn {
    margin-top: auto;
}

/* Bottom area */

#sidePanelBottom {
    position: relative;
}

/* Profile button */

.side-panel-profile-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    cursor: pointer;
    background: var(--surface-hover);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.side-panel-profile-btn:hover {
    background: var(--surface-elevated);
    border-color: color-mix(in srgb, var(--surface-border), var(--text-primary) 20%);
    transform: translateY(-1px);
}

.side-panel-item {
    padding: 12px;
    cursor: pointer;
    font-size: 17px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: var(--surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.side-panel-item:hover {
    background: var(--surface-elevated);
    border-color: color-mix(in srgb, var(--surface-border), var(--text-primary) 20%);
    transform: translateY(-1px);
}

/* Profile dropdown */

#profileDropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    background: var(--surface-muted);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 6px 0;
    z-index: 9999999;
}

#sidePanelBottom {
    position: relative;
    margin-top: auto;
    padding-top: 10px;
}

@media (max-width: 900px) {
    #sidePanel {
        width: min(88vw, 360px);
    }

    #profileDropdown {
        max-height: min(50dvh, 360px);
        overflow-y: auto;
    }

    .side-panel-btn,
    .side-panel-profile-btn,
    .side-panel-item {
        min-height: 44px;
        font-size: 16px;
    }
}
