/* ═══════════════════════════════════════════════
   Splash Screen — CapPlayer Android Design (TV)
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

#splash-screen {
    --gold: #E2B84B;
    --gold-soft: #D4A843;
    --text-primary: #F0EDE6;
    --text-secondary: rgba(240,237,230,0.5);
    --text-muted: rgba(255,255,255,0.53);
    --glass-border: rgba(255,255,255,0.07);
    --status-success: #4CAF50;
    --status-warning: #E2B84B;
    --status-critical: #FF4444;

    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    font-family: 'Inter', -apple-system, 'Segoe UI', Arial, sans-serif;
    color: var(--text-primary);
    overflow: hidden;
}

/* Background */
.splash-bg-image {
    position: absolute;
    inset: 0;
    background: url('../images/background_violet.png') center/cover no-repeat;
    z-index: 0;
}
.splash-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(4,2,10,0.75);
    z-index: 1;
}

/* ─── Layout: 34% logo left, 66% content right (TV style) ─── */
.splash-left {
    width: 34%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.splash-right {
    width: 66%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 60px 40px 20px;
    z-index: 2;
}

/* ─── Logo with ring ─── */
.splash-logo-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.splash-logo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(226,184,75,0.25);
}
.splash-logo-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    animation: splashLogoIn 0.7s ease-out forwards;
}
@keyframes splashLogoIn {
    0% { opacity: 0; transform: scale(0.7) translateY(20px); }
    70% { opacity: 1; transform: scale(1.08) translateY(0); }
    85% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* ─── Title row ─── */
.splash-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.splash-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}
.splash-playlist-name {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.splash-percent {
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(226,184,75,0.06);
    border: 1px solid rgba(226,184,75,0.19);
    color: var(--gold);
    font-size: 14px;
    font-weight: 700;
}

/* ─── Progress bar ─── */
.splash-progress-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}
.splash-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold), var(--gold-soft));
    border-radius: 4px;
    transition: width 0.4s ease-out;
}

/* ─── Stage message ─── */
.splash-stage-msg {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    min-height: 22px;
}

/* ─── Stages grid (2x2) ─── */
.splash-stages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}
.splash-stage-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    opacity: 0.46;
    transition: all 0.3s ease;
}
.splash-stage-card.active {
    background: rgba(226,184,75,0.08);
    border-color: rgba(226,184,75,0.25);
    opacity: 1;
}
.splash-stage-card.completed {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.25);
    opacity: 1;
}

/* Stage icon circle */
.splash-stage-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    transition: all 0.3s;
}
/* Idle */
.splash-stage-card .splash-stage-icon {
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.15);
    color: #444466;
}
/* Active */
.splash-stage-card.active .splash-stage-icon {
    background: rgba(226,184,75,0.1);
    border-color: var(--gold);
    color: var(--gold);
}
/* Completed */
.splash-stage-card.completed .splash-stage-icon {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

/* Spinner for active stage */
.splash-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: splashSpin 0.7s linear infinite;
}
.splash-stage-card.active .splash-spinner {
    display: block;
}
.splash-stage-card.active .splash-stage-icon-i {
    display: none;
}
@keyframes splashSpin {
    to { transform: rotate(360deg); }
}

/* Stage text */
.splash-stage-label {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}
.splash-stage-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
}

/* ─── Stats row ─── */
.splash-stats-label {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    margin-bottom: 8px;
}
.splash-stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.splash-stat-card {
    flex: 1;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}
.splash-stat-count {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.splash-stat-name {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

/* ─── Device info (bottom bar, Android-style) ─── */
.splash-device-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 16px;
    padding: 14px 20px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
}
.splash-device-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 24px;
}
.splash-device-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
}
.splash-device-value {
    font-size: 15px;
    font-weight: 700;
    color: #E2B84B;
    letter-spacing: 0.5px;
}
.splash-device-separator {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.12);
    flex-shrink: 0;
}

/* ─── Error state ─── */
.splash-error {
    display: none;
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(255,68,68,0.2);
    border: 1px solid rgba(255,68,68,0.33);
}
.splash-error.visible {
    display: block;
}
.splash-error-text {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}
.splash-error-btns {
    display: flex;
    gap: 12px;
    align-items: center;
}
.splash-btn-retry {
    padding: 10px 18px;
    background: var(--gold);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.splash-btn-retry:hover,
.splash-btn-retry.focused {
    background: var(--gold-soft);
    transform: scale(1.04);
}
.splash-btn-demo {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
}
.splash-btn-demo:hover,
.splash-btn-demo.focused {
    color: #fff;
}

/* ─── Expiration Dialog ─── */
.sp-exp-overlay {
    position: absolute;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spExpFadeIn 0.3s ease-out;
}
@keyframes spExpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.sp-exp-modal {
    background: rgba(6,6,14,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 0;
    max-width: 480px;
    width: 92%;
    text-align: center;
    color: #F0EDE6;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    animation: spExpModalIn 0.35s ease-out;
}
@keyframes spExpModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(16px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.sp-exp-stripe {
    height: 4px;
    width: 100%;
}
.sp-exp-icon {
    font-size: 34px;
    color: #E2B84B;
    margin: 24px 0 10px;
}
.sp-exp-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    padding: 0 32px;
}
.sp-exp-subtitle {
    font-size: 13px;
    color: rgba(240,237,230,0.55);
    margin-bottom: 14px;
    line-height: 1.5;
    white-space: pre-line;
    padding: 0 32px;
}
.sp-exp-date-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(226,184,75,0.85);
    margin-bottom: 14px;
    padding: 0 32px;
}
.sp-exp-date-row i {
    font-size: 14px;
}
.sp-exp-date-row strong {
    color: #E2B84B;
    font-weight: 700;
}
.sp-exp-device {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 12px 18px;
    margin: 0 32px 14px;
    font-size: 13px;
    text-align: left;
}
.sp-exp-device-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 5px 0;
}
.sp-exp-device-row span {
    color: rgba(240,237,230,0.45);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.sp-exp-device-row strong {
    color: #E2B84B;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
}
.sp-exp-qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 32px;
}
.sp-exp-qr {
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
}
.sp-exp-qr canvas, .sp-exp-qr img {
    border-radius: 8px;
    border: 3px solid #fff;
}
.sp-exp-qr-label {
    font-size: 11px;
    color: rgba(240,237,230,0.4);
    margin-bottom: 2px;
}
.sp-exp-qr-link {
    font-size: 12px;
    color: #E2B84B;
    text-decoration: underline;
    font-weight: 600;
}
.sp-exp-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 0 32px 28px;
}
.sp-exp-btn {
    padding: 10px 20px;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #F0EDE6;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 7px;
}
.sp-exp-btn i {
    font-size: 12px;
}
.sp-exp-btn.focused {
    background: rgba(226,184,75,0.15);
    border-color: #E2B84B;
    color: #E2B84B;
    transform: scale(1.06);
    box-shadow: 0 0 16px rgba(226,184,75,0.2);
}
.sp-exp-btn-exit {
    color: rgba(255,68,68,0.75);
}
.sp-exp-btn-exit.focused {
    background: rgba(255,68,68,0.1);
    border-color: #FF4444;
    color: #FF4444;
    box-shadow: 0 0 16px rgba(255,68,68,0.15);
}

/* ─── Version badge (matches Android LOCAL BUILD badge) ─── */
.splash-version-badge {
    position: absolute;
    bottom: 14px;
    right: 20px;
    background: rgba(226,184,75,0.2);
    color: #E2B84B;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
