/**
 * JKTV Live - Main Stylesheet
 * Modern, clean design with mobile-first approach
 */

/* =============================================================================
   CSS VARIABLES
   ============================================================================= */
:root {
    --primary-color: #e63946;
    --primary-dark: #c1121f;
    --secondary-color: #1d3557;
    --accent-color: #457b9d;
    --background-dark: #0d1117;
    --background-light: #161b22;
    --card-bg: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --border-color: #30363d;
    --success-color: #238636;
    --warning-color: #d29922;
    --error-color: #f85149;
    --gradient-primary: linear-gradient(135deg, #e63946 0%, #c1121f 100%);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
}

/* =============================================================================
   HEADER & NAVIGATION
   ============================================================================= */
.header {
    background: var(--background-light);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo img {
    height: 40px;
    width: auto;
}

.logo .live-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--text-primary);
    background: var(--card-bg);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--background-light);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu a {
        padding: 1rem;
        text-align: center;
    }
}

/* =============================================================================
   MAIN CONTENT
   ============================================================================= */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* =============================================================================
   HERO / PLAYER SECTION
   ============================================================================= */
.hero {
    position: relative;
    margin-bottom: 2rem;
}

.player-container {
    position: relative;
    width: 100%;
    background: var(--background-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.player-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.player-wrapper video,
.player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.stream-info {
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.stream-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stream-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.viewer-count {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.viewer-count::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* =============================================================================
   CARDS & SECTIONS
   ============================================================================= */
.section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--background-light);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-block {
    width: 100%;
}

/* =============================================================================
   FORMS
   ============================================================================= */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(69, 123, 157, 0.2);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* =============================================================================
   VOD GRID
   ============================================================================= */
.vod-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--card-bg);
    transition: var(--transition);
}

.vod-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.vod-thumbnail {
    position: relative;
    padding-top: 56.25%;
    background: var(--background-light);
}

.vod-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vod-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.vod-info {
    padding: 1rem;
}

.vod-title {
    font-weight: 600;
    margin-bottom: 0.375rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vod-meta {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* =============================================================================
   SUPPORT PAGE
   ============================================================================= */
.support-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.support-card {
    text-align: center;
    padding: 2rem;
}

.support-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* =============================================================================
   FOOTER
   ============================================================================= */
.footer {
    background: var(--background-light);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* =============================================================================
   ALERTS & NOTIFICATIONS
   ============================================================================= */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(35, 134, 54, 0.15);
    border: 1px solid var(--success-color);
    color: #3fb950;
}

.alert-error {
    background: rgba(248, 81, 73, 0.15);
    border: 1px solid var(--error-color);
    color: #f85149;
}

.alert-warning {
    background: rgba(210, 153, 34, 0.15);
    border: 1px solid var(--warning-color);
    color: #d29922;
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

/* =============================================================================
   PAGE HEADER
   ============================================================================= */
.page-header {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* =============================================================================
   WEBVIEW OPTIMIZATIONS
   ============================================================================= */
@media screen and (max-width: 480px) {
    .nav-container {
        height: 56px;
    }

    .logo {
        font-size: 1.25rem;
    }

    .logo img {
        height: 32px;
    }

    main {
        padding: 1rem;
    }

    .page-header {
        padding: 2rem 1rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .card {
        padding: 1rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
    }
}
