/* ==========================================================================
   PREMIUM LIVE TV PLAYER - STYLING SYSTEM
   ========================================================================== */

:root {
    --primary: #F97316;
    --primary-rgb: 249, 115, 22;
    --bg: #ffffff;
    --surface: #ffffff;
    --card: #ffffff;
    --card-hover: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: rgba(0, 0, 0, 0.08);
    --glass: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.06);
    --live: #f43f5e;
    --success: #10b981;
    --g1: linear-gradient(135deg, var(--primary) 0%, #f97316 50%, #fbbf24 100%);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #ffffff;
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Header */
header {
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.brand {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--g1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.brand span {
    background: var(--g1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    color: var(--live);
    letter-spacing: 0.5px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.search-area {
    flex: 0.35;
    position: relative;
    max-width: 360px;
}

.search-area input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: var(--transition-normal);
}

.search-area input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.search-area svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: var(--transition-normal);
}

.search-area input:focus + svg {
    color: var(--primary);
}

.source-selector-wrap {
    display: flex;
    align-items: center;
}

.source-select {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: var(--transition-normal);
    max-width: 220px;
}

.source-select:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.source-select option {
    background: var(--surface);
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normal);
}

.icon-btn:hover {
    background: rgba(249, 115, 22, 0.08);
    border-color: var(--primary);
    color: var(--text);
    transform: translateY(-1px);
}

/* Son Dakika Haberleri Widget */
.news-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 6px;
}

.news-item {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.015);
    border-left: 2px solid var(--primary);
    border-radius: 4px;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition-fast);
    border-top: 1px solid rgba(255,255,255,0.01);
}

.news-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-left-width: 4px;
    color: white;
}

.news-time {
    display: block;
    font-size: 9px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* TV Remote Control Widget */
.remote-widget-card {
    padding: 12px !important;
}

.tv-remote {
    background: linear-gradient(180deg, #131722 0%, #0a0c10 100%);
    border: 2px solid #222938;
    border-radius: 26px;
    padding: 16px 12px;
    width: 210px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow-md);
    margin: 8px 0;
}

.remote-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.remote-brand {
    font-size: 8.5px;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.remote-btn {
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}

.remote-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-power {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dc2626;
    color: white;
    font-size: 11px;
}

.btn-power:hover {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.btn-mute {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #475569;
    color: white;
    font-size: 11px;
}

.btn-mute:hover {
    background: #64748b;
}

.remote-numbers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    justify-items: center;
    background: rgba(0,0,0,0.2);
    padding: 10px 8px;
    border-radius: var(--radius-md);
}

.num-btn {
    width: 38px;
    height: 30px;
    border-radius: 8px;
    background: #1c2230;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.num-btn:hover {
    background: #242c3d;
    color: var(--primary);
}

.btn-back-ch, .btn-next-ch {
    background: #151924;
    font-size: 9px;
}

/* Volume and Channel control pad */
.pad-controls {
    justify-content: space-around;
    background: rgba(0,0,0,0.2);
    padding: 8px 6px;
    border-radius: var(--radius-md);
}

.remote-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pad-btn {
    width: 36px;
    height: 32px;
    border-radius: 8px;
    background: #1c2230;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
}

.pad-btn:hover {
    background: #242c3d;
    color: var(--primary);
}

.pad-label {
    font-size: 8px;
    font-weight: 800;
    color: var(--text-secondary);
    opacity: 0.8;
}

.select-pad {
    justify-content: center;
}

.select-ok {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--g1);
    color: white;
    font-weight: 800;
    font-size: 11px;
    border: none;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

.select-ok:hover {
    transform: scale(1.05);
}

/* Colored buttons row */
.color-buttons {
    padding: 0 4px;
}

.remote-color-btn {
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 8px;
    font-weight: 800;
    width: 36px;
    height: 16px;
    border-radius: 8px;
    color: rgba(255,255,255,0.9);
    transition: var(--transition-fast);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 4px rgba(0,0,0,0.3);
}

.remote-color-btn:active {
    transform: translateY(1px);
}

.c-red { background: #ef4444; }
.c-red:hover { background: #f87171; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }

.c-green { background: #10b981; }
.c-green:hover { background: #34d399; box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }

.c-blue { background: #3b82f6; }
.c-blue:hover { background: #60a5fa; box-shadow: 0 0 6px rgba(59, 130, 246, 0.4); }

.c-yellow { background: #f59e0b; }
.c-yellow:hover { background: #fbbf24; box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }

.remote-indicator {
    transition: var(--transition-fast);
}

/* Favori Kanallar Left List */
.fav-channels-left-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}


/* Main Layout */
main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar Categories */
.sidebar-categories {
    width: 220px;
    background: var(--bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-section-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 10px 0 6px;
    padding-left: 8px;
}

.category-pill {
    background: transparent;
    border: 1px solid transparent;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition-normal);
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-pill:hover {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
}

.category-pill.active {
    background: var(--glass);
    color: var(--primary);
    border-color: rgba(249, 115, 22, 0.15);
    box-shadow: var(--shadow-sm);
}

.category-pill span {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
}

.category-pill.active span {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
}

/* Collapsible Group Headers & Sub-categories */
.cat-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    background: var(--glass);
    border: 1px solid var(--border);
    margin-top: 4px;
    transition: var(--transition-fast);
}

.cat-group-header:hover {
    background: var(--card-hover);
    border-color: var(--primary);
}

.cat-group-header.open {
    border-color: rgba(249, 115, 22, 0.3);
    background: rgba(249, 115, 22, 0.05);
}

.cat-group-count {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
    margin-right: 8px;
}

.cat-group-arrow {
    font-size: 10px;
    color: var(--text-muted);
}

.cat-group-body {
    padding-left: 10px;
    margin-top: 4px;
    border-left: 2px solid var(--border);
}

.category-pill.cat-sub {
    padding: 8px 12px;
    font-size: 12px;
    opacity: 0.9;
}

/* Channel Grid */
.channel-grid {
    width: 330px; /* Slightly wider sidebar for improved readability */
    background: var(--surface);
    overflow-y: auto;
    padding: 16px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 8px;
    border-bottom: 1px solid var(--border);
}

.grid-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
}

.grid-header .count {
    font-size: 11px;
    color: var(--primary);
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.15);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
}

.channels-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.channel-card {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.channel-card:hover {
    border-color: var(--primary);
    background: #f8fafc;
    transform: translateY(-2px) translateZ(0);
    box-shadow: var(--shadow-md);
}

.channel-card.active {
    background: rgba(249, 115, 22, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.15);
}

/* Accent indicator for active channel card */
.channel-card.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

/* Sequential Rank Index Badge on Card */
.ch-index-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 9px;
    font-weight: 800;
    color: var(--text-secondary);
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: monospace, sans-serif;
    letter-spacing: 0.5px;
}

.channel-card.active .ch-index-badge {
    opacity: 0.9;
    color: var(--primary);
    border-color: rgba(249, 115, 22, 0.3);
    background: rgba(249, 115, 22, 0.1);
}

/* Last Online Uptime Status styles */
.ch-status-online {
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    margin-bottom: 2px;
}

.ch-status-online.online-now {
    color: #10b981; /* Emerald green for instant active */
}

.ch-status-online.online-recent {
    color: #06b6d4; /* Cyan/blue for recent validation */
    opacity: 0.85;
}

.ch-status-online .status-dot {
    font-size: 7px;
    line-height: 1;
    animation: chDotPulse 2s ease-in-out infinite;
}

@keyframes chDotPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.ch-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ch-name {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-group {
    font-size: 9.5px;
    color: var(--text-secondary);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.ch-logo-container {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.ch-logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ch-logo-fallback {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: var(--g1);
    color: white;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.fav-btn {
    font-size: 15px;
    cursor: pointer;
    opacity: 0.3;
    transition: var(--transition-normal);
    background: none;
    border: none;
    color: #fbbf24;
    padding: 6px;
    z-index: 2;
    border-radius: var(--radius-sm);
}

.channel-card:hover .fav-btn {
    opacity: 0.7;
}

.fav-btn:hover {
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.03);
}

.fav-btn.active {
    opacity: 1 !important;
    transform: scale(1.05);
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.4));
}

/* Player Viewport */
.player-viewport {
    flex: 1;
    background: #020205;
    display: flex;
    flex-direction: column;
}

.video-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle, #0e1322 0%, #020205 100%);
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}

/* Equalizer Visualizer */
.viz-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    padding: 0 40px;
    z-index: 2;
    pointer-events: none;
    opacity: 0.25;
    transition: var(--transition-normal);
}

.video-container.playing .viz-overlay {
    opacity: 0.45;
}

.viz-bar {
    width: 3px;
    background: var(--g1);
    border-radius: 2px 2px 0 0;
    animation: eq 1s ease-in-out infinite;
    transform-origin: bottom;
    height: 4px;
}

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 5;
    background: rgba(6, 8, 20, 0.85);
    backdrop-filter: blur(8px);
}

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(249, 115, 22, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

/* Custom Player Control Overlay */
.player-overlay-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, rgba(2, 2, 5, 0.95) 0%, rgba(2, 2, 5, 0.8) 40%, rgba(2, 2, 5, 0) 100%);
    padding: 40px 24px 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-normal);
}

.video-container:hover .player-overlay-controls,
.video-container.controls-active .player-overlay-controls {
    opacity: 1;
    transform: translateY(0);
}

.player-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: var(--transition-fast);
}

.player-progress-bar:hover {
    height: 6px;
}

.player-progress-fill {
    height: 100%;
    background: var(--g1);
    border-radius: 2px;
    width: 0;
    position: relative;
}

.player-progress-handle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary);
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.1s ease;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

.player-progress-bar:hover .player-progress-handle {
    transform: translateY(-50%) scale(1);
}

.player-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ctrl-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.ctrl-btn-play {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--g1);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.ctrl-btn-play:hover {
    transform: scale(1.06);
    background: var(--g1);
    color: white;
}

.volume-control-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    accent-color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
    border: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-runnable-track {
    height: 4px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    margin-top: -3px;
}

/* Now Playing Info Bar */
.player-bar {
    padding: 16px 24px;
    background: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
}

.now-playing-info h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.now-playing-info h4 .live-tag {
    font-size: 9px;
    font-weight: 800;
    background: var(--live);
    color: white;
    padding: 2px 8px;
    border-radius: 5px;
    letter-spacing: 0.5px;
}

.now-playing-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.player-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--g1);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.35);
}

.btn-outline {
    background: var(--glass);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(249, 115, 22, 0.3);
    color: var(--text);
}

.btn-rec {
    background: rgba(244, 63, 94, 0.12);
    color: var(--live);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.btn-rec:hover {
    background: rgba(244, 63, 94, 0.2);
}

.btn-rec.recording {
    background: var(--live);
    color: white;
    animation: pulse 1.5s infinite;
}

/* Right Sidebar (Widgets) */
.right-sidebar {
    width: 280px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.widget-card {
    background: var(--card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.widget-title .widget-action-link {
    font-size: 10px;
    color: var(--primary);
    text-transform: none;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    cursor: pointer;
    transition: var(--transition-normal);
}

.top-item:last-child {
    border-bottom: none;
}

.top-item:hover {
    padding-left: 4px;
}

.top-rank {
    width: 20px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
}

.top-rank.gold { color: #f59e0b; }
.top-rank.silver { color: #94a3b8; }
.top-rank.bronze { color: #b45309; }

.top-logo-wrap {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    overflow: hidden;
}

.top-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

.top-info h4 {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.top-info span {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Favorites Widget Custom Lists */
.fav-channel-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: var(--transition-normal);
}

.fav-channel-mini:last-child {
    border-bottom: none;
}

.fav-channel-mini:hover {
    padding-left: 4px;
}

.fav-mini-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    border: 1px solid rgba(249, 115, 22, 0.2);
    overflow: hidden;
}

.fav-mini-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fav-mini-info {
    flex: 1;
    min-width: 0;
}

.fav-mini-info h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-mini-info span {
    font-size: 10px;
    color: var(--text-secondary);
}

.fav-mini-play {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.2);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-normal);
}

.fav-channel-mini:hover .fav-mini-play {
    opacity: 1;
}

.fav-mini-play:hover {
    background: var(--g1);
    color: white;
    border-color: transparent;
}

.no-fav-msg {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

/* Toast Alerts */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: rgba(18, 24, 41, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(-20px);
    transition: var(--transition-normal);
    pointer-events: none;
    box-shadow: var(--shadow-lg);
}

.toast.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
}

.toast-icon.warning {
    background: rgba(244, 63, 94, 0.1);
    color: var(--live);
}

.toast-text {
    font-size: 13.5px;
    font-weight: 600;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 2, 5, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 460px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: var(--transition-normal);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 800;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 22px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.modal-close:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    transition: var(--transition-normal);
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    border-color: var(--primary);
}

.form-group .input-file-btn {
    width: 100%;
    background: var(--glass);
    border: 1px dashed var(--border);
    padding: 16px;
    text-align: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition-normal);
}

.form-group .input-file-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.theme-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.theme-opt-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
}

.theme-opt-btn:hover {
    transform: scale(1.1);
}

.theme-opt-btn.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    font-size: 12px;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(13, 17, 29, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 8px 0 16px;
    z-index: 1000;
    justify-content: space-around;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 16px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    transition: var(--transition-normal);
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item svg {
    margin-bottom: 2px;
}

/* Floating Mini-Player Widget */
.floating-mini-player {
    position: fixed;
    bottom: 86px;
    right: 24px;
    width: 320px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    z-index: 1200;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-mini-player.active {
    display: flex;
}

.mp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
}

.mp-header h4 {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mp-live-dot {
    width: 6px;
    height: 6px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.mp-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition-normal);
}

.mp-close:hover {
    color: var(--live);
}

.mp-video-wrap {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

.mp-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.mp-btn {
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normal);
}

.mp-btn:hover {
    background: rgba(249, 115, 22, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.mp-btn.mp-play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--g1);
    border: none;
    color: white;
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.2);
}

.mp-info {
    padding: 8px 16px;
    font-size: 11.5px;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--card);
}

/* ==========================================================================
   RESPONSIVE LAYOUT
   ========================================================================== */

@media (max-width: 1200px) {
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 1024px) {
    main {
        flex-direction: column;
    }
    
    .sidebar-categories {
        width: 100%;
        height: 58px;
        flex-direction: row;
        padding: 8px 16px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
        gap: 8px;
        white-space: nowrap;
    }
    
    .cat-section-title {
        display: none;
    }
    
    .category-pill {
        margin-bottom: 0;
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .channel-grid {
        width: 100%;
        height: 35%;
        order: 2;
        border-right: none;
        border-top: 1px solid var(--border);
    }
    
    .channels-list-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 10px;
    }
    
    .channel-card {
        margin-bottom: 0;
    }
    
    .player-viewport {
        height: 65%;
    }
    
    .search-area {
        display: none;
    }
    
    .source-select {
        max-width: 170px;
        padding: 9px 12px;
        font-size: 12px;
    }
    
    .floating-mini-player {
        bottom: 86px;
        right: 16px;
    }
}

@media (max-width: 640px) {
    header {
        padding: 0 16px;
        height: 56px;
    }
    
    .source-select {
        max-width: 120px;
        padding: 7px 10px;
        font-size: 11px;
    }
    
    .brand {
        font-size: 18px;
    }
    
    .brand-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .live-badge {
        display: none;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .player-viewport {
        height: 50%;
    }
    
    .channel-grid {
        height: calc(50% - 58px - 66px); /* minus categories and bottom nav */
        order: 2;
        padding-bottom: 24px;
    }
    
    .channels-list-container {
        grid-template-columns: 1fr;
    }
    
    .player-bar {
        padding: 12px 16px;
    }
    
    .player-overlay-controls {
        padding: 24px 16px 12px;
    }
    
    .now-playing-info h4 {
        font-size: 14px;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 11.5px;
    }
    
    .floating-mini-player {
        bottom: 86px;
        left: 16px;
        right: 16px;
        width: auto;
    }
}

/* Brand Total Channel Count Badge */
.brand-count-badge {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 8px;
    font-weight: 700;
    vertical-align: middle;
    display: inline-block;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Apple TV Remote Control layout styles */
.apple-remote {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 40%, #cbd5e1 100%);
    border: 2px solid #cbd5e1;
    border-radius: 28px;
    padding: 20px 14px;
    width: 210px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.9), 0 10px 25px rgba(0,0,0,0.3);
    margin: 8px 0;
    color: #1e293b;
}

.remote-clickpad {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #1e293b;
    margin: 0 auto;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.6), 0 2px 4px rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clickpad-btn {
    position: absolute;
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.clickpad-btn:hover {
    color: white;
}

.pad-up { top: 4px; left: 39px; }
.pad-down { bottom: 4px; left: 39px; }
.pad-left { left: 4px; top: 39px; }
.pad-right { right: 4px; top: 39px; }

.clickpad-ok {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
    z-index: 10;
}

.clickpad-ok:active {
    transform: scale(0.95);
}

.remote-grid-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 14px;
    justify-items: center;
    width: 100%;
    padding: 0 6px;
}

.apple-remote .remote-btn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-round {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #1e293b;
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.btn-round:hover {
    background: #334155;
}

.btn-action {
    width: 68px;
    height: 28px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.btn-action:hover {
    background: #cbd5e1;
}

.apple-remote .btn-power {
    background: #dc2626;
    color: white;
}

.apple-remote .btn-power:hover {
    background: #ef4444;
}

.apple-remote .btn-mute {
    background: #475569;
    color: white;
    border-radius: 12px;
    width: 100%;
    height: 28px;
    font-size: 11px;
    font-weight: 700;
}

.apple-remote .btn-mute:hover {
    background: #64748b;
}

