/* === BigCam – Full Viewport Camera App === */

/* --- Global: black background everywhere --- */
window.bigcam {
    background-color: #000000;
}

.video-bg {
    background-color: #000000;
}

.preview-area {
    background-color: #000000;
    border-radius: 0;
    color-scheme: dark;
}

.preview-picture {
    background-color: #000000;
        border-radius: 0;
    }
    
    /* --- Top Bar Overlay (gradient for legibility) --- */
    .osd-bar.top-bar {
        color-scheme: dark;
        background: linear-gradient(to bottom,
                rgba(0, 0, 0, 0.75) 0%,
                    rgba(0, 0, 0, 0.45) 70%,
                transparent 100%);
        padding: 8px 16px;
    }
    
    .osd-bar.top-bar button {
        background: transparent;
        border: none;
        box-shadow: none;
        color: rgba(255, 255, 255, 0.9);
        min-width: 36px;
        min-height: 36px;
        -gtk-icon-size: 20px;
        border-radius: 9999px;
        transition: background 150ms ease;
    }
    
    .osd-bar.top-bar button:hover {
        background: rgba(255, 255, 255, 0.12);
    }
    
    .osd-bar.top-bar button:active {
        background: rgba(255, 255, 255, 0.20);
    }
    
    .osd-bar.top-bar menubutton button {
        min-width: 36px;
        min-height: 36px;
    }

        /* CSD window controls (minimize/maximize/close) on dark top bar */
        .osd-bar.top-bar windowcontrols button {
            background: transparent;
            border: none;
            box-shadow: none;
            color: rgba(255, 255, 255, 0.9);
            -gtk-icon-size: 16px;
            min-width: 28px;
            min-height: 28px;
        }
    
        .osd-bar.top-bar windowcontrols button:hover {
            background: transparent;
        }
    
        .osd-bar.top-bar windowcontrols button:active {
            background: transparent;
        }
    
        .osd-bar.top-bar windowcontrols button.close:hover {
            background: transparent;
        }
    /* --- Bottom Controls Overlay (gradient edge-to-edge) --- */
    .osd-bar.bottom-bar {
        color-scheme: dark;
        background: linear-gradient(to top,
                rgba(0, 0, 0, 0.75) 0%,
                    rgba(0, 0, 0, 0.45) 70%,
                transparent 100%);
        padding: 12px 16px 20px 16px;
    }
    
    /* --- Mode Switcher (Photo/Video icon toggle) --- */
    .mode-switcher {
        margin-bottom: 8px;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 9999px;
        padding: 2px;
    }
    
    .mode-switcher button {
        background: none;
        border: none;
        box-shadow: none;
        color: rgba(255, 255, 255, 0.5);
        padding: 8px 14px;
        border-radius: 9999px;
        transition: all 200ms ease;
        min-height: 0;
        min-width: 0;
        -gtk-icon-size: 18px;
    }
    
    .mode-switcher button:checked {
        background-color: rgba(255, 255, 255, 0.18);
        color: #ffffff;
    }
    
    .mode-switcher button:hover:not(:checked) {
        color: rgba(255, 255, 255, 0.75);
    }
    
/* --- Capture Button (circular, gray like source OSD style) --- */
    .capture-button {
        min-width: 48px;
            min-height: 48px;
        border-radius: 9999px;
        padding: 0;
        background-color: alpha(@headerbar_bg_color, 0.8);
            color: white;
            border: none;
            box-shadow: none;
    }
    
    .capture-button:hover {
        background-color: alpha(@headerbar_bg_color, 0.95);
    }
    
    .capture-button:active {
        background-color: alpha(@headerbar_bg_color, 0.65);
    }
    
    .capture-button image {
        padding: 0;
        margin: 0;
    }
    
/* Video mode: red background */
    .capture-button.video-mode {
        background-color: @error_color;
    }
    
        /* During recording: red pulsing, stays circular */
        .capture-button.recording {
        background-color: @error_color;
        animation: rec-pulse 1.2s ease-in-out infinite;
    }
    
                                /* --- Record Button (circular, white border + red dot) --- */
    button.record-button {
        min-width: 40px;
            min-height: 40px;
        border-radius: 9999px;
        border: 3px solid white;
            background: transparent;
        padding: 0;
        margin: 0;
        transition: all 300ms ease-in-out;
    }
    
    button.record-button:hover {
        border-color: alpha(white, 0.7);
            background: alpha(white, 0.1);
    }
    
    .rec-dot {
        min-width: 16px;
            min-height: 16px;
        border-radius: 9999px;
        background-color: @error_bg_color;
        transition: all 300ms ease-in-out;
    }
    
    /* Recording active — red dot pulses */
    button.record-button.recording {
        border-color: @error_color;
    }
    
    button.record-button.recording:hover {
        border-color: alpha(@error_color, 0.8);
        background: alpha(@error_color, 0.15);
    }
    
    .rec-dot.recording {
        min-width: 32px;
        min-height: 32px;
        background-color: @error_color;
        animation: rec-pulse 1.2s ease-in-out infinite;
    }
    
    /* Stop icon shown on hover during recording */
    .rec-stop-icon {
        min-width: 14px;
        min-height: 14px;
        border-radius: 2px;
        background-color: white;
    }
    
    @keyframes rec-pulse {
    
        0%,
        100% {
            opacity: 1.0;
        }
    
        50% {
            opacity: 0.3;
        }
    }
    
    /* --- Controls Bar Buttons (bottom bar, circular) --- */
    .controls-bar button.flat {
        color: rgba(255, 255, 255, 0.9);
        min-width: 44px;
        min-height: 44px;
        -gtk-icon-size: 22px;
        border-radius: 9999px;
        transition: background 150ms ease;
        padding: 0;
    }
    
    .controls-bar button.flat:hover {
        background: rgba(255, 255, 255, 0.12);
    }

/* --- Pin button (Always on Top) --- */
button.pin-btn {
    min-width: 32px;
    min-height: 32px;
    border-radius: 9999px;
    padding: 0;
    margin: 0 4px;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
}

button.pin-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

button.pin-btn:checked {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}
    
    /* Bottom circle button — overrides Adwaita padding for perfect circle */
    button.bottom-circle-btn {
        min-width: 44px;
        min-height: 44px;
        border-radius: 9999px;
        padding: 0;
        margin: 0;
        background: rgba(255, 255, 255, 0.05);
        border: 1.5px solid rgba(255, 255, 255, 0.12);
        -gtk-icon-size: 20px;
        color: rgba(255, 255, 255, 0.5);
}

button.bottom-circle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
}

/* Toggle circle buttons: active = bright, inactive = dim */
button.bottom-circle-btn:checked {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* --- Last Photo Thumbnail (perfect circle, clipped) --- */
button.last-photo-btn {
    min-width: 44px;
    min-height: 44px;
    border-radius: 9999px;
    padding: 0;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
}

button.last-photo-btn:hover {
    border-color: rgba(255, 255, 255, 0.8);
}

button.last-photo-btn picture {
    min-width: 40px;
    min-height: 40px;
    border-radius: 9999px;
}

/* --- Zoom Button (perfect circle with text) --- */
button.zoom-btn {
    font-weight: 700;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    margin: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
}

button.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* --- FPS Label (right side, centered, button-like) --- */
.fps-label {
    padding: 6px 12px;
        border-radius: 9999px;
    font-size: 0.85em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.15);
        color: #ffd600;
        border: 1.5px solid rgba(255, 255, 255, 0.2);
}

/* --- Countdown overlay --- */
.countdown-overlay {
    font-size: 96px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

/* --- Flash overlay (white flash on capture) --- */
.flash-overlay {
    background-color: rgba(255, 255, 255, 0.8);
}

/* --- Recording Timer (top bar center) --- */
.rec-timer {
    color: @error_color;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.95em;
}

.rec-timer .rec-indicator {
    min-width: 8px;
    min-height: 8px;
    border-radius: 9999px;
    background-color: @error_color;
    margin-right: 6px;
    animation: rec-blink 1s step-end infinite;
}

@keyframes rec-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- Timer button active indicator --- */
.timer-active {
    color: @accent_color;
}

/* --- Floating toolbar (legacy, hidden) --- */
.toolbar {
    border-radius: 12px;
    padding: 6px 16px;
}

/* --- Delete button on gallery thumbnails --- */
.delete-thumb-btn {
    min-width: 28px;
    min-height: 28px;
    padding: 4px;
    opacity: 0.7;
}

.delete-thumb-btn:hover {
    opacity: 1;
}

/* --- ExpanderRow arrow indicator --- */
row.expander image.expander-row-arrow {
    -gtk-icon-source: -gtk-icontheme("pan-up-symbolic");
}

/* --- Phone as Webcam button --- */
.osd-bar.top-bar button.phone-webcam-button {
    padding: 1px 10px;
    border-radius: 9999px;
    font-size: 0.85em;
    font-weight: 600;
    min-height: 24px;
    min-width: unset;
    background: rgba(255, 255, 255, 0.10);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.9);
    transition: all 200ms ease;
}

.osd-bar.top-bar button.phone-webcam-button:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.40);
}

.osd-bar.top-bar button.phone-webcam-button.phone-connected {
    border-color: alpha(@success_color, 0.5);
    background: alpha(@success_color, 0.12);
}

/* --- Audio volume overlay (left side, centered, button-like) --- */
.audio-overlay {
    color-scheme: dark;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 8px 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.audio-overlay-btn {
    min-width: 28px;
    min-height: 28px;
    padding: 0;
}

.audio-source-item {
    padding: 0;
    margin: 0;
}

.audio-vol-slider-container {
    padding: 4px 8px;
    min-width: 32px;
}

.audio-vol-vertical {
    min-height: 100px;
}

.audio-vol-vertical trough {
    min-width: 6px;
}

.audio-vol-label {
    font-size: 0.8em;
    font-weight: bold;
    opacity: 0.7;
}

/* --- Grid overlay --- */
.grid-drawing {
    opacity: 0.3;
}

/* --- Status page (no camera / alerts) --- */
.status-overlay {
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.7);
    color-scheme: dark;
}

/* --- Immersion mode (auto-hide chrome) --- */
box.immersion-active {
    background-color: transparent;
}

/* --- Sidebar panel overlay --- */
/* Override OverlaySplitView internal opaque backgrounds */
window.bigcam overlay-split-view> :not(.shade) {
    background-color: transparent;
}
.sidebar-panel {
    background-color: alpha(black, 0.92);
    color-scheme: dark;
}

.sidebar-panel .boxed-list {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-panel .boxed-list > row {
    background-color: transparent;
}

.sidebar-panel .boxed-list > row:hover {
    background-color: rgba(255, 255, 255, 0.08);
}
    
    /* --- Sidebar header (icon + app name) --- */
    .sidebar-header {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .sidebar-header .heading {
        color: #ffffff;
        font-weight: 700;
}

/* --- Sidebar bottom tab bar --- */
.sidebar-tab-bar {
    padding: 6px 4px;
}

.sidebar-tab-btn {
    padding: 6px 4px;
    border-radius: 8px;
    min-height: 48px;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-tab-btn:checked {
    background-color: alpha(@accent_color, 0.15);
    color: @accent_color;
}

.sidebar-tab-btn:hover:not(:checked) {
    color: rgba(255, 255, 255, 0.85);
}
.sidebar-tab-btn .caption {
    font-size: 0.75em;
    font-weight: 600;
}

/* --- Sidebar drag handle --- */
.sidebar-drag-handle {
    min-width: 6px;
    background: alpha(white, 0.08);
}

.sidebar-drag-handle:hover {
    background: alpha(@accent_color, 0.5);
}
/* --- Sidebar content: ensure readability on dark transparent bg --- */
.sidebar-panel label,
.sidebar-panel .heading {
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-panel row {
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-panel button.flat {
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-panel button.flat:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Fix: popover menus/dropdowns inherit forced white text from OSD
   top-bar and sidebar, making them unreadable in light mode.
   Reset to theme-adaptive popover colors. */
.osd-bar.top-bar popover,
.sidebar-panel popover {
    color: @popover_fg_color;
}

.sidebar-panel popover label,
.sidebar-panel popover row {
    color: @popover_fg_color;
}

.osd-bar.top-bar popover button {
    color: @popover_fg_color;
    min-width: 0;
    min-height: 0;
    border-radius: 0;
}

.osd-bar.top-bar popover button:hover {
    background: alpha(@popover_fg_color, 0.08);
}

.osd-bar.top-bar popover button:active {
    background: alpha(@popover_fg_color, 0.12);
}
/* --- Controls toggle button (top-left sidebar opener) --- */
.osd-bar.top-bar button.controls-toggle-btn {
    min-width: 32px;
    min-height: 32px;
    border-radius: 9999px;
    padding: 0;
    margin: 0 4px;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
}

.osd-bar.top-bar button.controls-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}
/* ── Phone Camera Dialog ─────────────────────────────── */

.step-number {
    font-weight: 700;
    font-size: 13px;
    border-radius: 50%;
    min-width: 28px;
    min-height: 28px;
    background: @accent_bg_color;
    color: @accent_fg_color;
}

.qr-container {
    border-radius: 8px;
    padding: 8px;
    background: white;
}

.prereq-ok {
    color: #2ec946;
}

.prereq-missing {
    color: @warning_color;
}

.url-display {
    font-family: monospace;
}

/* Footer status bar */
.phone-dialog-footer {
    border-top: 1px solid alpha(@borders, 0.5);
    min-height: 32px;
}
/* Green dot for active phone camera tab */
.phone-camera-dialog .needs-attention .badge {
    background-color: #29a645;
}