

/* ── COLOR PICKER ───────────────────────────────────────────────────────────── */

/* Colorpicker Grayscale theme — one rule, affects the whole page */
body.theme-grayscale {
    filter: grayscale(1);
}

/* Colorpicker Box tint — blends accent color into each hour block */
.hour-block {
    background-color: color-mix(in srgb, var(--accent-color) calc(var(--bg-tint-opacity, 0) * 100%), var(--bg-panel));
}

/* Colorpicker Focus mode — full page black overlay, current hour punches through via z-index */
body.focus-mode::before {
    content: '';
    position: fixed;
    inset: 0;
    background: #000;
    opacity: 0.85;
    pointer-events: none;
    z-index: 4; /* .status-current is z-index:5 so it shows above the overlay */
}

/* Focus + Zoom mode — same overlay as focus-mode, plus centers and scales up the active hour box */
/* !important on position/width needed to override inline style="position: relative" set by app.js */
body.focus-zoom .status-current {
    position: fixed !important;
    top: calc(50% + 60px);
    left: 50%;
    transform: translate(-50%, -50%) !important;
    width: var(--focus-zoom-box-width) !important;
    height: var(--focus-zoom-box-height) !important;
    --icon-size: var(--icon-size-focus-zoom); /* scales the box-icon inside via its existing rule */
    z-index: 10;
    transition: width 0.2s ease;
}

/* ColorPicker Toggles */
.cp-toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
}

.cp-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.cp-toggle-label {
    font-size: 0.8rem;
    color: #aaa;
    letter-spacing: 0.3px;
}

/* Colorpicker Track */
.cp-toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: #333;
    border: 1px solid #444;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
    cursor: pointer;
    outline: none;
}

.cp-toggle-track:focus-visible {
    box-shadow: 0 0 0 2px var(--accent-color);
}

.cp-toggle-track.cp-toggle-on {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* Colorpicker Thumb */
.cp-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #777;
    transition: transform 0.2s, background 0.2s;
    pointer-events: none;
}

.cp-toggle-on .cp-toggle-thumb {
    transform: translateX(16px);
    background: #fff;
}

.cp-divider {
    height: 1px;
    background: #222;
    margin: 4px 0 8px;
}

/* Colorpicker Dim sliders when color effects are off */
.cp-slider-dim {
    opacity: 0.35;
    pointer-events: none;
}

.cp-label-dim {
    opacity: 0.35;
}

/* Colorpicker Toggles */
.color-pick-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    cursor: pointer;
    letter-spacing: 0.5px;
    padding: 4px 6px;
    transition: color 0.2s;
    z-index: 200;
    font-family: inherit;
}

.color-pick-trigger:hover {
    color: var(--accent-color);
}

/* Colorpicker Panel */
.color-pick-panel {
    position: fixed;
    bottom: 50px;
    right: 20px;
    width: 300px;
    background: var(--bg-panel);
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);
    z-index: 500;
    overflow: hidden;
    animation: cp-fade-in 0.15s ease;
}

.color-pick-hidden {
    display: none !important;
}

@keyframes cp-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.color-pick-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #222;
    cursor: grab;
    user-select: none; /* Prevents text highlighting while dragging */
}

.color-pick-header:active {
    cursor: grabbing;
}

.color-pick-panel.is-dragging .color-pick-header {
    cursor: grabbing;
}

.color-pick-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

.color-pick-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    transition: color 0.15s;
    font-family: inherit;
}

.color-pick-close:hover {
    color: #fff;
}

/* Body */
.color-pick-body {
    padding: 16px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-pick-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #666;
    margin-bottom: 2px;
}

/* Slider wrapper — the track gradient lives here */
.color-pick-slider-wrap {
    position: relative;
    border-radius: 8px;
    overflow: hidden; /* clips the gradient bg to rounded corners */
    height: 28px;
}

/* Hue track: full rainbow */
.hue-wrap {
    background: linear-gradient(
        to right,
        hsl(0,   80%, 57%),
        hsl(30,  80%, 57%),
        hsl(60,  80%, 57%),
        hsl(90,  80%, 57%),
        hsl(120, 80%, 57%),
        hsl(150, 80%, 57%),
        hsl(180, 80%, 57%),
        hsl(210, 80%, 57%),
        hsl(240, 80%, 57%),
        hsl(270, 80%, 57%),
        hsl(300, 80%, 57%),
        hsl(330, 80%, 57%),
        hsl(359, 80%, 57%)
    );
}

/* Saturation track: grey (left) → vivid hue color (right) */
.sat-wrap {
    --sat-vivid-color: hsl(200, 100%, 57%);
    background: linear-gradient(to right, #888, var(--sat-vivid-color));
}

/* Brightness track: dark (left) - vivid bright (right) */
.lit-wrap {
    background: linear-gradient(to right, #000, var(--lit-vivid-color));
}

/* Opacity track: checkerboard → solid color (universal transparency indicator) */
.alpha-wrap {
    --alpha-color: #46a5ce;
    background:
        linear-gradient(to right, transparent, var(--alpha-color)),
        repeating-conic-gradient(#555 0% 25%, #333 0% 50%) 0 0 / 12px 12px;
}

/* Background tint track: dark bg color → accent color */
.bgtint-wrap {
    --bgtint-color: #46a5ce;
    background: linear-gradient(to right, var(--bg-main), var(--bgtint-color));
}

/* Base slider — invisible track, styled thumb */
.cp-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    background: transparent; /* track is on the wrapper */
    margin: 0;
    padding: 0;
    cursor: pointer;
    display: block;
    position: relative;
    z-index: 1;
}

.cp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 28px;
    border-radius: 4px;
    background: var(--thumb-color, var(--accent-color));
    border: 2px solid rgba(255,255,255,0.85);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    cursor: grab;
    transition: border-color 0.1s, box-shadow 0.1s;
}

.cp-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

.cp-slider::-moz-range-thumb {
    width: 20px;
    height: 24px;
    border-radius: 4px;
    background: var(--thumb-color, var(--accent-color));
    border: 2px solid rgba(255,255,255,0.85);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    cursor: grab;
}

/* Preview swatch */
.cp-preview {
    height: 10px;
    border-radius: 6px;
    margin-top: 4px;
    transition: background-color 0.08s;
}

/* Footer */
.color-pick-footer {
    padding: 8px 16px 14px;
    text-align: center;
    border-top: 1px solid #1a1a1a;
}

.cp-reset-link {
    background: none;
    border: none;
    color: #555;
    font-size: 0.72rem;
    cursor: pointer;
    text-decoration: underline;
    letter-spacing: 0.3px;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s;
}

.cp-reset-link:hover {
    color: #aaa;
}

/* ── END COLOR PICKER ────────────────────────────────────────────────────────── */
