/* ==========================================================================
   Apple Design System & Theme CSS
   ========================================================================== */

:root {
    --bg-primary: #000000;
    --bg-secondary: #0b0b0d;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-glass: rgba(22, 22, 24, 0.75);
    
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;
    
    --accent-blue: #0071e3;
    --accent-blue-hover: #0077ed;
    --accent-purple: #bf5af2;
    --accent-cyan: #64d2ff;
    --accent-indigo: #5e5ce6;
    --accent-green: #30d158;

    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(0, 113, 227, 0.5);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 9999px;

    --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-medium: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
    line-height: 1.47059;
    letter-spacing: -0.022em;
}

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

/* Typography Helpers */
.gradient-text {
    background: linear-gradient(135deg, #64d2ff 0%, #0071e3 50%, #bf5af2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    background: rgba(0, 113, 227, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(100, 210, 255, 0.2);
}

.badge-accent {
    background: rgba(191, 90, 242, 0.15);
    color: var(--accent-purple);
    border-color: rgba(191, 90, 242, 0.3);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
    position: relative;
}

.bg-alt {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.mt-8 {
    margin-top: 32px;
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
    transition: background var(--transition-fast);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.apple-logo {
    fill: currentColor;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-item {
    font-size: 13px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
}

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Hero Section */
.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 100px;
    position: relative;
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.25) 0%, rgba(191, 90, 242, 0.15) 40%, rgba(0,0,0,0) 70%);
    filter: blur(80px);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 860px;
}

.hero-title {
    font-size: 64px;
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.03em;
    margin: 20px 0;
}

.hero-subtitle {
    font-size: 21px;
    line-height: 1.38;
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 36px;
    font-weight: 400;
}

.hero-cta-group {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 60px;
}

.hero-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    backdrop-filter: blur(15px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border-subtle);
}

/* Section Header */
.section-header {
    margin-bottom: 48px;
    text-align: center;
}

.section-title {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.section-desc {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
}

/* Video Player Card */
.video-player-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.video-container {
    position: relative;
    width: 100%;
    height: 480px;
    background: #050507;
    overflow: hidden;
}

#canvas-visualizer {
    width: 100%;
    height: 100%;
    display: block;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
}

.stream-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-cyan);
    border: 1px solid rgba(255, 255, 255, 0.15);
    align-self: flex-start;
}

.live-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
}

.stream-info h3 {
    font-size: 24px;
    font-weight: 600;
}

.stream-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Controls */
.player-controls {
    padding: 16px 24px;
    background: rgba(15, 15, 18, 0.9);
    border-top: 1px solid var(--border-subtle);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-bar-buffered {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    width: 65%;
}

.progress-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--accent-blue);
    width: 25%;
}

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

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

.control-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.time-display {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: monospace;
}

.quality-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.quality-selector select {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

/* Media Cards */
.media-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.media-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.active-card {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(0, 113, 227, 0.25);
}

.media-thumb {
    height: 180px;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 12px;
}

.gradient-thumb-1 {
    background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
}

.gradient-thumb-2 {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

.gradient-thumb-3 {
    background: linear-gradient(135deg, #200122 0%, #6f0000 100%);
}

.duration-tag {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.media-content {
    padding: 18px;
}

.media-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.media-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.media-meta {
    font-size: 12px;
    color: var(--accent-blue);
    font-weight: 500;
}

/* Audio Section */
.audio-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    align-items: center;
}

.audio-visualizer-box {
    height: 220px;
    background: #000000;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: flex-center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.audio-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 100%;
    width: 100%;
}

.bar {
    flex: 1;
    background: linear-gradient(180deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    border-radius: 4px;
    height: 20%;
    transition: height 0.1s ease;
}

.audio-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.audio-info h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 8px 0 4px;
}

.audio-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.audio-stats {
    display: flex;
    gap: 24px;
    padding: 16px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.stat-small {
    display: flex;
    flex-direction: column;
}

.stat-small .lbl {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.stat-small .val {
    font-size: 15px;
    font-weight: 600;
    margin-top: 2px;
}

.color-green {
    color: var(--accent-green);
}

.audio-actions {
    display: flex;
    gap: 12px;
}

/* Download Cards */
.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: background var(--transition-fast);
}

.download-card:hover {
    background: var(--bg-card-hover);
}

.download-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: rgba(0, 113, 227, 0.1);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.download-info {
    flex: 1;
}

.download-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.download-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.download-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.file-size {
    color: var(--accent-cyan);
    font-weight: 600;
}

.dl-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.dl-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    transition: width 0.2s ease;
}

/* Telemetry Grid */
.telemetry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.telemetry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
}

.telemetry-card h4 {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.meter-box {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    transition: width 0.5s ease;
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.protocol-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.proto-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
}

.proto-item span {
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background: #000000;
    border-top: 1px solid var(--border-subtle);
    padding: 60px 0 30px;
}

.footer-top {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-bottom: 40px;
}

.footer-col h5 {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col a {
    font-size: 12px;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 24px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-green);
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 900px) {
    .hero-title {
        font-size: 44px;
    }
    .grid-2, .telemetry-grid, .audio-panel {
        grid-template-columns: 1fr;
    }
    .footer-top {
        grid-template-columns: 1fr 1fr;
    }
    .nav-links {
        display: none;
    }
}
