/* theme.css - Global Theme overrides and Settings Panel UI */

/* Global Dark Mode Overrides */
[data-theme="dark"] {
    --bs-body-bg: #111111;
    --bs-body-color: #f8f9fa;
    --bs-heading-color: #ffffff;
    --bs-card-bg: #1a1a1a;
    --bs-card-color: #f8f9fa;
    --bs-border-color: rgba(255, 255, 255, 0.1);
    --bs-light: #222222;
}

[data-theme="dark"] body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

[data-theme="dark"] .bg-white {
    background-color: var(--bs-card-bg) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--bs-body-color) !important;
}

[data-theme="dark"] .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

[data-theme="dark"] .card {
    background-color: var(--bs-card-bg);
    border-color: var(--bs-border-color);
}

[data-theme="dark"] .border,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-top {
    border-color: var(--bs-border-color) !important;
}

/* Accessibility */
[data-accessibility-font="small"] body {
    font-size: 14px;
}
[data-accessibility-font="medium"] body {
    font-size: 16px;
}
[data-accessibility-font="large"] body {
    font-size: 18px;
}

[data-accessibility-contrast="high"] {
    --bs-body-color: #000;
    --bs-heading-color: #000;
}
[data-theme="dark"][data-accessibility-contrast="high"] {
    --bs-body-color: #fff;
    --bs-heading-color: #fff;
    --bs-body-bg: #000;
}

[data-accessibility-motion="reduce"] *,
[data-accessibility-motion="reduce"] *::before,
[data-accessibility-motion="reduce"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* Settings Panel (Glassmorphism) */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    z-index: 1060;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    padding: 0;
}

[data-theme="dark"] .settings-panel {
    background: rgba(20, 20, 20, 0.9);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-panel.open {
    right: 0;
}

.settings-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

[data-theme="dark"] .settings-panel-header {
    border-bottom-color: rgba(255,255,255,0.1);
}

.settings-panel-body {
    padding: 20px;
}

.settings-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--bs-secondary);
    margin-bottom: 15px;
    margin-top: 25px;
}

/* Color Picker Circles */
.color-picker-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.color-picker-btn:hover {
    transform: scale(1.1);
}
.color-picker-btn.active {
    border-color: var(--bs-heading-color);
    box-shadow: 0 0 0 2px var(--bs-body-bg);
}

/* Custom Checkboxes/Switches for Settings */
.settings-panel .form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
    cursor: pointer;
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: -60px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--bs-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1045;
}
.back-to-top.visible {
    bottom: 30px;
}
.back-to-top:hover {
    transform: translateY(-5px);
    color: #fff;
}
