/* ═══════════════════════════════════════════════════════════
   ALICE DISPLAY - CSS STYLES
   Clean, organized stylesheet with CSS custom properties
   ═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   CSS CUSTOM PROPERTIES (Variables)
   ───────────────────────────────────────────────────────────── */
:root {
    /* Colors */
    --color-bg-primary: #1a1a2e;
    --color-bg-secondary: #16213e;
    --color-bg-tertiary: #2d2d44;
    
    /* Overlay backgrounds */
    --overlay-dark: rgba(0, 0, 0, 0.7);
    --overlay-darker: rgba(0, 0, 0, 0.8);
    --overlay-darkest: rgba(0, 0, 0, 0.9);
    --overlay-glass: rgba(0, 0, 0, 0.6);
    
    /* White overlays */
    --white-5: rgba(255, 255, 255, 0.05);
    --white-10: rgba(255, 255, 255, 0.1);
    --white-15: rgba(255, 255, 255, 0.15);
    --white-20: rgba(255, 255, 255, 0.2);
    --white-30: rgba(255, 255, 255, 0.3);
    --white-50: rgba(255, 255, 255, 0.5);
    --white-60: rgba(255, 255, 255, 0.6);
    --white-70: rgba(255, 255, 255, 0.7);
    --white-80: rgba(255, 255, 255, 0.8);
    --white-95: rgba(255, 255, 255, 0.95);
    
    /* Accent colors */
    --accent-primary: rgba(100, 100, 180, 0.4);
    --accent-primary-strong: rgba(100, 100, 180, 0.6);
    --accent-success: rgba(34, 197, 94, 0.9);
    --accent-warning: rgba(255, 150, 0, 0.9);
    --accent-danger: rgba(255, 100, 100, 0.3);
    --accent-purple: #6366f1;
    --accent-purple-light: #8b5cf6;
    
    /* Shadows */
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 6px 30px var(--accent-primary);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;
    --transition-crossfade: 1.5s ease-in-out;
    
    /* Z-index layers */
    --z-base: 1;
    --z-image: 2;
    --z-overlay: 10;
    --z-widget: 15;
    --z-controls: 50;
    --z-command: 60;
    --z-modal: 100;
    --z-toast: 300;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: 'Monaco', 'Menlo', monospace;
}

/* ─────────────────────────────────────────────────────────────
   RESET & BASE STYLES
   ───────────────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow: hidden;
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
}

body {
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-family);
}

/* ─────────────────────────────────────────────────────────────
   DISPLAY CONTAINER
   ───────────────────────────────────────────────────────────── */
.display-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────
   IMAGE LAYERS (Crossfade)
   ───────────────────────────────────────────────────────────── */
.image-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity var(--transition-crossfade);
    will-change: opacity, padding;
    contain: layout style paint size;
    transform: translate3d(0, 0, 0);
    isolation: isolate;
}

.image-layer img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform-origin: center center;
}

.image-layer.active {
    opacity: 1;
    z-index: var(--z-image);
}

.image-layer.inactive {
    opacity: 0;
    z-index: var(--z-base);
}

/* ─────────────────────────────────────────────────────────────
   KEN BURNS EFFECT
   ───────────────────────────────────────────────────────────── */
@keyframes kenburns-1 {
    0% { transform: scale(1.0) translate(0, 0); }
    100% { transform: scale(1.08) translate(-1%, -1%); }
}

@keyframes kenburns-2 {
    0% { transform: scale(1.0) translate(0, 0); }
    100% { transform: scale(1.08) translate(1%, -0.5%); }
}

@keyframes kenburns-3 {
    0% { transform: scale(1.05) translate(-0.5%, 0.5%); }
    100% { transform: scale(1.0) translate(0, 0); }
}

@keyframes kenburns-4 {
    0% { transform: scale(1.08) translate(0.5%, -1%); }
    100% { transform: scale(1.02) translate(-0.5%, 0.5%); }
}

.image-layer.active img.kenburns {
    animation-duration: 20s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
}

.image-layer.active img.kenburns-1 { animation-name: kenburns-1; }
.image-layer.active img.kenburns-2 { animation-name: kenburns-2; }
.image-layer.active img.kenburns-3 { animation-name: kenburns-3; }
.image-layer.active img.kenburns-4 { animation-name: kenburns-4; }

@media (prefers-reduced-motion: reduce) {
    .image-layer.active img.kenburns {
        animation: none;
    }
}

/* ─────────────────────────────────────────────────────────────
   STATUS OVERLAY (Bottom Bar)
   ───────────────────────────────────────────────────────────── */
.status-overlay {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--overlay-dark);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    opacity: 0;
    transition: opacity var(--transition-slow), width var(--transition-slow);
    z-index: var(--z-overlay);
    cursor: pointer;
    will-change: transform, opacity, width;
    contain: layout style;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

.status-overlay.visible {
    opacity: 1;
}

.status-overlay.collapsed {
    width: 50px;
    height: 50px;
    padding: 0 !important;
    border-radius: var(--radius-full);
    justify-content: center;
    align-items: center;
    gap: 0 !important;
    opacity: 0.8;
    overflow: hidden;
}

.status-overlay.collapsed .status-item:not(:first-child) {
    display: none !important;
}

.status-overlay.collapsed .status-item:first-child {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
}

.status-overlay.collapsed .status-item:first-child > div {
    display: none !important;
}

.status-overlay.collapsed .status-item:first-child .icon {
    font-size: 24px;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    text-align: center;
}

.status-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.status-item .icon {
    font-size: 18px;
}

.status-item .label {
    opacity: 0.7;
    font-size: 12px;
}

.status-item .value {
    font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
   TAP-TO-COPY
   ───────────────────────────────────────────────────────────── */
.tap-to-copy {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s ease;
}

.tap-to-copy:active {
    opacity: 0.6;
}

.copy-toast {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--accent-success);
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    margin-bottom: 8px;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────────────────────────────
   WEATHER WIDGET
   ───────────────────────────────────────────────────────────── */
.weather-widget {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, var(--overlay-darker) 0%, rgba(30, 30, 50, 0.9) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--radius-xl);
    padding: 20px;
    color: white;
    min-width: 180px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
    z-index: var(--z-widget);
    border: 1px solid var(--white-10);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    will-change: transform, opacity, width, height;
    contain: layout style paint;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

.weather-widget.hidden {
    width: 50px;
    height: 50px;
    min-width: 50px;
    max-width: 50px;
    padding: 8px;
    border-radius: 25px;
    overflow: hidden;
}

.weather-widget.hidden .weather-widget-temp,
.weather-widget.hidden .weather-widget-condition,
.weather-widget.hidden .weather-widget-description,
.weather-widget.hidden .weather-widget-divider,
.weather-widget.hidden .weather-widget-details,
.weather-widget.hidden .weather-widget-time {
    display: none;
}

.weather-widget.hidden .weather-widget-icon {
    font-size: 28px;
}

.weather-widget.hidden .weather-widget-header {
    margin: 0;
    justify-content: center;
}

.weather-widget-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.weather-widget-icon {
    font-size: 42px;
    line-height: 1;
}

.weather-widget-temp {
    font-size: 32px;
    font-weight: 300;
}

.weather-widget-temp .unit {
    font-size: 18px;
    opacity: 0.7;
}

.weather-widget-condition {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.weather-widget-description {
    font-size: 12px;
    opacity: 0.6;
    text-transform: capitalize;
}

.weather-widget-divider {
    height: 1px;
    background: var(--white-10);
    margin: 12px 0;
}

.weather-widget-details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.weather-widget-detail {
    text-align: center;
}

.weather-widget-detail-value {
    font-weight: 600;
    font-size: 14px;
}

.weather-widget-detail-label {
    opacity: 0.5;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weather-widget-time {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--white-10);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weather-widget-clock {
    font-size: 24px;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
}

.weather-widget-period {
    font-size: 14px;
    opacity: 0.8;
    background: var(--white-10);
    padding: 4px 10px;
    border-radius: 10px;
}

/* ─────────────────────────────────────────────────────────────
   PORTRAIT CLOCK (Mobile only)
   ───────────────────────────────────────────────────────────── */
.portrait-clock {
    display: none;
}

/* ─────────────────────────────────────────────────────────────
   LANDSCAPE CLOCK
   ───────────────────────────────────────────────────────────── */
.landscape-clock {
    display: none;
}

/* ─────────────────────────────────────────────────────────────
   COMMAND CENTER
   ───────────────────────────────────────────────────────────── */
.command-center {
    position: fixed;
    bottom: 24px;
    bottom: max(24px, calc(10px + env(safe-area-inset-bottom, 14px)));
    right: 24px;
    z-index: var(--z-command);
}

.command-center-button {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(100, 100, 180, 0.8) 0%, rgba(80, 80, 140, 0.9) 100%);
    border: 2px solid var(--white-20);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: var(--shadow-glow);
}

.command-center-button:hover {
    transform: scale(1.1);
}

.command-center-button:active {
    transform: scale(0.95);
}

.command-center-popup {
    position: absolute;
    bottom: 72px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
}

/* JS adds .open to .command-center parent, so use descendant selector */
.command-center.open .command-center-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.command-center-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(60, 60, 100, 0.9) 0%, rgba(40, 40, 80, 0.95) 100%);
    border: 1px solid var(--white-20);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.command-center-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--white-20);
}

/* ─────────────────────────────────────────────────────────────
   IMAGE CONTROL PANEL
   ───────────────────────────────────────────────────────────── */
.image-control-panel {
    position: fixed;
    bottom: 130px;
    right: 24px;
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.95) 0%, rgba(20, 20, 45, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 20px;
    min-width: 240px;
    border: 1px solid var(--white-15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: var(--z-controls);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
}

.image-control-panel.open,
.image-control-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.image-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--white-10);
}

.image-control-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-control-close {
    background: transparent;
    border: none;
    color: var(--white-50);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.image-control-close:hover {
    color: white;
}

.image-control-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-control-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white-5);
    border: 1px solid var(--white-10);
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 52px;
}

.image-control-btn:hover {
    background: var(--white-10);
    border-color: var(--white-20);
    transform: translateX(4px);
}

.image-control-btn:active {
    transform: translateX(2px);
}

.image-control-btn-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.image-control-btn-text {
    flex: 1;
    text-align: left;
}

.image-control-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.image-control-btn.success {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
}

.image-control-btn.error {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ─────────────────────────────────────────────────────────────
   VACUUM PANEL
   ───────────────────────────────────────────────────────────── */
.vacuum-panel {
    position: fixed;
    bottom: 130px;
    right: 24px;
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.95) 0%, rgba(20, 20, 45, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 24px;
    min-width: 280px;
    border: 1px solid var(--white-15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: var(--z-controls);
    color: white;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
}

.vacuum-panel.open,
.vacuum-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vacuum-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--white-10);
}

.vacuum-panel-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vacuum-panel-close {
    background: transparent;
    border: none;
    color: var(--white-50);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.vacuum-panel-close:hover {
    color: white;
}

.vacuum-status {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.vacuum-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vacuum-status-label {
    font-size: 14px;
    opacity: 0.7;
}

.vacuum-status-value {
    font-size: 16px;
    font-weight: 600;
}

.vacuum-battery {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vacuum-battery-bar {
    width: 60px;
    height: 8px;
    background: var(--white-10);
    border-radius: 4px;
    overflow: hidden;
}

.vacuum-battery-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    border-radius: 4px;
    transition: width var(--transition-normal);
}

.vacuum-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.vacuum-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 12px;
    background: var(--white-5);
    border: 1px solid var(--white-10);
    border-radius: var(--radius-md);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.vacuum-btn:hover {
    background: var(--white-10);
    border-color: var(--white-20);
    transform: translateY(-2px);
}

.vacuum-btn:active {
    transform: translateY(0);
}

.vacuum-btn-icon {
    font-size: 24px;
}

.vacuum-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.vacuum-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.vacuum-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--white-10);
    border-top-color: white;
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

.vacuum-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: 16px;
}

.vacuum-actions .vacuum-btn {
    flex: 1;
    min-width: 0;
}

.vacuum-battery {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin-bottom: 8px;
}

.vacuum-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--white-70);
    margin-bottom: 4px;
}

/* ─────────────────────────────────────────────────────────────
   LIGHTS PANEL
   ───────────────────────────────────────────────────────────── */
.lights-panel {
    position: fixed;
    bottom: 130px;
    right: 24px;
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.95) 0%, rgba(20, 20, 45, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 24px;
    min-width: 260px;
    border: 1px solid var(--white-15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: var(--z-controls);
    color: white;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
}

.lights-panel.open,
.lights-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lights-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--white-10);
}

.lights-panel-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lights-panel-close {
    background: transparent;
    border: none;
    color: var(--white-50);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.lights-panel-close:hover {
    color: white;
}

.lights-presets {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lights-preset-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--white-5);
    border: 1px solid var(--white-10);
    border-radius: var(--radius-md);
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lights-preset-btn:hover {
    background: var(--white-10);
    border-color: var(--white-20);
    transform: translateX(4px);
}

.lights-preset-btn:active {
    transform: translateX(2px);
}

.lights-preset-icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
}

.lights-preset-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.lights-preset-btn.success {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
}

/* ─────────────────────────────────────────────────────────────
   ABOUT/DEBUG PANEL
   ───────────────────────────────────────────────────────────── */
.about-panel {
    position: fixed;
    bottom: 130px;
    right: 24px;
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.95) 0%, rgba(20, 20, 45, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 340px;
    min-width: 320px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    border: 1px solid var(--white-15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: var(--z-controls);
    color: white;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
}

.about-panel.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.about-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--white-10);
}

.about-panel-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-panel-close {
    background: transparent;
    border: none;
    color: var(--white-50);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.about-panel-close:hover {
    color: white;
}

.about-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-info-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.about-info-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--white-80);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--white-10);
}

.about-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    font-size: 13px;
    gap: 16px;
}

.about-info-label {
    color: var(--white-60);
    flex-shrink: 0;
    min-width: 100px;
}

.about-info-value {
    font-weight: 500;
    color: white;
    text-align: right;
    word-break: break-word;
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--white-5);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--white-10);
}

/* Scrollbar styling for about panel */
.about-panel::-webkit-scrollbar {
    width: 4px;
}

.about-panel::-webkit-scrollbar-track {
    background: transparent;
}

.about-panel::-webkit-scrollbar-thumb {
    background: var(--white-20);
    border-radius: 2px;
}

.about-panel::-webkit-scrollbar-thumb:hover {
    background: var(--white-30);
}

/* ─────────────────────────────────────────────────────────────
   UTILITY ELEMENTS
   ───────────────────────────────────────────────────────────── */

/* Update indicator */
.update-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 200, 100, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    z-index: var(--z-overlay);
}

.update-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* Loading spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 5;
}

.loading-spinner.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--white-10);
    border-top-color: #fff;
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Title overlay */
.title-overlay {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--overlay-glass);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.5s ease;
    text-align: center;
    max-width: 80%;
    z-index: var(--z-overlay);
}

.title-overlay.visible {
    opacity: 1;
}

/* Debug panel */
.debug-panel {
    position: fixed;
    top: 10px;
    left: 10px;
    background: var(--overlay-darkest);
    color: #00ff00;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    display: none;
    max-width: 300px;
    z-index: 20;
}

.debug-panel.show {
    display: block;
}

.debug-panel pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Fullscreen button */
.fullscreen-btn {
    position: fixed;
    bottom: max(20px, calc(10px + env(safe-area-inset-bottom, 10px)));
    right: 20px;
    background: var(--white-10);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0.3;
    transition: opacity var(--transition-normal), transform var(--transition-fast);
    z-index: var(--z-overlay);
}

.fullscreen-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Error message */
.error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 30, 50, 0.95);
    border: 1px solid var(--accent-danger);
    color: white;
    padding: 30px 25px;
    border-radius: var(--radius-lg);
    text-align: center;
    display: none;
    z-index: var(--z-widget);
    backdrop-filter: blur(10px);
    max-width: 85vw;
    width: auto;
    min-width: 280px;
}

.error-message.show {
    display: block;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-detail {
    font-size: 13px;
    opacity: 0.7;
    margin-bottom: 15px;
}

.error-retry-counter {
    font-size: 13px;
    font-weight: 600;
    color: #ff7043;
    margin-bottom: 10px;
    padding: 4px 12px;
    background: rgba(255, 112, 67, 0.15);
    border-radius: var(--radius-md);
    display: inline-block;
}

.error-retry {
    font-size: 12px;
    opacity: 0.5;
}

.error-retry .countdown {
    font-weight: 600;
    color: #64b5f6;
}

/* Connection status */
.connection-status {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--overlay-glass);
    padding: 8px 14px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    color: white;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: var(--z-overlay);
}

.connection-status.visible {
    opacity: 1;
}

.connection-status.error {
    background: rgba(255, 80, 80, 0.8);
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: #4caf50;
}

.connection-status.error .connection-dot {
    background: #fff;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Fallback styling */
.fallback-active .image-layer img {
    filter: grayscale(30%) brightness(0.8);
}

.fallback-badge {
    position: fixed;
    bottom: max(80px, calc(60px + env(safe-area-inset-bottom, 20px)));
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-warning);
    color: white;
    padding: 6px 16px;
    border-radius: 15px;
    font-size: 11px;
    display: none;
    z-index: var(--z-overlay);
}

.fallback-badge.show {
    display: block;
}

/* Countdown */
.countdown {
    position: fixed;
    bottom: max(70px, calc(50px + env(safe-area-inset-bottom, 20px)));
    left: 50%;
    transform: translateX(-50%);
    color: var(--white-30);
    font-size: 11px;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: var(--z-overlay);
}

.countdown.visible {
    opacity: 1;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--overlay-darkest);
    color: white;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    opacity: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    z-index: var(--z-toast);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Pause indicator */
.pause-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-warning);
    color: white;
    padding: 8px 20px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 500;
    display: none;
    z-index: var(--z-widget);
}

.pause-indicator.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Image info panel */
.image-info {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: var(--radius-lg);
    color: white;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
    z-index: var(--z-controls);
}

.image-info.show {
    opacity: 1;
    visibility: visible;
}

.image-info h3 {
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--white-10);
    font-size: 13px;
}

.image-info-row:last-child {
    border-bottom: none;
}

.image-info-label {
    opacity: 0.6;
}

.image-info-value {
    font-weight: 500;
}

/* Help overlay */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-darkest);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.help-overlay.show {
    opacity: 1;
    visibility: visible;
}

.help-content {
    background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, var(--color-bg-primary) 100%);
    border-radius: var(--radius-xl);
    padding: 30px 40px;
    max-width: 500px;
    color: white;
    border: 1px solid var(--white-10);
}

.help-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-shortcuts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 20px;
}

.help-key {
    background: var(--white-10);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 14px;
    text-align: center;
    min-width: 60px;
}

.help-desc {
    font-size: 14px;
    opacity: 0.8;
    display: flex;
    align-items: center;
}

.help-close {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    opacity: 0.5;
}

/* ─────────────────────────────────────────────────────────────
   PWA INSTALL BANNER
   ───────────────────────────────────────────────────────────── */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, var(--color-bg-primary) 100%);
    border-top: 1px solid var(--white-10);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-modal);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.install-banner.show {
    transform: translateY(0);
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.install-banner-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.install-banner-text {
    color: white;
}

.install-banner-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.install-banner-subtitle {
    font-size: 12px;
    opacity: 0.7;
}

.install-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.install-btn {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-light) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.dismiss-btn {
    background: transparent;
    color: var(--white-60);
    border: 1px solid var(--white-20);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.dismiss-btn:hover {
    background: var(--white-10);
    color: white;
}

/* iOS Install Modal */
.ios-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-darkest);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: calc(var(--z-modal) * 2);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
    backdrop-filter: blur(10px);
}

.ios-modal.show {
    opacity: 1;
    visibility: visible;
}

.ios-modal-content {
    background: linear-gradient(145deg, var(--color-bg-tertiary) 0%, var(--color-bg-primary) 100%);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    max-width: 340px;
    text-align: center;
    color: white;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--white-10);
    animation: modalSlideIn var(--transition-slow) ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.ios-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.ios-modal-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ios-modal-subtitle {
    font-size: 14px;
    color: var(--white-60);
    margin-bottom: 24px;
}

.ios-modal-steps {
    text-align: left;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.ios-modal-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--white-5);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.ios-modal-step:hover {
    background: var(--white-10);
}

.ios-step-number {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-light));
    color: white;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.ios-step-content {
    flex: 1;
}

.ios-step-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.ios-step-desc {
    font-size: 13px;
    color: var(--white-60);
}

.ios-share-icon {
    display: inline-block;
    background: #007AFF;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    vertical-align: middle;
}

.ios-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ios-modal-close {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-light) 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
}

.ios-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.ios-modal-dismiss {
    background: transparent;
    color: var(--white-50);
    border: none;
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.ios-modal-dismiss:hover {
    color: var(--white-80);
}

.ios-safari-note {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--white-10);
}

.ios-safari-note strong {
    color: var(--white-60);
}

/* ─────────────────────────────────────────────────────────────
   HIDE TITLE ON MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .title-overlay,
    .title-overlay.visible {
        display: none !important;
        opacity: 0 !important;
    }
}

/* ─────────────────────────────────────────────────────────────
   REPORT MODAL
   (Was missing from CSS extraction)
   ───────────────────────────────────────────────────────────── */
.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    overflow: hidden;
}

.report-modal.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.report-modal-content {
    background: linear-gradient(145deg, #2d2d44 0%, #1a1a2e 100%);
    border-radius: 20px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    color: white;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--white-10);
    animation: modalSlideIn 0.4s ease-out;
    position: relative;
}

.report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.report-modal-title {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-modal-close {
    background: transparent;
    border: none;
    color: var(--white-60);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.report-modal-close:hover {
    color: white;
    background: var(--white-10);
}

.report-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.report-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-form-label {
    font-weight: 600;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.report-form-select,
.report-form-textarea {
    background: var(--white-10);
    border: 1px solid var(--white-20);
    border-radius: 12px;
    padding: 14px 16px;
    color: white;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.report-form-select:focus,
.report-form-textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: var(--white-15);
}

.report-form-select {
    cursor: pointer;
}

.report-checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.report-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--white-10);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.report-checkbox-label:hover {
    background: var(--white-15);
}

.report-checkbox-label:has(input:checked) {
    background: rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.5);
}

.report-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-purple);
    cursor: pointer;
}

.report-checkbox-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.report-form-textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}

.report-form-textarea::placeholder {
    color: var(--white-50);
}

.report-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.report-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.report-btn-cancel {
    background: transparent;
    color: var(--white-70);
    border: 1px solid var(--white-20);
}

.report-btn-cancel:hover {
    background: var(--white-10);
    color: white;
}

.report-btn-submit {
    background: linear-gradient(135deg, #ff5252 0%, #ff1744 100%);
    color: white;
}

.report-btn-submit:hover {
    background: linear-gradient(135deg, #ff1744 0%, #d50000 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 82, 82, 0.4);
}

.report-btn-submit:active {
    transform: translateY(0);
}

.report-btn-submit:disabled {
    background: var(--white-20);
    color: var(--white-50);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.report-feedback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, #2d2d44 0%, #1a1a2e 100%);
    padding: 24px;
    border-radius: 20px;
    text-align: center;
    display: none;
    box-sizing: border-box;
    z-index: 10;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.report-feedback.show {
    display: flex;
}

.report-feedback-icon {
    font-size: 56px;
    margin-bottom: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.report-feedback-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
    flex-shrink: 0;
}

.report-feedback-message {
    font-size: 16px;
    opacity: 0.85;
    line-height: 1.5;
    flex-shrink: 0;
}

/* Report modal mobile adjustments */
@media (max-width: 480px) {
    .report-checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .report-modal-content {
        margin: 16px;
        padding: 24px;
        max-width: none;
        width: auto;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
    
    .report-form-actions {
        flex-direction: column;
    }
    
    .report-btn {
        width: 100%;
        justify-content: center;
    }
    
    .report-feedback {
        padding: 20px;
        min-height: 200px;
    }
    
    .report-feedback-icon {
        font-size: 48px;
        margin-bottom: 16px;
    }
    
    .report-feedback-title {
        font-size: 20px;
    }
    
    .report-feedback-message {
        font-size: 15px;
    }
}
