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

:root {
    --bg-primary: #0d0b14;
    --bg-card: rgba(255,255,255,0.06);
    --bg-card-hover: rgba(255,255,255,0.10);
    --bg-nav: rgba(30,24,54,0.85);
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.55);
    --accent-purple: #6c3ea6;
    --live-red: #e53e3e;
    --radius-sm: 8px;
    --radius-md: 14px;
    --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior:smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(108,62,166,0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(155,58,142,0.08) 0%, transparent 50%);
    background-attachment: fixed;
}

a { text-decoration:none; color:inherit; }

/* Nav */
.navbar {
    position: fixed;
    top:0; left:0; right:0;
    z-index: 1000;
    padding: 16px 0;
    display: flex;
    justify-content: center;
    transition: padding 0.3s ease;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50px;
    padding: 10px 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.nav-logo { display:flex; align-items:center; margin-right:8px; }
.logo-img { height:32px; width:auto; filter:brightness(1.1); }
.nav-links { display:flex; list-style:none; gap:4px; }
.nav-links a {
    padding:8px 18px; border-radius:50px; font-size:14px; font-weight:500;
    color:var(--text-secondary); transition:var(--transition);
}
.nav-links a:hover { color:var(--text-primary); background:rgba(255,255,255,0.08); }

/* Player */
.player-main {
    padding-top: 90px;
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 40px;
}

.player-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.player-container iframe {
    position: absolute;
    top:0; left:0;
    width:100%; height:100%;
    border: none;
}

/* ===== FEED SELECTOR ===== */
.feed-selector-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(108,62,166,0.12) 0%, rgba(155,58,142,0.06) 100%);
    border: 1px solid rgba(108,62,166,0.2);
    border-radius: var(--radius-md);
    margin-top: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.feed-selector-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.feed-selector-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.feed-count-badge {
    font-size: 11px;
    font-weight: 600;
    color: #c084fc;
    background: rgba(108,62,166,0.2);
    padding: 4px 10px;
    border-radius: 50px;
    border: 1px solid rgba(108,62,166,0.25);
    white-space: nowrap;
}

.feed-selector-right {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

/* Dropdown (mobile) */
.feed-dropdown-wrapper {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.feed-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    background: rgba(0,0,0,0.4);
    color: var(--text-primary);
    border: 1px solid rgba(108,62,166,0.4);
    border-radius: 50px;
    padding: 10px 40px 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c084fc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.feed-dropdown:hover {
    background-color: rgba(108,62,166,0.15);
    border-color: rgba(108,62,166,0.7);
}

.feed-dropdown:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(108,62,166,0.25);
}

.feed-dropdown option {
    background: #1a1726;
    color: #fff;
    padding: 8px;
}

/* Pills (desktop) */
.feed-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.feed-pill {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.feed-pill:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.feed-pill.active {
    background: linear-gradient(135deg, #6c3ea6, #9b3a8e);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(108,62,166,0.4);
}

.feed-pill.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(108,62,166,0.5);
}

.active-feed-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #c084fc;
    background: rgba(108,62,166,0.15);
    padding: 3px 10px;
    border-radius: 50px;
    border: 1px solid rgba(108,62,166,0.25);
}

/* Responsive: mobile shows dropdown, desktop shows pills */
@media (max-width: 700px) {
    .feed-selector-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .feed-selector-left {
        justify-content: space-between;
    }
    .feed-selector-right {
        display: none;
    }
    .feed-dropdown-wrapper {
        max-width: 100%;
    }
}

@media (min-width: 701px) {
    .feed-dropdown-wrapper {
        display: none;
    }
    .feed-selector-left .feed-count-badge {
        display: none;
    }
}

/* Stream Info */
.stream-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    gap: 16px;
    flex-wrap: wrap;
}

.stream-info-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.stream-thumb {
    width: 56px; height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.stream-meta { min-width:0; }

.stream-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stream-details {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.stream-live-badge {
    color: var(--live-red);
    font-size: 13px;
    font-weight: 700;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity:1; }
    50% { opacity:0.5; }
}

.stream-subtitle { font-size:14px; color:var(--text-secondary); }

.stream-category {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(108,62,166,0.2);
    color: #c084fc;
    border: 1px solid rgba(108,62,166,0.3);
}

.fullscreen-btn {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.fullscreen-btn:hover {
    background: var(--bg-card-hover);
    border-color: rgba(108,62,166,0.4);
}

/* EPG */
.epg-section {
    margin-top: 30px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
}

.epg-section h3 { font-size:18px; font-weight:700; margin-bottom:16px; }
.epg-list { display:flex; flex-direction:column; gap:6px; }

.epg-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.epg-item:hover { background:rgba(255,255,255,0.04); }
.epg-item.current { background:rgba(108,62,166,0.15); border-left:3px solid var(--accent-purple); }

.epg-time {
    font-size:13px; font-weight:600; color:var(--accent-purple);
    min-width:120px; font-variant-numeric:tabular-nums;
}

.epg-info { flex:1; }
.epg-title { font-size:14px; font-weight:600; }
.epg-desc { font-size:12px; color:var(--text-secondary); margin-top:2px; }

/* Related */
.related-section { margin-top:40px; }
.related-section h3 { font-size:20px; font-weight:700; margin-bottom:20px; }

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.related-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.related-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.related-thumb {
    width:100%; height:120px;
    background: linear-gradient(135deg,#333,#555);
    position: relative;
}

.related-live {
    position:absolute; top:8px; left:8px;
    background:var(--live-red); color:#fff;
    font-size:10px; font-weight:700;
    padding:2px 8px; border-radius:4px;
}

.related-info { padding:12px 14px; }
.related-info h4 {
    font-size:14px; font-weight:600; margin-bottom:4px;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.related-info p { font-size:12px; color:var(--text-secondary); }

/* Footer */
.player-footer {
    text-align:center; padding:20px;
    border-top:1px solid rgba(255,255,255,0.06);
}
.player-footer p { font-size:12px; color:rgba(255,255,255,0.3); }

/* Responsive */
@media (max-width: 768px) {
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .stream-title { font-size: 18px; }
    .player-main { padding-top: 80px; }
}

@media (max-width: 700px) {
    .feed-selector-bar { flex-direction: column; align-items: stretch; }
    .feed-selector-right { display: none; }
}

@media (min-width: 701px) {
    .feed-dropdown-wrapper { display: none; }
    .feed-selector-left .feed-count-badge { display: none; }
}

@media (max-width: 480px) {
    .related-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}
