/*
 * Planet TravFlix — Tron/cyberpunk styling.
 * Extracted from the original inline stylesheet; cyan by default, red under
 * body.johnny-mode.
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000000;
    font-family: 'Orbitron', 'Share Tech Mono', monospace;
    color: #00ffff;
    overflow: hidden;
    transition: color 0.5s ease;
}

/* --- Ambient effects ------------------------------------------------------ */

.grid-overlay {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    opacity: 0.3;
    z-index: 1;
    transition: background-image 0.5s ease;
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0,255,255,0.3), transparent);
    opacity: 0.5;
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 999;
    transition: background 0.5s ease;
}

@keyframes scanline {
    from { top: 0; }
    to { top: 100%; }
}

/* --- Header --------------------------------------------------------------- */

.gradient-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0,14,27,0.6);
    padding: 8px;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,255,255,0.3);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 20px rgba(0,255,255,0.15);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.5s ease,
                border-color 0.5s ease,
                box-shadow 0.5s ease;
}

.gradient-header.hidden-for-intro {
    transform: translateY(-100%);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-title {
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0,255,255,0.8);
    letter-spacing: 0.5px;
    transition: color 0.5s ease, text-shadow 0.5s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header-stats {
    display: flex;
    gap: 10px;
    font-size: 10px;
    color: rgba(0,255,255,0.8);
    transition: color 0.5s ease;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 12px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0,255,255,0.5);
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

.stat-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    font-size: 8px;
}

@media (min-width: 768px) {
    .gradient-header { padding: 20px; }
    .header-title { font-size: 24px; letter-spacing: 2px; }
    .header-stats { gap: 30px; font-size: 12px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 10px; margin-top: 2px; }
}

/* --- People search + crossover filter ------------------------------------- */
/* Chips stay cyan even under body.johnny-mode so the two active filters
   (rose johnny theme vs cyan people chips) read as distinct. */

.people-search {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 8px;
}

.people-search-toggle {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(0,255,255,0.3);
    border-radius: 4px;
    color: #00ffff;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
}

.people-search-toggle:hover {
    background: rgba(0,255,255,0.1);
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0,255,255,0.5);
}

#people-search-input {
    width: 100%;
    background: rgba(0,255,255,0.05);
    border: 1px solid rgba(0,255,255,0.3);
    border-radius: 4px;
    color: #00ffff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 10px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#people-search-input::placeholder { color: rgba(0,255,255,0.4); }

#people-search-input:focus {
    border-color: #00ffff;
    box-shadow: 0 0 12px rgba(0,255,255,0.4);
}

#people-search-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile: magnifier toggle expands the input over the header row. */
@media (max-width: 767px) {
    .people-search { position: static; }
    .people-search-box { display: none; }
    .people-search.expanded .people-search-box {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0,14,27,0.98);
        border-radius: 4px;
        z-index: 5;
    }
}

/* Desktop: persistent input, no toggle. */
@media (min-width: 768px) {
    .people-search-toggle { display: none; }
    .people-search-box {
        position: relative;
        width: 220px;
        max-width: 100%;
    }
}

.people-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 300px;
    max-width: calc(100vw - 16px);
    max-height: 320px;
    overflow-y: auto;
    background: rgba(0,14,27,0.95);
    border: 1px solid rgba(0,255,255,0.3);
    border-radius: 4px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0,255,255,0.2);
    z-index: 1200;
}

.people-dropdown.open { display: block; }

@media (max-width: 767px) {
    .people-dropdown {
        left: 0;
        right: 0;
        width: auto;
    }
}

.people-result {
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,255,255,0.1);
}

.people-result:last-child { border-bottom: none; }

.people-result.active { background: rgba(0,255,255,0.12); }

.people-result.selected { opacity: 0.5; }

.people-result-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.people-result-name {
    color: #00ffff;
    font-size: 12px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.people-result-count {
    color: rgba(0,255,255,0.5);
    font-size: 9px;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.people-result-roles {
    color: rgba(0,255,255,0.6);
    font-size: 10px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.people-no-matches {
    padding: 10px;
    color: rgba(0,255,255,0.5);
    font-size: 11px;
    letter-spacing: 1px;
    text-align: center;
}

/* Chips row (inside the header so headerHeight/overpan track it). */
.people-chips { display: none; }

.people-chips.has-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
    max-width: 100%;
}

.people-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.people-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    background: rgba(0,255,255,0.08);
    border: 1px solid rgba(0,255,255,0.5);
    border-radius: 12px;
    color: #00ffff;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 6px 3px 10px;
    box-shadow: 0 0 8px rgba(0,255,255,0.15);
}

.people-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

.people-chip-remove {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}

.people-chip-remove:hover {
    color: #ffffff;
    text-shadow: 0 0 6px #00ffff;
}

.people-clear-all {
    background: transparent;
    border: none;
    color: rgba(0,255,255,0.6);
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    text-decoration: underline;
    cursor: pointer;
    padding: 2px 4px;
}

.people-clear-all:hover { color: #00ffff; }

.people-max-hint {
    display: none;
    color: rgba(0,255,255,0.5);
    font-size: 9px;
    letter-spacing: 1px;
}

.people-chips.at-max .people-max-hint { display: inline; }

/* Empty crossover state: informative, non-blocking (input passes through). */
.people-empty-state {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 900;
}

.people-empty-state.visible { display: flex; }

.people-empty-box {
    border: 1px solid rgba(0,255,255,0.4);
    border-radius: 6px;
    background: rgba(0,14,27,0.85);
    box-shadow: 0 0 30px rgba(0,255,255,0.15);
    padding: 24px 32px;
    margin: 0 16px;
    text-align: center;
}

.people-empty-title {
    color: #00ffff;
    font-size: 16px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0,255,255,0.6);
    margin-bottom: 8px;
}

.people-empty-message {
    color: rgba(0,255,255,0.7);
    font-size: 12px;
    line-height: 1.5;
}

/* 320px safety: tighten the fixed-width header pieces so title + magnifier
   + stats fit without horizontal overflow. */
@media (max-width: 400px) {
    .hamburger-btn { margin-right: 10px; }
    .header-title { font-size: 12px; }
    .header-stats { gap: 6px; }
    .people-search { margin: 0 4px; }
}

/* --- Hamburger + side menu ------------------------------------------------ */

.hamburger-btn {
    position: relative;
    width: 35px;
    height: 35px;
    background: transparent;
    border: 1px solid rgba(0,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0;
    transition: all 0.3s, border-color 0.5s ease, box-shadow 0.5s ease;
    margin-right: 20px;
}

.hamburger-btn:hover {
    background: rgba(0,255,255,0.1);
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0,255,255,0.5);
}

.hamburger-btn span {
    width: 20px;
    height: 2px;
    background: #00ffff;
    transition: all 0.3s, background 0.5s ease, box-shadow 0.5s ease;
    box-shadow: 0 0 5px rgba(0,255,255,0.5);
}

.hamburger-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: rgba(0,14,27,0.95);
    border-right: 1px solid rgba(0,255,255,0.3);
    backdrop-filter: blur(10px);
    transition: left 0.3s ease, background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
    z-index: 2000;
    padding: 60px 30px 30px;
    overflow-y: auto;
    box-shadow: 5px 0 30px rgba(0,255,255,0.2);
}

.side-menu.active { left: 0; }

.menu-title {
    color: #00ffff;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,255,255,0.2);
    text-shadow: 0 0 10px rgba(0,255,255,0.5);
}

.menu-title-spaced { margin-top: 30px; }

.menu-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-btn {
    background: transparent;
    border: 1px solid rgba(0,255,255,0.5);
    color: #00ffff;
    padding: 10px 15px;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s, color 0.5s ease, border-color 0.5s ease, background 0.5s ease;
    width: 100%;
    text-align: left;
}

.control-btn:hover {
    background: rgba(0,255,255,0.1);
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0,255,255,0.5);
    transform: translateX(5px);
}

.control-btn.active {
    background: rgba(0,255,255,0.2);
    border-color: #00ffff;
}

.btn-clear-cache { margin-top: 10px; }

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1999;
}

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

.cache-info-box {
    color: #00ffff;
    border: 1px solid rgba(0,255,255,0.3);
    background: rgba(0,255,255,0.05);
    font-size: 11px;
    padding: 10px;
}

#cache-status { margin-bottom: 5px; }
#cache-size { opacity: 0.7; }

.menu-note {
    margin-top: 8px;
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: 0.5px;
    color: rgba(0, 255, 255, 0.5);
}

body.johnny-mode .menu-note { color: rgba(255, 0, 102, 0.55); }

/* --- Canvas container ----------------------------------------------------- */

.gradient-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(0,14,27,0.5) 0%, #000000 100%);
}

#planet-canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
    display: block;
    touch-action: none;
}

#cube-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
    display: block;
    touch-action: none;
}

/* Whichever view is inactive keeps its canvas out of the way entirely. */
.view-hidden { display: none !important; }

/* --- Loading overlay ------------------------------------------------------ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0,255,255,0.2);
    border-top-color: #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 20px;
    font-size: 18px;
    color: #00ffff;
    text-shadow: 0 0 20px rgba(0,255,255,0.8);
}

.loading-progress {
    margin-top: 10px;
    font-size: 14px;
    color: rgba(0,255,255,0.6);
    min-height: 20px;
    text-align: center;
    padding: 0 20px;
}

.progress-bar-container {
    width: 300px;
    max-width: 80vw;
    height: 10px;
    background: rgba(0,255,255,0.1);
    border: 1px solid rgba(0,255,255,0.3);
    border-radius: 5px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00ffff, #0088ff);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0,255,255,0.5);
}

.loading-error {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 25px;
    max-width: 480px;
    border: 1px solid rgba(255,0,100,0.5);
    border-radius: 6px;
    background: rgba(255,0,100,0.06);
    box-shadow: 0 0 30px rgba(255,0,100,0.2);
}

.loading-error-title {
    color: #ff0064;
    font-size: 16px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255,0,100,0.6);
}

#loading-error-message {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.loading-error .control-btn {
    width: auto;
    text-align: center;
    border-color: #ff0064;
    color: #ff0064;
}

.loading-error .control-btn:hover {
    background: rgba(255,0,100,0.1);
    box-shadow: 0 0 15px rgba(255,0,100,0.5);
}

/* --- Tooltip -------------------------------------------------------------- */

.movie-tooltip {
    position: fixed;
    background: rgba(0,14,27,0.6);
    border: 1px solid rgba(0,255,255,0.3);
    padding: 6px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1500;
    max-width: 200px;
    backdrop-filter: blur(6px);
    box-shadow: 0 0 12px rgba(0,255,255,0.15);
}

.movie-tooltip.visible { opacity: 1; }

.tooltip-title {
    color: #00ffff;
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 11px;
}

.tooltip-info {
    color: rgba(0,255,255,0.7);
    font-size: 9px;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .movie-tooltip { padding: 10px; max-width: 300px; }
    .tooltip-title { font-size: 14px; margin-bottom: 5px; }
    .tooltip-info { font-size: 11px; line-height: 1.4; }
}

/* --- Movie details panel -------------------------------------------------- */

.movie-info-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: rgba(0,14,27,0.6);
    border-top: 2px solid rgba(0,255,255,0.3);
    padding: 15px;
    transition: bottom 0.3s ease;
    z-index: 1100;
    backdrop-filter: blur(6px);
    box-shadow: 0 -5px 30px rgba(0,255,255,0.15);
    max-height: 40vh;
    overflow-y: auto;
}

.movie-info-panel.active { bottom: 0; }

.info-panel-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: 1px solid rgba(0,255,255,0.3);
    color: #00ffff;
    font-size: 18px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 400;
}

.info-panel-close:hover {
    background: rgba(0,255,255,0.1);
    border-color: #00ffff;
    transform: rotate(90deg);
}

.info-panel-content {
    display: flex;
    gap: 20px;
    align-items: start;
}

.info-panel-poster {
    width: 150px;
    height: 225px;
    object-fit: cover;
    border: 2px solid rgba(0,255,255,0.3);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,255,255,0.2);
    flex-shrink: 0;
}

.info-panel-details {
    flex: 1;
    min-width: 0;
}

.info-panel-title {
    color: #00ffff;
    font-size: 20px;
    margin: 0 0 10px 0;
    padding-right: 40px;
    text-shadow: 0 0 10px rgba(0,255,255,0.5);
    font-weight: 700;
    letter-spacing: 1px;
}

.info-panel-meta {
    color: rgba(0,255,255,0.7);
    font-size: 12px;
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.info-panel-meta span {
    display: inline-flex;
    align-items: center;
    height: 20px;
    line-height: 1;
}

.info-panel-description {
    color: rgba(0,255,255,0.8);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 10px;
    max-height: 120px;
    overflow-y: auto;
}

.info-panel-actions { margin-top: 15px; }

.watch-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0,255,255,0.1), rgba(0,255,255,0.05));
    border: 2px solid #00ffff;
    color: #00ffff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(0,255,255,0.2);
}

.watch-button:hover {
    background: linear-gradient(135deg, rgba(0,255,255,0.2), rgba(0,255,255,0.1));
    box-shadow: 0 0 30px rgba(0,255,255,0.4);
    transform: translateY(-2px);
}

.watch-icon { font-size: 16px; }

@media (max-width: 768px) {
    .movie-info-panel { max-height: 50vh; padding: 10px; }
    .info-panel-content { gap: 15px; }
    .info-panel-poster { width: 100px; height: 150px; }
    .info-panel-title { font-size: 16px; }
    .info-panel-meta { font-size: 11px; }
    .info-panel-description { font-size: 12px; max-height: 100px; }
}

/* --- Dialog --------------------------------------------------------------- */

.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.dialog-box {
    background: linear-gradient(135deg, rgba(0,14,27,0.98) 0%, rgba(0,20,35,0.98) 100%);
    border: 2px solid #00ffff;
    border-radius: 8px;
    padding: 30px;
    min-width: 320px;
    max-width: 480px;
    box-shadow:
        0 0 50px rgba(0,255,255,0.4),
        inset 0 0 30px rgba(0,255,255,0.05);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dialog-overlay.active .dialog-box { transform: scale(1); }

.dialog-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 20px,
            rgba(0,255,255,0.02) 20px, rgba(0,255,255,0.02) 21px),
        repeating-linear-gradient(90deg, transparent, transparent 20px,
            rgba(0,255,255,0.02) 20px, rgba(0,255,255,0.02) 21px);
    pointer-events: none;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

.dialog-title {
    font-size: 20px;
    color: #00ffff;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0,255,255,0.5);
    font-weight: bold;
}

.dialog-message {
    color: rgba(255,255,255,0.9);
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 14px;
}

.dialog-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.dialog-btn {
    background: rgba(0,255,255,0.1);
    border: 1px solid #00ffff;
    color: #00ffff;
    padding: 10px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Orbitron', 'Share Tech Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.dialog-btn:hover {
    background: rgba(0,255,255,0.2);
    box-shadow: 0 0 20px rgba(0,255,255,0.5);
    transform: translateY(-2px);
}

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

.dialog-btn.primary {
    background: rgba(0,255,255,0.2);
    font-weight: bold;
}

.dialog-btn.danger {
    background: rgba(255,0,100,0.1);
    border-color: #ff0064;
    color: #ff0064;
}

.dialog-btn.danger:hover {
    background: rgba(255,0,100,0.2);
    box-shadow: 0 0 20px rgba(255,0,100,0.5);
}

/* --- Connection status bar ------------------------------------------------ */

.connection-status {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,14,27,0.9);
    padding: 8px;
    z-index: 999;
    border-top: 1px solid rgba(255,100,0,0.5);
    backdrop-filter: blur(6px);
    box-shadow: 0 -2px 20px rgba(255,100,0,0.15);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(255,150,0,0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.connection-status.visible { transform: translateY(0); }

.connection-status.reconnecting {
    border-top-color: rgba(255,200,0,0.5);
    box-shadow: 0 -2px 20px rgba(255,200,0,0.15);
    color: rgba(255,200,0,0.9);
}

.connection-status.error {
    border-top-color: rgba(255,0,100,0.5);
    box-shadow: 0 -2px 20px rgba(255,0,100,0.15);
    color: rgba(255,0,100,0.9);
}

.connection-status.success,
.connection-status.connected {
    border-top-color: rgba(0,255,150,0.5);
    box-shadow: 0 -2px 20px rgba(0,255,150,0.15);
    color: rgba(0,255,150,0.9);
}

.connection-status-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.connection-status-message {
    font-family: 'Orbitron', 'Share Tech Mono', monospace;
}

/* --- ECG (Johnny mode heartbeat) ------------------------------------------ */

#ecg-container {
    position: absolute;
    left: calc(100% + 20px);
    top: 0;
    bottom: 0;
    margin: auto 0;
    display: none;
    border: 1px solid #ff0066;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255,0,102,0.3);
}

#ecg-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.8;
    pointer-events: none;
}

#ecg-bpm {
    position: absolute;
    right: 5px;
    bottom: 2px;
    color: #ff0066;
    font-family: monospace;
    font-size: 10px;
    text-shadow: 0 0 3px #ff0066;
}

.ecg-responsive {
    width: 200px;
    height: 30px;
}

@media (max-width: 1400px) {
    .ecg-responsive { width: 150px; height: 25px; }
    #ecg-bpm { font-size: 9px; }
}

@media (max-width: 1200px) {
    .ecg-responsive { width: 120px; height: 22px; }
    #ecg-bpm { font-size: 8px; }
}

@media (max-width: 768px) {
    .ecg-responsive { width: 100px; height: 20px; }
    #ecg-bpm { display: none; }
}

/* --- Johnny Mode (red theme) ---------------------------------------------- */

body.johnny-mode { color: #ff0066; }

body.johnny-mode::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(255,0,102,0.05) 100%);
    pointer-events: none;
    z-index: 0;
    animation: pulse-red 4s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

body.johnny-mode .gradient-header {
    background: rgba(27,0,14,0.6);
    border-bottom-color: rgba(255,0,102,0.3);
    box-shadow: 0 2px 20px rgba(255,0,102,0.15);
}

body.johnny-mode .header-title {
    color: #ff0066;
    text-shadow: 0 0 10px rgba(255,0,102,0.8);
}

body.johnny-mode .header-stats { color: rgba(255,0,102,0.8); }

body.johnny-mode .stat-value {
    color: #ff0066;
    text-shadow: 0 0 5px rgba(255,0,102,0.5);
}

body.johnny-mode .hamburger-btn { border-color: rgba(255,0,102,0.3); }

body.johnny-mode .hamburger-btn:hover {
    background: rgba(255,0,102,0.1);
    border-color: #ff0066;
    box-shadow: 0 0 15px rgba(255,0,102,0.5);
}

body.johnny-mode .hamburger-btn span {
    background: #ff0066;
    box-shadow: 0 0 5px rgba(255,0,102,0.5);
}

body.johnny-mode .side-menu {
    background: rgba(27,0,14,0.95);
    border-right-color: rgba(255,0,102,0.3);
    box-shadow: 5px 0 30px rgba(255,0,102,0.2);
}

body.johnny-mode .menu-title {
    color: #ff0066;
    border-bottom-color: rgba(255,0,102,0.2);
    text-shadow: 0 0 10px rgba(255,0,102,0.5);
}

body.johnny-mode .control-btn {
    border-color: rgba(255,0,102,0.5);
    color: #ff0066;
}

body.johnny-mode .control-btn:hover {
    background: rgba(255,0,102,0.1);
    border-color: #ff0066;
    box-shadow: 0 0 15px rgba(255,0,102,0.5);
}

body.johnny-mode .control-btn.active {
    background: rgba(255,0,102,0.2);
    border-color: #ff0066;
}

body.johnny-mode .cache-info-box {
    color: #ff0066;
    border: 1px solid rgba(255,0,102,0.3);
    background: rgba(255,0,102,0.05);
}

body.johnny-mode #cache-status { color: #ff0066; }
body.johnny-mode #cache-size { color: rgba(255,0,102,0.7); }

body.johnny-mode .loading-spinner {
    border-color: rgba(255,0,102,0.2);
    border-top-color: #ff0066;
}

body.johnny-mode .loading-text {
    color: #ff0066;
    text-shadow: 0 0 20px rgba(255,0,102,0.8);
}

body.johnny-mode .loading-progress { color: rgba(255,0,102,0.6); }

body.johnny-mode .progress-bar-container {
    background: rgba(255,0,102,0.1);
    border-color: rgba(255,0,102,0.3);
}

body.johnny-mode .progress-bar {
    background: linear-gradient(90deg, #ff0066, #ff0033);
    box-shadow: 0 0 10px rgba(255,0,102,0.5);
}

body.johnny-mode .movie-tooltip {
    background: rgba(27,0,14,0.6);
    border-color: rgba(255,0,102,0.3);
    box-shadow: 0 0 12px rgba(255,0,102,0.15);
}

body.johnny-mode .tooltip-title { color: #ff0066; }
body.johnny-mode .tooltip-info { color: rgba(255,0,102,0.7); }

body.johnny-mode .grid-overlay {
    background-image:
        linear-gradient(rgba(255,0,102,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,0,102,0.03) 1px, transparent 1px);
}

body.johnny-mode .scanline {
    background: linear-gradient(90deg, transparent, rgba(255,0,102,0.3), transparent);
}

body.johnny-mode .movie-info-panel {
    background: rgba(27,0,14,0.6);
    border-top-color: rgba(255,0,102,0.3);
    box-shadow: 0 -5px 30px rgba(255,0,102,0.15);
}

body.johnny-mode .info-panel-close {
    border-color: rgba(255,0,102,0.3);
    color: #ff0066;
}

body.johnny-mode .info-panel-close:hover {
    background: rgba(255,0,102,0.1);
    border-color: #ff0066;
}

body.johnny-mode .info-panel-poster {
    border-color: rgba(255,0,102,0.3);
    box-shadow: 0 0 20px rgba(255,0,102,0.2);
}

body.johnny-mode .info-panel-title {
    color: #ff0066;
    text-shadow: 0 0 10px rgba(255,0,102,0.5);
}

body.johnny-mode .info-panel-meta { color: rgba(255,0,102,0.7); }
body.johnny-mode .info-panel-description { color: rgba(255,0,102,0.8); }

body.johnny-mode .watch-button {
    background: linear-gradient(135deg, rgba(255,0,102,0.1), rgba(255,0,102,0.05));
    border-color: #ff0066;
    color: #ff0066;
    box-shadow: 0 0 20px rgba(255,0,102,0.2);
}

body.johnny-mode .watch-button:hover {
    background: linear-gradient(135deg, rgba(255,0,102,0.2), rgba(255,0,102,0.1));
    box-shadow: 0 0 30px rgba(255,0,102,0.4);
}

body.johnny-mode .dialog-box {
    background: linear-gradient(135deg, rgba(27,0,14,0.98) 0%, rgba(35,0,20,0.98) 100%);
    border-color: #ff0066;
    box-shadow:
        0 0 50px rgba(255,0,102,0.4),
        inset 0 0 30px rgba(255,0,102,0.05);
}

body.johnny-mode .dialog-btn {
    background: rgba(255,0,102,0.1);
    border-color: #ff0066;
    color: #ff0066;
}

body.johnny-mode .dialog-btn:hover {
    background: rgba(255,0,102,0.2);
    box-shadow: 0 0 20px rgba(255,0,102,0.5);
}

body.johnny-mode .dialog-btn.primary { background: rgba(255,0,102,0.2); }
