/* Anet IPTV - Smart TV App Styles */
/* 10-foot UI: Dark theme, 1920x1080, remote-optimized */

:root {
    --bg-primary: #0a0a1a;
    --bg-card: #1a1a2e;
    --bg-sidebar: #111122;
    --bg-input: #111119;
    --accent: #00b4d8;
    --accent-dark: #0090b0;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --border: #2a2a3e;
    --focus-glow: 0 0 0 3px var(--accent), 0 0 20px rgba(0,180,216,0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s ease;
}

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

html, body {
    width: 1920px; height: 1080px;
    overflow: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', -apple-system, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    cursor: none;
}

::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* === Screens === */
.screen {
    position: fixed; inset: 0;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

/* === Focus System === */
.focusable {
    outline: none;
    transition: var(--transition);
    position: relative;
}
.focusable:focus, .focusable.focused {
    outline: none;
    box-shadow: var(--focus-glow);
    transform: scale(1.05);
    z-index: 10;
}

/* === Navigation Bar === */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: 64px;
    background: rgba(10,10,26,0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 40px;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}
.navbar .logo {
    font-size: 22px; font-weight: 700;
    color: var(--accent);
    letter-spacing: 3px;
    margin-right: 50px;
}
.nav-tab {
    padding: 12px 28px;
    font-size: 17px;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    white-space: nowrap;
}
.nav-tab:focus, .nav-tab.focused {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(0,180,216,0.1);
    box-shadow: none;
    transform: none;
}
.nav-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* === Splash Screen === */
.splash-content {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100vh;
}
.splash-logo {
    font-size: 56px; font-weight: 800;
    letter-spacing: 10px;
    color: var(--accent);
    margin-bottom: 20px;
    text-shadow: 0 0 40px rgba(0,180,216,0.5);
}
.splash-version {
    font-size: 16px; color: var(--text-muted);
    margin-bottom: 40px;
}
.spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === Connection Screen === */
.connection-content {
    display: flex; flex-direction: column;
    align-items: center;
    padding-top: 100px;
}
.connection-title {
    font-size: 36px; font-weight: 700;
    margin-bottom: 50px;
}
.connection-cards {
    display: flex; gap: 40px;
    margin-bottom: 50px;
}
.card-option {
    width: 320px; height: 220px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px; cursor: pointer;
}
.card-option .card-icon {
    font-size: 48px; color: var(--accent);
}
.card-option .card-label {
    font-size: 20px; font-weight: 600;
}
.card-option .card-desc {
    font-size: 14px; color: var(--text-muted);
}
.card-option:focus, .card-option.focused {
    border-color: var(--accent);
    background: rgba(0,180,216,0.1);
}
.card-option.selected {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0,180,216,0.3);
}

/* === Input Fields === */
.input-group { margin-bottom: 16px; }
.input-group label {
    display: block; font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.text-input {
    width: 100%;
    background: var(--bg-input);
    border: 2px solid var(--border);
    color: var(--text-primary);
    font-size: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    outline: none;
}
.text-input:focus, .text-input.focused {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0,180,216,0.2);
    transform: none;
}

/* === Buttons === */
.btn {
    padding: 14px 36px;
    border-radius: var(--radius-sm);
    font-size: 18px; font-weight: 600;
    border: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 10px;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-secondary { background: #333; color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn:focus, .btn.focused {
    box-shadow: var(--focus-glow);
}

/* === Purchase Screen === */
.purchase-content {
    display: flex; flex-direction: column;
    align-items: center; padding-top: 80px;
}
.pricing-cards {
    display: flex; gap: 30px;
    margin: 40px 0;
}
.pricing-card {
    width: 300px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
}
.pricing-card .price {
    font-size: 42px; font-weight: 800;
    color: var(--accent);
}
.pricing-card .period {
    font-size: 18px; color: var(--text-secondary);
    margin-bottom: 10px;
}
.pricing-card:focus, .pricing-card.focused {
    border-color: var(--accent);
    transform: scale(1.05);
}
.qr-box {
    width: 200px; height: 200px;
    background: #fff; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin: 20px auto;
}

/* === Home Screen === */
.home-content {
    padding: 80px 0 0 0;
    overflow-y: auto;
    height: 100vh;
}
.carousel-section {
    padding: 0 40px;
    margin-bottom: 30px;
}
.carousel-title {
    font-size: 22px; font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.carousel-row {
    display: flex; gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-behavior: smooth;
}

/* === Content Cards === */
.content-card {
    flex-shrink: 0;
    width: 185px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
}
.content-card img {
    width: 100%; height: 260px;
    object-fit: cover;
    background: #222;
}
.content-card .card-info {
    padding: 10px 12px;
}
.content-card .card-title {
    font-size: 14px; font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.content-card .card-meta {
    font-size: 12px; color: var(--text-muted);
    margin-top: 2px;
}
.content-card:focus, .content-card.focused {
    border-color: var(--accent);
}
.content-card.landscape {
    width: 300px;
}
.content-card.landscape img {
    height: 170px;
}

/* Channel Card */
.channel-card {
    flex-shrink: 0;
    width: 200px; height: 150px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid transparent;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 12px; gap: 8px; cursor: pointer;
}
.channel-card img {
    width: 80px; height: 60px;
    object-fit: contain;
}
.channel-card .ch-name {
    font-size: 13px; font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    width: 100%;
}
.channel-card .ch-epg {
    font-size: 11px; color: var(--accent);
    text-align: center;
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    width: 100%;
}
.channel-card:focus, .channel-card.focused {
    border-color: var(--accent);
}

/* === Live TV / Category Sidebar === */
.sidebar {
    position: absolute; left: 0; top: 64px; bottom: 0;
    width: 280px;
    background: var(--bg-sidebar);
    overflow-y: auto;
    border-right: 1px solid var(--border);
    z-index: 50;
}
.category-item {
    padding: 14px 20px;
    font-size: 16px;
    color: var(--text-secondary);
    border-left: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.category-item:focus, .category-item.focused {
    color: var(--accent);
    border-left-color: var(--accent);
    background: rgba(0,180,216,0.1);
    box-shadow: none; transform: none;
}
.category-item.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--bg-card);
}
.main-content {
    margin-left: 280px;
    padding: 80px 30px 30px;
    overflow-y: auto;
    height: 100vh;
}
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.grid-container.channels {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* === Movie/Series Detail === */
.detail-content {
    display: flex;
    padding: 80px 60px 40px;
    gap: 40px;
}
.detail-poster {
    flex-shrink: 0;
    width: 300px; height: 450px;
    border-radius: var(--radius);
    object-fit: cover;
    background: #222;
}
.detail-info { flex: 1; }
.detail-title {
    font-size: 32px; font-weight: 700;
    margin-bottom: 10px;
}
.detail-meta {
    font-size: 16px; color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex; gap: 20px;
}
.detail-plot {
    font-size: 16px; color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}
.detail-actions {
    display: flex; gap: 16px; margin-top: 20px;
}

/* === Player === */
.player-screen { background: #000; }
.player-screen video {
    width: 100%; height: 100%;
    object-fit: contain;
}
#playerBuffering {
    position: fixed; inset: 0;
    display: none;
    align-items: center; justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 200;
}
#channelStrip {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.95));
    padding: 30px 40px 20px;
    display: flex; align-items: center; gap: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 150;
}
#channelStrip img {
    width: 80px; height: 55px;
    object-fit: contain;
    border-radius: 6px;
    background: #222;
}
#channelStrip .strip-name {
    font-size: 24px; font-weight: 700;
}
#channelStrip .strip-epg {
    font-size: 14px; color: var(--accent);
}
#channelStrip .strip-num {
    font-size: 36px; font-weight: 800;
    color: var(--accent);
    min-width: 60px;
}
.player-controls {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 20px 40px;
    z-index: 160;
}
.progress-bar {
    width: 100%; height: 6px;
    background: #333; border-radius: 3px;
    margin-bottom: 10px; overflow: hidden;
}
.progress-bar .fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}

/* === Search / On-screen Keyboard === */
.search-content { padding: 80px 60px; }
.search-display {
    font-size: 32px;
    background: var(--bg-input);
    padding: 16px 30px;
    border-radius: var(--radius-sm);
    margin-bottom: 30px;
    min-height: 60px;
    border: 2px solid var(--border);
    color: var(--text-primary);
}
.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    max-width: 700px;
    margin-bottom: 30px;
}
.key-btn {
    width: 62px; height: 62px;
    background: #222;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 24px; font-weight: 600;
    color: var(--text-primary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.key-btn.wide { grid-column: span 2; width: auto; font-size: 16px; }
.key-btn:focus, .key-btn.focused {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* === Settings === */
.settings-content {
    padding: 80px 60px;
    max-width: 900px;
}
.setting-item {
    padding: 20px 30px;
    font-size: 19px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between;
    align-items: center; cursor: pointer;
}
.setting-item:focus, .setting-item.focused {
    background: var(--bg-card);
    box-shadow: none; transform: none;
}
.setting-item .setting-value {
    color: var(--text-muted);
    font-size: 16px;
}

/* === Ad Overlays === */
.ad-overlay {
    position: fixed; inset: 0;
    z-index: 1000;
    background: #000;
    display: flex; align-items: center; justify-content: center;
}
.ad-overlay img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
}
.ad-countdown {
    position: absolute; top: 20px; right: 20px;
    background: rgba(0,0,0,0.8);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px; color: #fff;
}
.ad-badge {
    position: absolute; top: 20px; left: 20px;
    background: var(--warning);
    color: #000; font-size: 12px; font-weight: 700;
    padding: 4px 10px; border-radius: 4px;
}
.ad-skip {
    position: absolute; bottom: 30px; right: 30px;
    background: rgba(255,255,255,0.9);
    color: #000; font-size: 16px; font-weight: 600;
    padding: 12px 24px; border-radius: var(--radius-sm);
    cursor: pointer; display: none;
}
.ad-skip.visible { display: block; }
.ad-skip:focus, .ad-skip.focused {
    background: var(--accent); color: #000;
}
.home-ad-banner {
    margin: 0 40px 20px;
    height: 100px;
    border-radius: var(--radius);
    overflow: hidden;
}
.home-ad-banner img {
    width: 100%; height: 100%;
    object-fit: cover;
}

/* === EPG === */
.epg-content { padding: 80px 20px 20px; }
.epg-grid {
    display: grid;
    overflow: auto;
}
.epg-channel {
    display: flex; align-items: center;
    padding: 8px 12px; gap: 10px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    min-width: 200px;
}
.epg-program {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    overflow: hidden; white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.epg-program.now { background: rgba(0,180,216,0.2); border-color: var(--accent); }

/* === Badges === */
.badge {
    font-size: 11px; padding: 2px 8px;
    border-radius: 10px; font-weight: 700;
    display: inline-block;
}
.badge-live { background: var(--danger); color: #fff; }
.badge-hd { background: var(--warning); color: #000; }
.badge-new { background: var(--success); color: #fff; }

/* === Rating Stars === */
.stars { color: var(--warning); font-size: 14px; }

/* === Dialog/Modal === */
.dialog-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
}
.dialog {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px 40px;
    max-width: 500px; width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.dialog h3 { margin-bottom: 16px; font-size: 22px; }
.dialog p { color: var(--text-secondary); margin-bottom: 20px; }
.dialog-buttons { display: flex; gap: 12px; justify-content: flex-end; }

/* === Toast === */
.toast {
    position: fixed; top: 30px; right: 30px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 16px; font-weight: 600;
    z-index: 3000;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s;
    animation-fill-mode: forwards;
}
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--info); color: #fff; }

/* === Loading Overlay === */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(10,10,26,0.9);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 20px;
    z-index: 1500;
}
.loading-overlay .loading-text {
    font-size: 18px; color: var(--text-secondary);
}

/* === Favorites === */
.favorites-tabs {
    display: flex; gap: 10px;
    padding: 80px 40px 20px;
}
.fav-tab {
    padding: 10px 24px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 16px;
    border: 2px solid transparent;
    cursor: pointer;
}
.fav-tab.active, .fav-tab:focus, .fav-tab.focused {
    border-color: var(--accent);
    color: var(--accent);
}

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideInRight { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* === Trial Banner === */
.trial-banner {
    position: fixed; top: 64px; left: 0; right: 0;
    background: linear-gradient(90deg, var(--warning), #ff9800);
    color: #000; text-align: center;
    padding: 8px 20px; font-size: 14px; font-weight: 600;
    z-index: 99;
}
.trial-banner a, .trial-banner span.link {
    color: #000; text-decoration: underline; cursor: pointer;
}

/* === Empty State === */
.empty-state {
    text-align: center; padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 60px; margin-bottom: 20px; }
.empty-state p { font-size: 18px; }
