/* Design System & Variables */
:root {
    --bg-base: #070a13;
    --bg-surface: rgba(30, 41, 59, 0.45);
    --bg-surface-hover: rgba(30, 41, 59, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #0ea5e9;
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #22c55e 100%);
    --status-online: #22c55e;
    --status-offline: #ef4444;
    --status-pending: #f59e0b;
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Background Lights */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(34, 197, 94, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

/* App Container Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-gradient);
    box-shadow: 0 0 12px var(--accent-color);
}

.app-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--status-pending);
    box-shadow: 0 0 8px var(--status-pending);
    display: inline-block;
}

.status-badge.online .status-indicator-dot {
    background-color: var(--status-online);
    box-shadow: 0 0 8px var(--status-online);
    animation: pulse 1.8s infinite;
}

.status-badge.offline .status-indicator-dot {
    background-color: var(--status-offline);
    box-shadow: 0 0 8px var(--status-offline);
}

.status-badge.pending .status-indicator-dot {
    background-color: var(--status-pending);
    box-shadow: 0 0 8px var(--status-pending);
    animation: pulse 1.2s infinite;
}

/* Main Content Grid */
.app-main {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 900px) {
    .app-main {
        grid-template-columns: 1.6fr 1fr;
    }
}

/* Video Player Styling */
.player-section {
    width: 100%;
}

.player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #000;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.player-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Controls Overlay */
.player-controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 20%, transparent 80%, rgba(0, 0, 0, 0.6) 100%);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 10;
}

.player-wrapper:hover .player-controls-overlay {
    opacity: 1;
}

.controls-top {
    display: flex;
    justify-content: flex-start;
}

.live-tag {
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.live-tag::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
    animation: pulse 1s infinite;
}

.controls-bottom {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    backdrop-filter: blur(4px);
}

.control-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.control-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.spacer {
    flex-grow: 1;
}

/* Loading / Error Overlay */
.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 10, 19, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 15;
    transition: var(--transition-smooth);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(14, 165, 233, 0.15);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

.overlay-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.action-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
    transition: var(--transition-smooth);
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}

/* Info Cards & Embedding Section */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.info-card h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.info-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

/* Stream Metadata Grid */
.stream-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Embed Code Box */
.embed-code-box {
    position: relative;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-family: monospace;
}

.embed-code-box code {
    font-size: 0.8rem;
    color: #e2e8f0;
    word-break: break-all;
    overflow-x: auto;
    white-space: pre-wrap;
    flex-grow: 1;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Footer Styling */
.app-footer {
    margin-top: auto;
    padding-top: 3rem;
    padding-bottom: 1rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

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

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* Header Links above Video */
.player-header-link {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.player-header-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.player-header-link a:hover {
    color: #38bdf8;
    transform: translateX(2px);
}

.embed-header-link {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;
}

.embed-header-link a {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 9999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.embed-header-link a:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

