:root {
    --bg: #0a0b0e;
    --panel: #14161a;
    --primary: #0070f3;
    --accent: #00c2ff;
    --text: #ffffff;
    --text-muted: #6b7280;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

/* --- LOGIN --- */
#login-container {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: radial-gradient(circle at center, #1e293b 0%, #000 100%);
    align-items: center;
    justify-content: center;
}

#login-container.active {
    display: flex;
}

.login-card {
    background: var(--panel);
    border: 1px solid #222;
    padding: 40px;
    border-radius: 24px;
    width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.brand {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 5px;
}

.brand span {
    color: var(--primary);
}

.tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 8px;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    background: #000;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 14px;
    color: #fff;
    outline: none;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 112, 243, 0.1);
}

.login-btn {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.login-btn:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.error {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 15px;
    display: none;
}

/* --- APP LAYOUT --- */
#video-container {
    display: none;
    flex-direction: column;
    height: 100vh;
}

#video-container.active {
    display: flex;
}

.main-nav {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1a1a1a;
}

.brand-small {
    font-weight: 800;
    font-size: 1.2rem;
}

.brand-small span {
    color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

#btn-logout {
    background: #1f2937;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.player-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    overflow-y: auto;
}

.video-header {
    text-align: center;
    margin-bottom: 30px;
    max-width: 800px;
}

.video-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.video-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* VIDEO CANVAS (EL REPRODUCTOR) */
.video-canvas {
    width: 100%;
    max-width: 1000px;
}

.video-frame {
    position: relative;
    background: #000;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    border: 1px solid #222;
    border-bottom: none;
    aspect-ratio: 16 / 9;
}

.video-shield {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: default;
}

.iframe-container {
    width: 100%;
    height: 100%;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* PLAYER CONTROLS */
.player-controls {
    background: var(--panel);
    border: 1px solid #222;
    padding: 20px 30px;
    border-radius: 0 0 20px 20px;
    display: flex;
    align-items: center;
    gap: 25px;
}

.main-control {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.75rem;
    cursor: pointer;
    min-width: 85px;
}

.progress-area {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #9ca3af;
    font-size: 0.7rem;
    font-weight: 700;
}

.volume-area {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 150px;
}

.vol-icon {
    font-size: 0.65rem;
    color: #4b5563;
    font-weight: 800;
}

.slider-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
}

/* RANGE STYLING */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
}

input[type=range]:focus {
    outline: none;
}

/* Track */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: #262a33;
    border-radius: 3px;
}

#progress-bar::-webkit-slider-runnable-track {
    background: linear-gradient(to right, var(--primary) var(--p, 0%), #262a33 var(--p, 0%));
}

/* Thumb */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #fff;
    margin-top: -5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary);
}

/* SECURITY ALERT */
#security-warning {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.warning-box {
    text-align: center;
    border: 2px solid var(--error);
    padding: 40px;
    border-radius: 20px;
}

.warning-box h2 {
    color: var(--error);
    font-weight: 800;
    margin-bottom: 10px;
}

@media print {
    body {
        display: none !important;
    }
}

/* --- RESPONSIVIDAD --- */
@media (max-width: 768px) {
    .login-card {
        width: 90%;
        padding: 30px 20px;
    }

    .main-nav {
        padding: 15px 20px;
    }

    .nav-right .user-badge {
        display: none;
    }

    .player-section {
        padding: 20px 10px;
    }

    .video-header h1 {
        font-size: 1.4rem;
    }

    .player-controls {
        flex-wrap: wrap;
        padding: 15px;
        gap: 15px;
        justify-content: center;
    }

    .progress-area {
        order: 1;
        min-width: 100%;
    }

    .main-control {
        order: 2;
        flex: 1;
    }

    .volume-area {
        order: 3;
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .brand {
        font-size: 1.5rem;
    }

    .video-header h1 {
        font-size: 1.1rem;
    }

    .progress-area span {
        font-size: 0.6rem;
    }
}