:root {
    --header-height: 60px;
    --chat-width: 350px;
    --bg-color: #000000;
    --secondary-bg: #111111;
    --text-color: #ffffff;
    --accent-color: #ff1212;
    --accent-color-20: rgba(255, 18, 18, 0.2);
    --button-hover: #d00f0f;
    --primary-color: #bb86fc;
    --secondary-color: #03dac6;
    --error-color: #cf6679;
    --surface-color: #1e1e1e;
    scrollbar-color: #444 #121212;
    scrollbar-width: thin;
}

/* 20% larger base — all rem sizes scale automatically */
html {
    font-size: 19.2px;
}

/* Dark Theme Scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    background: #121212;
}

::-webkit-scrollbar-track {
    background: #121212;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
    border: 2px solid #121212;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

a {
    color: var(--accent-color);
}

a:hover {
    color: var(--button-hover);
}

/* ==========================================================================
   Header
   ========================================================================== */

header {
    flex: 0 0 var(--header-height);
    background-color: var(--secondary-bg);
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 1.5rem;
    z-index: 1100;
    position: relative;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left a {
    display: flex;
    align-items: center;
}

/* ── Burger Menu ── */
.burger-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.burger-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.burger-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.burger-overlay.open {
    opacity: 1;
    visibility: visible;
}

.burger-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #141414;
    border-right: 1px solid #2a2a2a;
    z-index: 1300;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.burger-nav.open {
    transform: translateX(0);
}

.burger-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #2a2a2a;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
}

.burger-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.burger-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.burger-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.burger-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-left-color: var(--accent-color);
}

.burger-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.logo-large,
.logo-small {
    height: 32px;
    width: auto;
}

.logo-small {
    display: none;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: #121212;
    border: 1px solid #888;
    border-radius: 20px;
    padding: 5px 15px;
    width: 100%;
    max-width: 500px;
    transition: border-color 0.15s;
}

.search-box:focus-within {
    border-color: var(--accent-color);
}

.search-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    color: #888;
}

.search-box input {
    background: transparent;
    border: none;
    color: #eee;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: #333;
    color: white;
}

.user-menu-container {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
    border: 1px solid #333;
}

.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid #333;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    background-color: #252525;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    width: 200px;
    z-index: 2001;
    padding: 5px 0;
    border: 1px solid #333;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 15px;
    color: #ddd;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: normal;
}

.dropdown-item:hover {
    background-color: #3d3d3d;
    color: white;
}

.dropdown-divider {
    height: 1px;
    background-color: #333;
    margin: 5px 0;
}

/* Mobile Responsive Header */
@media (max-width: 768px) {
    .logo-large {
        display: none;
    }

    .logo-small {
        display: block;
    }

    .header-center {
        padding: 0 10px;
    }

    .search-box {
        max-width: none;
    }
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   Auth Forms (Login / Register)
   ========================================================================== */

.auth-container {
    max-width: 520px;
    margin: 60px auto;
    padding: 0;
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    overflow: hidden;
}

.auth-container .auth-header {
    padding: 32px 32px 0;
    text-align: center;
}

.auth-container .auth-header h2 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-container .auth-header p {
    margin: 0;
    color: #888;
    font-size: 0.875rem;
}

.auth-container form {
    padding: 24px 32px 8px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    background: #181818;
    border: 1px solid #333;
    color: var(--text-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-color-20);
}

.form-group input::placeholder {
    color: #555;
}

/* Password visibility toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #aaa;
}

.auth-container .auth-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 4px;
}

.auth-container .auth-submit:hover {
    background: var(--button-hover);
}

.auth-container .auth-submit:active {
    transform: scale(0.98);
}

.auth-container .auth-footer {
    padding: 16px 32px 24px;
    text-align: center;
    font-size: 0.85rem;
    color: #888;
}

.auth-container .auth-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-container .auth-footer a:hover {
    text-decoration: underline;
}

.auth-flash {
    margin: 0 32px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.auth-flash.auth-flash-error {
    background: rgba(207, 102, 121, 0.12);
    color: var(--error-color);
    border: 1px solid rgba(207, 102, 121, 0.25);
}

.auth-flash.auth-flash-success {
    background: rgba(3, 218, 198, 0.10);
    color: var(--secondary-color);
    border: 1px solid rgba(3, 218, 198, 0.2);
}

.auth-flash.auth-flash-info {
    background: rgba(100, 180, 255, 0.08);
    color: #8bb8e8;
    border: 1px solid rgba(100, 180, 255, 0.18);
    margin-top: 16px;
    line-height: 1.5;
}

.auth-flash.auth-flash-info a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-flash.auth-flash-info a:hover {
    text-decoration: underline;
}

/* Legacy error/success (used outside auth) */
.error {
    color: var(--error-color);
    margin-bottom: 10px;
}

.success {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: var(--text-color);
    background-color: #333;
}

.btn:hover {
    background-color: #444;
}

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

.btn-primary:hover {
    background-color: var(--button-hover);
}

/* ==========================================================================
   Auth Navigation (Login/Register buttons for unauthenticated users)
   ========================================================================== */

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-buttons .btn-login {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    color: #ccc;
    background: transparent;
    border: 1px solid #444;
}

.auth-buttons .btn-login:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: #666;
}

.auth-buttons .btn-register {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    color: #fff;
    background: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.auth-buttons .btn-register:hover {
    background: var(--button-hover);
    border-color: var(--button-hover);
}

.auth-buttons .btn-register:active {
    transform: scale(0.96);
}

/* ═══════════════════════════════════════════
   Report Modal
   ═══════════════════════════════════════════ */
.report-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.report-modal-overlay.open {
    display: flex;
}

.report-modal {
    background: var(--secondary-bg, #111);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    animation: reportFadeIn 0.15s ease;
}

@keyframes reportFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.report-modal h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: #fff;
}

.report-modal textarea {
    width: 100%;
    background: var(--bg-color, #000);
    border: 1px solid #444;
    border-radius: 8px;
    color: #ddd;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.report-modal textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.report-modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.report-char-count {
    font-size: 0.78rem;
    color: #777;
}

.report-char-count.short {
    color: #f39c12;
}

.report-char-count.over {
    color: #e74c3c;
}

.report-error {
    font-size: 0.82rem;
    color: #e74c3c;
    flex: 1;
}

.report-modal-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.report-modal-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.report-modal-actions .btn-secondary {
    background: #333;
    color: #ccc;
}

.report-modal-actions .btn-secondary:hover {
    background: #444;
}

.report-modal-actions .btn-primary {
    background: var(--accent-color);
    color: #fff;
}

.report-modal-actions .btn-primary:hover {
    filter: brightness(1.15);
}

.report-modal-actions .btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.report-btn-sm {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.72rem;
    opacity: 0.4;
    transition: opacity 0.15s;
    padding: 2px 4px;
}

.report-btn-sm:hover {
    opacity: 1;
}

.btn-report {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: filter 0.15s;
}

.btn-report:hover {
    filter: brightness(1.15);
}

.btn-report svg {
    flex-shrink: 0;
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    pointer-events: none;
}

.notification-btn {
    position: relative;
}

.notif-wrap {
    position: relative;
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 480px;
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 1200;
    overflow: hidden;
    flex-direction: column;
}

.notif-dropdown.open {
    display: flex;
}

.notif-dropdown-header {
    padding: 14px 16px 10px;
    font-weight: 700;
    font-size: 15px;
    color: #eee;
    border-bottom: 1px solid #1a1a1a;
}

.notif-dropdown-body {
    flex: 1;
    overflow-y: auto;
    max-height: 340px;
}

.notif-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: #ccc;
    border-bottom: 1px solid #1a1a1a;
    transition: background 0.15s;
    position: relative;
}

.notif-dropdown-item:hover {
    background: #1a1a1a;
    color: #eee;
}

.notif-dropdown-item.unread {
    background: rgba(255, 18, 18, 0.04);
}

.notif-dropdown-item.admin {
    border-left: 3px solid var(--accent-color, #ff1212);
}

.notif-unread-dot {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-color, #ff1212);
}

.notif-dd-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-dd-icon svg {
    display: block;
}

.notif-dd-content {
    flex: 1;
    min-width: 0;
}

.notif-dd-title {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #eee;
    line-height: 1.4;
}

.notif-dd-from {
    display: block;
    font-size: 12px;
    color: #999;
}

.notif-dd-time {
    flex-shrink: 0;
    font-size: 11px;
    color: #888;
}

.notif-dropdown-loading,
.notif-dropdown-empty {
    padding: 32px 16px;
    text-align: center;
    color: #555;
    font-size: 13px;
}

.notif-admin-btn {
    display: block;
    padding: 10px 16px;
    background: var(--accent-color, #ff1212);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: filter 0.15s;
}

.notif-admin-btn:hover {
    filter: brightness(1.2);
    color: #fff;
}

.notif-dropdown-footer {
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-color, #ff1212);
    text-decoration: none;
    border-top: 1px solid #1a1a1a;
    transition: background 0.15s;
}

.notif-dropdown-footer:hover {
    background: #1a1a1a;
    color: var(--accent-color, #ff1212);
}

/* ==========================================================================
   Stream Health Alerts
   ========================================================================== */
#stream-alerts {
    position: fixed;
    top: 64px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
    pointer-events: none;
}

.stream-alert {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border-left: 4px solid;
    background: var(--bg-secondary, #111);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    animation: alertSlideIn 0.35s ease;
    pointer-events: auto;
}

.stream-alert-warning {
    border-left-color: #f59e0b;
    background: #1a1708;
}

.stream-alert-error {
    border-left-color: #ef4444;
    background: #1a0a0a;
}

.stream-alert-content {
    flex: 1;
    min-width: 0;
}

.stream-alert-content strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary, #f0f0f0);
    margin-bottom: 4px;
}

.stream-alert-content p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary, #aaa);
    line-height: 1.4;
}

.stream-alert-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-color, #ff1212);
    text-decoration: none;
}

.stream-alert-link:hover {
    text-decoration: underline;
}

.stream-alert-close {
    background: none;
    border: none;
    color: var(--text-secondary, #666);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    align-self: flex-start;
    flex-shrink: 0;
}

.stream-alert-close:hover {
    color: var(--text-primary, #f0f0f0);
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes alertSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Go-live alert */
.stream-live-alert {
    border-left-color: var(--accent-color, #ff1212);
    background: #1a0808;
    position: relative;
    overflow: hidden;
}

.live-alert-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-alert-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-alert-avatar.placeholder {
    background: linear-gradient(135deg, var(--accent-color, #ff1212), #ff5252);
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.stream-live-alert::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: var(--accent-color, #ff1212);
    animation: liveCountdown 15s linear forwards;
}

@keyframes liveCountdown {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}