/* ═══════════════════════════════════════════════════════════════════════════
   DSP Play — Samsung TV IPTV Player — Dark Blue Theme
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg: #0a0e17;
    --bg2: #101828;
    --surface: #141a2a;
    --surface2: #1c2438;
    --surface3: #253050;
    --border: #2a3454;
    --text: #e8ecf4;
    --text2: #8892b0;
    --text3: #4a5578;
    --accent: #4f8ef7;
    --accent2: #7ab3ff;
    --green: #3dd68c;
    --red: #e53935;
    --yellow: #fbbf24;
}

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

body {
    width: 1920px;
    height: 1080px;
    overflow: hidden;
    font-family: 'SamsungOne', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ═══ ACTIVATION SCREEN ═══ */
#screen-activation {
    justify-content: center; align-items: center;
    background: linear-gradient(135deg, #0a0e17 0%, #141a2a 50%, #0d1220 100%);
}
.activation-container { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.app-logo {
    font-size: 80px; font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.app-subtitle { font-size: 24px; color: var(--text2); letter-spacing: 10px; margin-top: -14px; }
.mac-box {
    padding: 32px 64px; background: var(--surface); border: 2px solid var(--accent);
    border-radius: 16px; box-shadow: 0 0 60px rgba(79,142,247,0.15);
}
.mac-label { font-size: 18px; color: var(--text3); letter-spacing: 3px; margin-bottom: 12px; }
.mac-value { font-size: 52px; font-weight: 700; font-family: monospace; color: var(--accent2); letter-spacing: 5px; }
.activation-info { color: var(--text2); font-size: 22px; line-height: 1.6; }
.portal-url {
    font-size: 34px; font-weight: 700; color: var(--green); margin: 10px 0;
    padding: 12px 32px; background: rgba(61,214,140,0.08); border: 1px solid rgba(61,214,140,0.2); border-radius: 10px;
}
.hint { font-size: 17px; color: var(--text3); }
.activation-status { font-size: 20px; color: var(--yellow); }
.activation-status.active { color: var(--green); }

/* ═══ HOME SCREEN ═══ */
#screen-home { padding: 0; }
#screen-home.active { display: flex; }

/* Top Bar */
#top-bar {
    height: 70px; padding: 0 48px;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(0,0,0,0.4); flex-shrink: 0; border-bottom: 1px solid var(--border);
}
.top-logo { font-size: 28px; font-weight: 700; color: var(--accent); }
.top-right { display: flex; align-items: center; gap: 24px; }
.top-icon {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--surface); color: var(--text2);
    font-size: 20px; transition: all 0.15s;
}
.top-icon.focused { background: var(--accent); color: #fff; }
.top-clock { font-size: 32px; font-weight: 600; color: var(--text); margin-left: 12px; }

/* Home Content */
#home-content {
    display: flex; flex: 1; padding: 28px 48px 20px; gap: 28px;
    min-height: 0; max-height: 540px;
}

/* Preview */
#home-preview { flex: 1; position: relative; border-radius: 16px; overflow: hidden; }
#preview-video {
    width: 100%; height: 100%; background: #000; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
}
#preview-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--surface), var(--surface2));
    display: flex; align-items: center; justify-content: center;
}
.preview-logo-text { font-size: 56px; font-weight: 800; color: rgba(255,255,255,0.08); }
#preview-info { position: absolute; bottom: 70px; left: 24px; right: 24px; }
#preview-channel-name { font-size: 26px; font-weight: 600; text-shadow: 0 2px 12px rgba(0,0,0,0.9); }
#preview-program { font-size: 17px; color: var(--text2); margin-top: 6px; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
.play-btn {
    position: absolute; bottom: 20px; left: 24px;
    padding: 12px 32px; background: var(--red); color: #fff;
    border: none; border-radius: 8px; font-size: 18px; font-weight: 600;
}
.play-btn.focused { background: #c62828; box-shadow: 0 0 0 3px rgba(229,57,53,0.5); }

/* Favorites */
#home-favorites { width: 380px; flex-shrink: 0; }
.section-title { font-size: 20px; font-weight: 600; color: var(--text2); margin-bottom: 14px; }
#fav-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-height: 400px; overflow: hidden; }
.fav-item {
    height: 80px; background: var(--surface); border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid transparent; transition: all 0.15s; padding: 8px;
}
.fav-item.focused { border-color: var(--accent); background: var(--surface2); transform: scale(1.04); }
.fav-item-name { font-size: 14px; color: var(--text2); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }

/* Categories Row */
#home-categories {
    display: flex; gap: 20px; padding: 0 48px 16px; flex-shrink: 0;
}
.cat-card {
    flex: 1; padding: 28px 16px 22px; background: var(--surface);
    border-radius: 14px; border: 2px solid transparent;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    transition: all 0.2s;
}
.cat-card.focused {
    border-color: var(--accent); background: var(--surface2);
    transform: translateY(-4px); box-shadow: 0 12px 32px rgba(79,142,247,0.2);
}
.cat-icon { width: 72px; height: 72px; }
.cat-icon svg { width: 100%; height: 100%; }
.cat-label { font-size: 20px; font-weight: 600; color: var(--text2); }
.cat-card.focused .cat-label { color: var(--text); }

/* Recent Row */
#home-recent { padding: 0 48px 20px; flex-shrink: 0; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
#recent-row { display: flex; gap: 14px; overflow: hidden; }
.recent-item {
    width: 240px; flex-shrink: 0;
    background: var(--surface); border-radius: 10px;
    display: flex; align-items: center; padding: 14px 16px; gap: 14px;
    border: 2px solid transparent; transition: all 0.15s;
}
.recent-item.focused { border-color: var(--accent); background: var(--surface2); }
.recent-item-name { font-size: 16px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.recent-item.focused .recent-item-name { color: var(--text); }
.recent-item-icon { width: 36px; height: 36px; color: var(--text3); flex-shrink: 0; }
.recent-item-icon svg { width: 100%; height: 100%; }
.recent-item-logo { width: 48px; height: 36px; border-radius: 4px; object-fit: contain; flex-shrink: 0; background: var(--surface2); }

/* ═══ LIVE TV ═══ */
#screen-live { flex-direction: row; }
#screen-live.active { display: flex; }

#live-sidebar {
    width: 340px; height: 100%; background: var(--surface);
    border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0;
}
.live-sidebar-header {
    padding: 20px 24px; display: flex; align-items: center; gap: 16px;
    border-bottom: 1px solid var(--border); height: 68px;
}
.live-back-btn { font-size: 18px; color: var(--accent); }
.live-title { font-size: 24px; font-weight: 600; }
#live-category-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.live-cat-item {
    padding: 16px 28px; font-size: 20px; color: var(--text2);
    border-left: 3px solid transparent; transition: all 0.12s;
}
.live-cat-item.focused { background: var(--surface2); color: var(--text); border-left-color: var(--accent); }
.live-cat-item.selected { color: var(--accent); border-left-color: var(--accent); }

#live-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#live-channel-header {
    padding: 18px 32px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border); flex-shrink: 0; height: 68px;
}
#live-cat-name { font-size: 24px; font-weight: 600; }
#live-cat-count { font-size: 18px; color: var(--text3); }
#live-channel-list { flex: 1; overflow-y: auto; padding: 4px 0; }

.ch-item {
    padding: 12px 32px; display: flex; align-items: center; gap: 16px;
    font-size: 20px; color: var(--text2); border-left: 3px solid transparent; transition: all 0.1s;
}
.ch-item.focused { background: var(--surface2); color: var(--text); border-left-color: var(--accent); }
.ch-item.playing { color: var(--green); border-left-color: var(--green); }
.ch-num { width: 48px; text-align: right; font-size: 16px; color: var(--text3); font-family: monospace; }
.ch-logo { width: 48px; height: 36px; border-radius: 4px; background: var(--surface); object-fit: contain; flex-shrink: 0; }
.ch-info { flex: 1; min-width: 0; }
.ch-name { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-epg { font-size: 14px; color: var(--text3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-item.focused .ch-epg { color: var(--text2); }
.ch-fav { color: var(--yellow); font-size: 18px; flex-shrink: 0; }

/* ═══ PLAYER ═══ */
#screen-player { background: #000; }
#screen-player.active { display: block; }
#player-overlay {
    position: absolute; inset: 0; z-index: 10;
    display: flex; flex-direction: column; justify-content: space-between;
    background: linear-gradient(rgba(0,0,0,0.7) 0%, transparent 12%, transparent 60%, rgba(0,0,0,0.92) 100%);
}
#player-top-bar { padding: 20px 40px; text-align: right; }
#player-clock { font-size: 28px; color: var(--text2); }
#player-bottom { padding: 0 48px 36px; }
#player-bar {
    display: flex; align-items: center; gap: 24px;
    padding: 20px 28px; margin-bottom: 14px;
    background: rgba(20,26,42,0.92); border-radius: 14px;
    border: 1px solid rgba(79,142,247,0.25);
    box-shadow: 0 -4px 40px rgba(0,0,0,0.5);
}
.player-ch-logo { width: 64px; height: 48px; border-radius: 6px; object-fit: contain; flex-shrink: 0; background: rgba(255,255,255,0.06); }
#player-info { flex: 1; min-width: 0; }
#player-info-top { display: flex; align-items: baseline; gap: 16px; margin-bottom: 6px; }
#player-channel-num { font-size: 48px; font-weight: 700; color: var(--accent); line-height: 1; }
#player-channel-name { font-size: 30px; font-weight: 600; }
#player-epg { }
#player-epg-now { font-size: 18px; color: var(--text2); }
#player-epg-next { font-size: 16px; color: var(--text3); margin-top: 3px; }
#player-hints { display: flex; gap: 36px; font-size: 15px; color: var(--text3); }

/* ═══ SETTINGS ═══ */
#screen-settings { justify-content: flex-start; align-items: center; padding-top: 100px; background: var(--bg); }
#screen-settings.active { display: flex; }
.settings-container { width: 750px; }
.settings-header { display: flex; align-items: center; gap: 24px; margin-bottom: 36px; }
.settings-header h1 { font-size: 36px; }
.settings-list { display: flex; flex-direction: column; gap: 6px; }
.settings-item {
    padding: 22px 28px; background: var(--surface); border-radius: 12px;
    display: flex; justify-content: space-between; align-items: center;
    border: 2px solid transparent; transition: all 0.15s;
}
.settings-item.focused { border-color: var(--accent); background: var(--surface2); }
.settings-label { font-size: 22px; }
.settings-value { font-size: 18px; color: var(--text2); }

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
