/**
 * StreamEast Pro - Main Stylesheet
 * Optimized for performance
 */

:root {
    --primary: #d32f2f;
    --primary-dark: #b71c1c;
    --primary-light: #ffcdd2;
    --header-start: #c62828;
    --header-end: #d32f2f;
    --bg-dark: #1a1a1a;
    --bg-card: #2d2d2d;
    --bg-light: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-light: #ffffff;
    --border: #e0e0e0;
    --live: #d32f2f;
    --upcoming: #ff9800;
    --shadow: 0 2px 8px rgba(0,0,0,0.15);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.2);
    --radius: 8px;
    --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.5;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--header-start) 0%, var(--header-end) 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.logo-text { color: white; }
.logo-highlight {
    background: white;
    color: var(--primary);
    padding: 0.125rem 0.5rem;
    margin-left: 2px;
    border-radius: 4px;
}

/* Navigation */
.nav { display: flex; align-items: center; }
.nav-list {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}
.nav-link {
    display: block;
    padding: 0.5rem 0.875rem;
    color: rgba(255,255,255,0.9);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius);
    transition: var(--transition);
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.15);
}
.nav-link-featured {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    position: relative;
}
.nav-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--bg-dark);
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    margin-top: 2px;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    cursor: pointer;
    border: none;
}
.menu-line {
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
}
.mobile-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--header-start) 0%, var(--header-end) 100%);
    padding: 1rem;
    z-index: 999;
}
.mobile-nav.active { display: block; }
.mobile-nav-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.mobile-nav-list a {
    display: block;
    padding: 0.75rem 1rem;
    color: white;
    font-weight: 600;
    border-radius: var(--radius);
}
.mobile-nav-list a:hover { background: rgba(255,255,255,0.15); }

/* Hero Section */
.hero {
    background: var(--bg-card);
    padding: 2.5rem 1rem;
    text-align: center;
}
.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
}
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}
.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.25rem;
    font-size: 1rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    background: white;
    transition: var(--transition);
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(211,47,47,0.2);
}
.search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
}

/* Streams Section */
.streams-section { padding: 1.5rem 1rem; }
.container { max-width: 1200px; margin: 0 auto; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}
.section-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Stream Cards */
.streams-list { display: flex; flex-direction: column; gap: 0.5rem; }
.stream-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.stream-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}
.stream-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.stream-category {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
}
.stream-divider { color: var(--primary); font-weight: 700; }
.stream-teams {
    color: var(--text-primary);
    font-weight: 500;
}
.stream-status { flex-shrink: 0; }
.status-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
}
.status-badge.live {
    background: var(--live);
    color: white;
    animation: pulse 2s infinite;
}
.status-badge.upcoming {
    background: #e0e0e0;
    color: var(--text-secondary);
}
.status-badge.ended {
    background: #9e9e9e;
    color: white;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Category Grid */
.categories-section {
    padding: 2rem 1rem;
    background: var(--bg-card);
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}
.category-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
}
.category-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}
.category-icon { font-size: 1.5rem; }
.category-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}
.category-count {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Footer */
.footer {
    background: var(--bg-card);
    padding: 1.5rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-bottom {
    text-align: center;
}
.footer-legal {
    margin-bottom: 1rem;
}
.footer-legal a {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    margin: 0 0.5rem;
}
.footer-legal a:hover { color: white; }
.footer-copy {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
}

/* Watch Page */
.watch-page { padding: 1.5rem 1rem; }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
}
.breadcrumb a { color: rgba(255,255,255,0.8); }
.breadcrumb a:hover { color: white; }

.watch-header { margin-bottom: 1rem; }
.watch-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 50px;
    margin-bottom: 0.5rem;
}
.watch-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}
.watch-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--live);
}
.live-dot {
    width: 8px;
    height: 8px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* Video Player */
.video-container {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.video-wrapper {
    position: relative;
    aspect-ratio: 16/9;
}
.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Stream Sources */
.sources-section { margin-bottom: 1.5rem; }
.sources-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
}
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.source-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    transition: var(--transition);
}
.source-btn:hover {
    background: rgba(255,255,255,0.1);
}
.source-btn.active {
    border-color: var(--primary);
    background: rgba(211,47,47,0.1);
}
.source-name { font-weight: 500; }
.source-quality {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: var(--primary);
    border-radius: 3px;
}

/* Related Streams */
.related-section { margin-top: 2rem; }
.related-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
}

/* Multi Stream */
.multi-page { padding: 1.5rem 1rem; }
.multi-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.multi-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #ff6b6b 0%, var(--primary) 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 50px;
    margin-bottom: 0.5rem;
}
.multi-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}
.multi-subtitle {
    color: rgba(255,255,255,0.6);
}

.multi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.multi-slot {
    aspect-ratio: 16/9;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius);
    overflow: hidden;
}
.multi-slot iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Legal Pages */
.legal-page {
    padding: 2rem 1rem;
    background: white;
    min-height: 60vh;
}
.legal-content {
    max-width: 800px;
    margin: 0 auto;
}
.legal-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.legal-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.legal-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}
.legal-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.legal-content li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    font-weight: 600;
    border-radius: var(--radius);
    transition: var(--transition);
    border: none;
    cursor: pointer;
}
.btn:hover { background: var(--primary-dark); }

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 1024px) {
    .nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .hero-title { font-size: 2rem; }
}

@media (max-width: 768px) {
    .header-container { padding: 0.5rem 0.75rem; }
    .logo { font-size: 1.25rem; }
    .hero { padding: 1.5rem 1rem; }
    .hero-title { font-size: 1.5rem; }
    .stream-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .stream-info { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
    .stream-divider { display: none; }
    .multi-grid { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .watch-title { font-size: 1.25rem; }
    .error-code { font-size: 5rem; }
}

@media (max-width: 480px) {
    .sources-grid { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: 1fr; }
}

/* Print */
@media print {
    .header, .footer, .mobile-nav { display: none !important; }
    body { background: white; color: black; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
