/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
    --bg: #0a0a0a;
    --bg2: #111111;
    --surface: #161616;
    --border: #222222;
    --border2: #2a2a2a;
    --text: #ffffff;
    --text-dim: #555555;
    --text-mid: #888888;
    --accent: #ffffff;
    --live: #e84040;
    --error: #e84040;
    --success: #4caf7d;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ─── LOGIN PAGE ─────────────────────────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2.5rem;
}

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

.brand-live {
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.login-title {
    font-size: 28px;
    color: var(--text);
    font-weight: 300;
    margin-bottom: 8px;
    line-height: 1.2;
}

.login-title em {
    font-style: normal;
    font-weight: 400;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-wrapper { position: relative; }

.code-input {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 15px;
    letter-spacing: 0.1em;
    padding: 13px 16px;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    caret-color: var(--text);
}

.code-input::placeholder { color: #333; }
.code-input:focus { border-color: #444; }

.input-wrapper.error .code-input { border-color: var(--error); }

/* Hide unused elements from old CSS */
.input-line { display: none; }

.submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    background: var(--text);
    border: none;
    color: #000;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) { opacity: 0.9; }
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.submit-btn.loading .btn-text,
.submit-btn.loading .btn-arrow { opacity: 0; }

.submit-btn.success {
    background: var(--success);
    color: #fff;
}

.btn-loader {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #000;
    border-radius: 50%;
    display: none;
}

.submit-btn.loading .btn-loader {
    display: block;
    animation: spin 0.7s linear infinite;
}

/* Error */
.error-msg {
    font-size: 12px;
    color: var(--error);
    min-height: 18px;
    opacity: 0;
    transition: opacity 0.2s;
}
.error-msg.visible { opacity: 1; }

/* Corner decorations — ascunse in stilul nou */
.corner-decoration { display: none; }

/* ─── WATCH PAGE ─────────────────────────────────────────────────────────── */
.watch-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

.watch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #0a0a0a;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--live);
    font-family: var(--font-mono);
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--font-sans);
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    border-color: #444;
    color: var(--text);
}

.watch-main {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.player-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

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

/* Ascunde bara de progres si timpul — e live */
video::-webkit-media-controls-timeline { display: none !important; }
video::-webkit-media-controls-current-time-display { display: none !important; }
video::-webkit-media-controls-time-remaining-display { display: none !important; }

.player-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid #222;
    border-top-color: #555;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.player-error {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-dim);
    font-size: 13px;
}

.player-error button {
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 12px;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.player-error button:hover {
    border-color: #444;
}

/* ─── Overlays ───────────────────────────────────────────────────────────── */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,10,10,0.97);
    z-index: 500;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.overlay-content { max-width: 340px; }

.overlay-icon {
    font-size: 2.5rem;
    margin-bottom: 1.2rem;
    display: block;
}

.overlay h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text);
}

.overlay p {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 6px;
}

.overlay-sub a, .overlay p a { color: var(--text); text-decoration: underline; }

.overlay-btn {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 10px 24px;
    background: var(--text);
    color: #000;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: opacity 0.2s;
}

.overlay-btn:hover { opacity: 0.85; }

/* ─── Anti Screen-Share ──────────────────────────────────────────────────── */
.screenshare-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 12px;
    pointer-events: none;
}

[data-protected="true"] .video-player { isolation: isolate; }

[data-protected="true"] .player-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    mix-blend-mode: difference;
    pointer-events: none;
}

/* ─── Noise — scos in stilul nou ─────────────────────────────────────────── */
.noise { display: none; }

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .login-container { padding: 1.5rem; }
}