/* sidebar.css */
:root {
    --sidebar-bg: rgb(var(--bg-color));
    --sidebar-text: rgb(var(--text-color));
    --sidebar-width: 320px;
    --sidebar-overlay: rgba(0,0,0,0.5);
    --sidebar-primary: var(--primary-color);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--sidebar-overlay);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: var(--sidebar-width);
    max-width: 85vw;
    height: 100vh;
    background-color: rgba(var(--bg-color), 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--sidebar-text);
    z-index: 9999;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    overflow-y: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.sidebar-drawer.active {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.sidebar-header .logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 15px;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.sidebar-section {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.sidebar-section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sidebar-primary);
    margin-bottom: 15px;
    font-weight: bold;
}

.sidebar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.sidebar-item-text {
    display: flex;
    flex-direction: column;
}

.sidebar-item-label {
    font-size: 1rem;
}

.sidebar-item-desc {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 2px;
}

/* Material Switch */
.mat-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.mat-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.mat-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: color-mix(in srgb, var(--sidebar-text) 25%, var(--sidebar-bg));
    transition: .4s;
    border-radius: 24px;
}
.mat-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--primary-on-color);
    transition: .4s;
    border-radius: 50%;
}
input:checked + .mat-slider {
    background-color: var(--sidebar-primary);
}
input:checked + .mat-slider:before {
    transform: translateX(20px);
}

/* Custom Select & Input */
.mat-select, .mat-input {
    background: rgba(128, 128, 128, 0.1);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--sidebar-text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.app-color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-color-picker input[type="color"] {
    width: 42px;
    height: 34px;
    padding: 2px;
    cursor: pointer;
}

.app-color-presets {
    display: grid;
    grid-template-columns: repeat(4, 22px);
    gap: 6px;
}

.app-color-preset {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 2px solid color-mix(in srgb, var(--sidebar-text) 30%, transparent);
    border-radius: 50%;
    background: var(--preset-color);
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease;
}

.app-color-preset:hover,
.app-color-preset:focus-visible {
    border-color: var(--sidebar-primary);
    transform: scale(1.15);
    outline: none;
}
.mat-select {
    cursor: pointer;
}
.mat-btn {
    background: var(--sidebar-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    margin-top: 10px;
}
