/* style.css — Pi3 Panelo Player */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
}

/* ── Layer Management ─────────────────────────────────────────────── */
#app-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.layout-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: none;
}

.layout-layer.active { display: block; }

#default-layout-container  { z-index: 10; }
#schedule-layout-container { z-index: 20; }
#trigger-layout-container  { z-index: 30; }

/* ── Region ───────────────────────────────────────────────────────── */
.region { position: absolute; overflow: hidden; }

/* ── Media Items ──────────────────────────────────────────────────── */
.media-item {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.media-item.active { opacity: 1; }
.media-item video, .media-item img {
    width: 100%; height: 100%;
    object-fit: fill;
}

/* ── Running Text ─────────────────────────────────────────────────── */
.media-text {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    font-size: 24px;
    padding: 0 20px;
    white-space: nowrap;
}
@keyframes marquee-left  { from { transform: translateX(100%);  } to { transform: translateX(-100%); } }
@keyframes marquee-right { from { transform: translateX(-100%); } to { transform: translateX(100%);  } }
@keyframes marquee-up    { from { transform: translateY(100%);  } to { transform: translateY(-100%); } }
@keyframes marquee-down  { from { transform: translateY(-100%); } to { transform: translateY(100%);  } }

/* ── UI Overlays (base) ───────────────────────────────────────────── */
.ui-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.ui-layer.hidden { display: none !important; }

/* ── Boot Splash ──────────────────────────────────────────────────── */
#boot-splash {
    background: radial-gradient(ellipse at center, #0d1b2a 0%, #000 100%);
    z-index: 99999;
    transition: opacity 0.6s ease;
}
#boot-splash.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Pulsing ring around logo */
.logo-ring {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 3px solid rgba(77, 166, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ring-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(77, 166, 255, 0.4);
}
@keyframes ring-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(77,166,255,0.5); }
    50%  { box-shadow: 0 0 0 18px rgba(77,166,255,0); }
    100% { box-shadow: 0 0 0 0   rgba(77,166,255,0); }
}

.splash-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    animation: logo-spin 6s linear infinite;
}
/* Subtle slow rotation to show it's alive */
@keyframes logo-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.splash-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
}
.splash-sub {
    font-size: 13px;
    opacity: 0.5;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Progress bar */
.progress-track {
    width: 240px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4da6ff, #a78bfa);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.splash-status {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.5px;
    min-height: 18px;
}

.splash-hint {
    position: absolute;
    bottom: 24px;
    font-size: 12px;
    color: rgba(255,255,255,0.25);
}
.splash-hint kbd {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: monospace;
}

/* ── Registration Box ─────────────────────────────────────────────── */
#registration-overlay { background: rgba(0,0,0,0.92); }
.registration-box {
    text-align: center;
    background: #1e1e1e;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.pin-code {
    font-size: 64px;
    font-weight: bold;
    letter-spacing: 5px;
    color: #4CAF50;
    margin: 20px 0;
}

/* ── Diagnostic Panel ─────────────────────────────────────────────── */
#diagnostic-overlay {
    background: rgba(0,0,26,0.93);
    align-items: flex-start;
    justify-content: flex-start;
    padding: 40px;
}
#diagnostic-overlay h2 {
    color: #4da6ff;
    border-bottom: 1px solid #4da6ff;
    padding-bottom: 10px;
    margin-bottom: 20px;
    width: 100%;
}
#diagnostic-content {
    font-family: monospace;
    font-size: 16px;
    line-height: 1.8;
    width: 100%;
}

/* Download progress table inside diagnostic */
.dl-progress-bar {
    display: inline-block;
    width: 160px;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    vertical-align: middle;
    overflow: hidden;
    margin-left: 8px;
}
.dl-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4da6ff, #a78bfa);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.help-text {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: #888;
    font-size: 14px;
}
