/**
 * StreamHub - Diseño Minimalista Tipo Twitch
 * Edmil Jampier Saire Bustamante - 174449
 */

:root {
    --bg-primary: #0e0e10;
    --bg-secondary: #18181b;
    --bg-tertiary: #1f1f23;
    --bg-hover: #26262c;

    --text-primary: #efeff1;
    --text-secondary: #adadb8;
    --text-muted: #53535f;

    --accent: #9147ff;
    --accent-hover: #772ce8;
    --live: #e91916;
    --success: #00f593;

    --border: #2e2e35;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 2000px;
    margin: 0 auto;
    padding: 0 20px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo svg {
    color: var(--accent);
}

.stream-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 12px;
    color: var(--text-primary);
    font-size: 14px;
    width: 200px;
    transition: all 0.2s;
}

.stream-input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-connect {
    background: var(--accent);
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-connect:hover {
    background: var(--accent-hover);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.3s;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* Main Layout */
.main {
    max-width: 2000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 0;
    min-height: calc(100vh - 50px - 60px);
}

/* Player Section */
.player-section {
    background: var(--bg-primary);
    padding: 20px;
}

.player-wrapper {
    position: relative;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.player-overlay-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-badge.active .live-dot {
    background: var(--live);
    box-shadow: 0 0 10px var(--live);
}

.live-badge.active .live-text {
    color: var(--live);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: pulse 2s ease-in-out infinite;
}

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

.viewer-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

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

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.9);
    z-index: 5;
}

.video-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
}

.overlay-content svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.overlay-content h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

/* Stream Info */
.stream-info {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.stream-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

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

.separator {
    color: var(--text-muted);
}

.info-right {
    display: flex;
    gap: 8px;
}

.stat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    min-width: 70px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

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

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    transition: background 0.2s;
}

.stat-item:hover {
    background: var(--bg-hover);
}

.stat-icon {
    font-size: 20px;
}

.stat-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-name {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.config-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.config-value {
    background: var(--bg-tertiary);
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--accent);
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 16px 20px;
}

.footer-content {
    max-width: 2000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.footer-student {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-student strong {
    color: var(--text-primary);
}

.tech-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tech {
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 300px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    .main {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .info-right {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .header-center {
        flex: 1;
    }

    .stream-input {
        width: 100%;
    }

    .stream-info {
        flex-direction: column;
    }

    .info-right {
        width: 100%;
        justify-content: space-between;
    }

    .stat-chip {
        flex: 1;
    }
}
