/**
 * Estilos Globais - DHANNYLLO+ Plataforma
 * Versão 2.0 - Melhorado com Modo Escuro e Novos Componentes
 */

:root {
    /* Cores Primárias */
    --primary: #2949C7;
    --secondary: #6F8CF2;
    --accent: #F0B75E;
    
    /* Fundo principal inspirado no logo */
    --bg-main: #F3F6FC;
    --bg-primary: #F3F6FC;
    --bg-secondary: #FFFFFF;
    --bg-surface: rgba(255, 255, 255, 0.92);
    --text-primary: #182442;
    --text-secondary: #53617E;
    --border: rgba(41, 73, 199, 0.12);
    --shadow: rgba(30, 55, 130, 0.12);
    
    /* Espacements */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Transições */
    --transition: all 0.3s ease;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 10px;
    --radius-lg: 18px;
    --radius-xl: 24px;
}

/* MODO ESCURO */
[data-theme="dark"],
.dark-mode {
    --bg-main: #0B1220;
    --bg-primary: #0F172A;
    --bg-secondary: #17233A;
    --bg-surface: rgba(16, 31, 69, 0.92);
    --text-primary: #F4F7FF;
    --text-secondary: #B1BFEA;
    --border: rgba(111, 140, 242, 0.18);
    --shadow: rgba(0, 0, 0, 0.48);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, var(--bg-main) 0%, var(--bg-primary) 100%);
    color: var(--text-primary);
    transition: var(--transition);
    scroll-behavior: smooth;
    touch-action: auto;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
}

/* Minimizar transições/animações durante mudanças de rota para reduzir repaints */
body.routing *,
body.routing::before,
body.routing::after {
    transition: none !important;
    animation: none !important;
}

body.routing .modal-backdrop {
    backdrop-filter: none !important;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: auto;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
}

#app {
    min-height: 100%;
}

img,
picture,
video,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.main-content,
.app-content,
.sidebar,
.modal,
.modal-body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    touch-action: auto;
}

body.sidebar-open {
    overflow-x: hidden;
}


/* Scrollbar is handled by estilo/background.css for lightweight rendering */

/* ==================== LAYOUT PRINCIPAL ==================== */

.main-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: transparent;
}

.main-content {
    min-height: 0;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    background: linear-gradient(180deg, #17264D, #243F8F);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    position: fixed;
    height: 100vh;
    height: 100dvh;
    transition: var(--transition);
    z-index: 100;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.14);
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.45) transparent;
    padding: var(--spacing-md);
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.38);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.62);
    background-clip: padding-box;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: calc(var(--spacing-lg) * 1.25);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    touch-action: auto;
    min-height: 100vh;
    width: 100%;
    background: var(--bg-primary);
    border-top-left-radius: 32px;
    border-bottom-left-radius: 32px;
    box-shadow: -20px 0 80px rgba(30, 55, 130, 0.08);
}

.public-page-container {
    min-height: 100vh;
    width: 100%;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .main-layout {
        max-width: 100%;
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    body.sidebar-open {
        overflow-x: hidden;
    }

    .home-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
        padding: 1.25rem;
    }

    .home-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .hero {
        padding: 3rem 1.5rem;
    }
}

/* ==================== NOTIFICAÇÕES ==================== */

.notification-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 1000;
    max-width: 400px;
}

.notification {
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateX(400px);
    transition: var(--transition);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left-color: #4CAF50;
}

.notification-error {
    border-left-color: #F44336;
}

.notification-warning {
    border-left-color: #FF9800;
}

.notification-icon {
    font-weight: bold;
    font-size: 1.2rem;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
    color: var(--text-secondary);
}

/* ==================== BOTÕES ==================== */

.button-primary,
.button-secondary,
.button-danger {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    background: #D32F2F;
    color: white;
}

.button-primary {
    background: var(--primary);
    color: white;
}

.button-primary:hover {
    background: #0D5FFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 75, 255, 0.24);
}

.button-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.button-secondary:hover {
    background: var(--border);
}

.button-danger {
    background: #F44336;
    color: white;
}

.button-danger:hover {
    background: #B71C1C;
}

.full-width {
    width: 100%;
}

/* ==================== TEMA TOGGLE ==================== */

.theme-toggle-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background: var(--border);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.sun-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="light"] .sun-icon {
    display: none;
}

/* ==================== FORMS ==================== */

.input-group {
    margin-bottom: var(--spacing-md);
}

.input-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-primary);
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 75, 255, 0.12);
}

/* ==================== GRIDS E CARDS ==================== */

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.content-card {
    background: var(--bg-surface);
    border: 1px solid rgba(15, 75, 255, 0.08);
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 20px 40px rgba(11, 75, 255, 0.10);
}

.content-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px var(--shadow);
}

.card-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    padding: var(--spacing-md);
}

.card-title {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.lock-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lock-icon img {
    width: 16px;
    height: 16px;
}

/* ==================== PLANOS/ASSINATURA ==================== */

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.plan-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(11, 75, 255, 0.16);
    transform: translateY(-4px);
}

.plan-card.current-plan {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(11, 75, 255, 0.08), rgba(79, 126, 255, 0.08));
}

.plan-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: var(--spacing-md) 0;
}

.plan-price span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.plan-features {
    list-style: none;
    text-align: left;
    margin: var(--spacing-md) 0;
    flex-grow: 1;
}

.plan-features li {
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
}

.plan-features li:before {
    content: "✓ ";
    color: var(--secondary);
    font-weight: bold;
    margin-right: var(--spacing-xs);
}

/* ==================== UTILIDADES ==================== */

.hamburger-menu {
    background: none;
    border: none;
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(11, 75, 255, 0.08);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-md);
    color: var(--primary);
}

.upload-area .link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: var(--spacing-md);
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.2s ease;
}

/* ==================== CHAT ==================== */

.chat-widget {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 350px;
    height: 500px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px var(--shadow);
    display: flex;
    flex-direction: column;
    z-index: 500;
    transform: translateY(500px);
    transition: var(--transition);
}

.platform-global-ui {
    position: fixed;
    inset: 0;
    z-index: 400;
    pointer-events: none;
}

.platform-global-ui > * {
    pointer-events: auto;
}

.chat-widget.open {
    transform: translateY(0);
}

.chat-header {
    background: var(--primary);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.chat-message {
    display: flex;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-sm);
}

.chat-message.own {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-bubble {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    max-width: 250px;
    color: var(--text-primary);
}

.chat-text {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-message.own .chat-bubble {
    background: var(--primary);
    color: #fff;
}

.chat-message.own .chat-text {
    color: #fff;
}

.chat-input-area {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.chat-input {
    flex: 1;
    padding: var(--spacing-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.chat-send-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    width: 40px;
    cursor: pointer;
    transition: var(--transition);
}

.chat-send-btn:hover {
    background: #0D5FFF;
}

.ai-assistant {
    position: fixed;
    inset: auto var(--spacing-lg) var(--spacing-lg) auto;
    z-index: 500;
}

.ai-assistant-launcher {
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 24px var(--shadow);
    font-size: 1.5rem;
    cursor: pointer;
}

.ai-assistant-launcher:hover {
    background: #0D5FFF;
}

.ai-assistant .chat-widget {
    right: var(--spacing-lg);
    bottom: calc(var(--spacing-lg) + 64px);
    z-index: 1;
    transform: translateY(calc(100% + 80px));
}

.ai-assistant .chat-widget.open {
    transform: translateY(0);
}

.ai-assistant-messages .chat-welcome {
    color: var(--text-primary);
}

.ai-assistant .chat-avatar {
    display: grid;
    flex: 0 0 32px;
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
}

.ai-assistant .chat-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-assistant-read-message {
    min-height: 40px;
    margin-top: 0.5rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid currentColor;
    border-radius: var(--radius-sm);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.ai-assistant-read-message:hover {
    text-decoration: underline;
}

.ai-assistant-prompts {
    display: grid;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.ai-assistant-prompts button {
    padding: var(--spacing-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.ai-assistant-prompts button:hover {
    border-color: var(--primary);
}

.ai-assistant-privacy {
    margin: 0;
    padding: 0 var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.ai-assistant button:disabled,
.ai-assistant input:disabled {
    opacity: 0.6;
    cursor: wait;
}

.dhannyllo-live-panel {
    position: fixed;
    right: 24px;
    bottom: 90px;
    width: min(330px, calc(100vw - 24px));
    background: rgba(14, 22, 46, 0.94);
    border: 1px solid rgba(92, 140, 255, 0.4);
    border-radius: 18px;
    box-shadow: 0 24px 46px rgba(6, 12, 28, 0.42);
    color: #edf3ff;
    z-index: 450;
    overflow: hidden;
}

.dhannyllo-live-panel.collapsed .live-panel-body {
    display: none;
}

.live-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(39, 69, 142, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.live-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #dff7d7;
}

.live-pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #36d399;
    box-shadow: 0 0 0 0 rgba(54, 211, 153, 0.7);
    animation: livePulse 1.8s infinite;
}

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(54, 211, 153, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(54, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(54, 211, 153, 0); }
}

.live-panel-toggle {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #edf3ff;
    cursor: pointer;
}

.live-panel-body {
    padding: 14px;
}

.live-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.live-metrics > div {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.live-metrics strong {
    font-size: 1.2rem;
    color: #ffffff;
}

.live-metrics span {
    color: #b9c7e8;
    font-size: 0.72rem;
}

.live-events,
.live-chat {
    margin-top: 12px;
}

.live-chat-heading,
.live-detail-chat-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.live-events h4,
.live-chat h4 {
    margin: 0 0 8px;
    color: #dfe9ff;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.live-chat-toggle,
.live-detail-chat-toggle {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #edf3ff;
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
}

.live-detail-chat-heading h3 {
    margin: 0;
}

.live-detail-chat-content[hidden],
.live-chat-content[hidden] {
    display: none;
}

.live-events ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.live-events li {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(143, 164, 255, 0.08);
    color: #edf3ff;
    font-size: 0.76rem;
    line-height: 1.4;
}

.live-chat-messages {
    display: grid;
    gap: 8px;
    max-height: 160px;
    overflow: auto;
    margin-bottom: 10px;
}

.live-chat-message {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.live-chat-message strong {
    color: #8dc7ff;
    font-size: 0.72rem;
}

.live-chat-message span {
    color: #edf3ff;
    font-size: 0.74rem;
    line-height: 1.4;
}

.live-chat-form {
    display: flex;
    gap: 8px;
}

.live-chat-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(10, 15, 28, 0.7);
    color: #edf3ff;
    padding: 9px 10px;
}

.live-chat-form button {
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 9px 12px;
    font-weight: 700;
    cursor: pointer;
}

.live-detail-chat {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.live-detail-chat h3 {
    margin: 0 0 0.75rem;
    color: var(--text-primary);
}

.live-detail-chat-messages {
    display: grid;
    gap: 0.5rem;
    max-height: 240px;
    overflow: auto;
    margin-bottom: 0.75rem;
}

.live-detail-chat-form {
    display: flex;
    gap: 0.5rem;
}

.live-detail-chat-form input {
    flex: 1;
    min-width: 0;
}

@media (max-width: 600px) {
    .ai-assistant {
        right: var(--spacing-md);
        bottom: var(--spacing-md);
    }

    .ai-assistant .chat-widget {
        position: fixed;
        right: var(--spacing-md);
        bottom: 72px;
        width: calc(100vw - 2 * var(--spacing-md));
        height: min(500px, calc(100vh - 100px));
    }
}

/* ==================== PÁGINAS E COMPONENTES ==================== */

.public-page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    background: linear-gradient(180deg, rgba(11, 75, 255, 0.18), rgba(11, 75, 255, 0.08));
}

.login-page .login-container {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
}

.register-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    justify-content: flex-start;
}

.register-page .login-container {
    display: flex;
    flex: 0 0 100vh;
    flex-basis: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.register-page .login-form-container {
    margin: auto;
    padding: 24px;
}

.register-page .login-logo {
    margin-bottom: 16px;
}

.register-page .login-logo img {
    max-height: 72px;
    object-fit: contain;
}

.register-page .input-group {
    margin-bottom: 12px;
}

.register-page .input-group input,
.register-page .input-group select {
    padding: 10px;
}

@media (max-height: 700px) {
    .register-page .login-container {
        flex: 0 0 auto;
        min-height: 0;
        padding-block: 16px;
    }
}

.login-container,
.auth-container,
.main-layout {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.auth-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.login-form-container {
    width: 100%;
    max-width: 520px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: calc(var(--spacing-lg) * 1.2);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.12);
}

.login-logo {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.login-logo img {
    max-width: 140px;
}

.login-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-md);
}

.login-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
}

.login-links a:hover {
    text-decoration: underline;
}

.auth-box,
.login-form-container {
    width: 100%;
    max-width: 520px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: calc(var(--spacing-lg) * 1.2);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.12);
}

.auth-logo {
    display: block;
    margin: 0 auto 1rem;
    max-width: 140px;
}

.auth-description {
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
}

.site-footer {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.footer-logo p {
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

.footer-nav a {
    color: var(--text-secondary);
    transition: color var(--transition);
}

.footer-nav a:hover {
    color: var(--primary);
}

.footer-language {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.footer-language label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-language select {
    min-width: 160px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(11, 75, 255, 0.08), rgba(79, 126, 255, 0.08));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(15, 75, 255, 0.08);
}

.page-header h2,
.page-header h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(1.6rem, 2vw, 2rem);
}

.hamburger-menu {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(15, 75, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    cursor: pointer;
    transition: var(--transition);
}

.hamburger-menu .bar {
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
}

.hamburger-menu:hover {
    transform: translateY(-1px);
}

.button-tertiary {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.button-tertiary:hover {
    background: var(--border);
}

/* ==================== MODAIS ==================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    /* disabled backdrop-filter for performance on mobile/low-end devices */
    backdrop-filter: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 900;
    pointer-events: none;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(760px, calc(100% - 2rem));
    max-width: 760px;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    pointer-events: none;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.modal-content {
    padding: var(--spacing-lg);
}

.edit-content-modal {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-header,
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.modal-header h2,
.modal-header h3,
.modal-header h4 {
    margin: 0;
}

.modal-body {
    margin-top: var(--spacing-md);
}

.modal-close,
.close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover,
.close-btn:hover {
    color: var(--text-primary);
}

.recommendations-container,
.creator-dashboard,
.creator-promotion,
.section-content-wrapper,
.admin-panel,
.metrics-grid,
.dashboard-overview,
.favorites-list,
.communities-grid,
.tools-grid {
    display: grid;
    gap: var(--spacing-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.section-header p {
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.profile-container {
    display: grid;
    gap: var(--spacing-lg);
}

.profile-hero {
    background: var(--bg-surface);
    border: 1px solid rgba(15, 75, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
}

.profile-avatar-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-md);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(11, 75, 255, 0.18);
}

.avatar-info {
    flex: 1;
    min-width: 220px;
}

.user-email {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.meta-item {
    display: inline-flex;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.subscription-info,
.security-section,
.preferences-section {
    background: var(--bg-surface);
    border: 1px solid rgba(15, 75, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
}

.plans-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    align-items: center;
}

.plan-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.plan-toggle button {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-right: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    font-weight: 600;
    font-family: inherit;
    font-size: inherit;
    border-top: 0;
    border-left: 0;
    border-bottom: 0;
    border-radius: 0;
}

.plan-toggle button:last-child {
    border-right: none;
}

.plan-toggle button.active {
    color: white;
    background: var(--primary);
}

.creator-card,
.community-card,
.tool-card,
.overview-card,
.metric-card,
.favorite-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.creator-card {
    display: grid;
    gap: var(--spacing-md);
}

.creator-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.creator-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.creator-info h3 {
    margin: 0 0 0.25rem;
}

.creator-info p {
    color: var(--text-secondary);
}

.creator-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(78, 205, 196, 0.18);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.creator-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-md);
}

.stat {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.creator-actions,
.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.creator-actions button,
.favorite-item button {
    min-width: 130px;
}

.creator-dashboard {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
}

.creator-promotion {
    padding: var(--spacing-lg);
    background: rgba(11, 75, 255, 0.10);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(11, 75, 255, 0.12);
}

.creator-promotion h2 {
    margin-top: 0;
}

.creator-promotion p {
    color: var(--text-secondary);
}

.creators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.dashboard-overview {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.overview-card {
    text-align: center;
}

.overview-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.5rem;
}

.settings-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
}

.settings-section h3 {
    margin-top: 0;
}

.earnings-table,
.metrics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-md);
}

.earnings-table th,
.earnings-table td,
.metrics-table th,
.metrics-table td {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

.earnings-table th,
.metrics-table th {
    background: var(--bg-secondary);
}

.favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-card h4 {
    margin-bottom: 0.75rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.metric-change {
    color: var(--text-secondary);
}

.admin-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

.communities-grid,
.tools-grid {
    margin-top: var(--spacing-lg);
}

.community-card,
.tool-card {
    min-height: 190px;
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 200;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding-top: calc(var(--spacing-lg) + 2rem);
    }
    body.sidebar-open {
        overflow-x: hidden;
    }
}

.sidebar-nav {
    padding: var(--spacing-md);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav ul li {
    margin-bottom: 0.5rem;
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.sidebar-nav ul li a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.sidebar-nav ul li a.active {
    background: rgba(255, 255, 255, 0.14);
    color: white;
    border-left: 4px solid rgba(255, 255, 255, 0.85);
    padding-left: 0.75rem;
}

.sidebar-nav ul li a img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.section-hero {
    position: relative;
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-height: 260px;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(180deg, rgba(11, 75, 255, 0.95), rgba(11, 75, 255, 0.45));
}

.section-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 75, 255, 0.80), rgba(11, 75, 255, 0.14));
}

.section-hero .page-header {
    position: relative;
    width: 100%;
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.section-hero h1 {
    color: var(--text-primary);
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
}

.section-content-wrapper {
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.home-container {
    text-align: center;
    padding: 0 20px 4rem;
    width: 100%;
}

.home-header {
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: min(1200px, 100%);
    margin: 0 auto;
}

.home-logo img {
    height: 48px;
}

.home-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.public-page-content {
    width: min(100%, 900px);
    padding: 2rem 1rem;
    margin: 0 auto;
    text-align: left;
}

.error-page {
    padding: 2rem;
    text-align: center;
    max-width: 900px;
    margin: 3rem auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.08);
}

.hero {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(11, 75, 255, 0.18), rgba(79, 126, 255, 0.14));
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    box-shadow: 0 28px 80px rgba(11, 75, 255, 0.12);
}

.hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    color: var(--text-primary);
}

.hero p {
    color: var(--text-secondary);
}

.features-section,
.plans-section {
    padding: 3rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    text-align: left;
}

.feature-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.feature-item img {
    width: 52px;
    height: 52px;
    margin-bottom: var(--spacing-md);
}

.feature-item h3 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-item p {
    color: var(--text-secondary);
}

.plans-grid {
    display: grid;
    gap: var(--spacing-lg);
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: var(--spacing-lg);
}

.content-section {
    margin-bottom: var(--spacing-xl);
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-details {
    margin-top: var(--spacing-lg);
}

.content-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.content-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: var(--spacing-md);
}

.content-tags .tag {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
}

.player-view {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--spacing-lg);
    align-items: start;
}

.player-container iframe,
.player-container video,
.player-container audio,
.player-container img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    border-radius: var(--radius-xl);
    border: none;
}

.player-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: var(--spacing-md);
}

.control-button {
    flex: 1 1 auto;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
}

.control-button.active,
.control-button:hover {
    background: rgba(11, 75, 255, 0.12);
    border-color: var(--primary);
}

.playlist-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.playlist-item:hover,
.playlist-item.active {
    background: rgba(11, 75, 255, 0.10);
}

.comments-section {
    margin-top: var(--spacing-xl);
}

.comment-form textarea {
    min-height: 120px;
}

.comments-list {
    margin-top: var(--spacing-md);
    display: grid;
    gap: 1rem;
}

.comment {
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.related-content {
    margin-top: var(--spacing-xl);
}

.feature-placeholder {
    padding: var(--spacing-lg);
    border: 1px dashed rgba(11, 75, 255, 0.18);
    border-radius: var(--radius-xl);
    background: rgba(11, 75, 255, 0.06);
    text-align: center;
}

.admin-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    margin-bottom: var(--spacing-xl);
}

.admin-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
    display: grid;
    gap: var(--spacing-md);
}

.admin-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.admin-form {
    display: grid;
    gap: var(--spacing-md);
}

.plan-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.plan-fieldset legend {
    font-weight: 700;
    padding: 0 0.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

@media (max-width: 1024px) {
    .player-view {
        grid-template-columns: 1fr;
    }
    .playlist-container {
        order: -1;
    }
}

@media (max-width: 768px) {
    .section-hero {
        min-height: 200px;
    }
    .main-content {
        padding: var(--spacing-md);
    }
    .player-container iframe,
    .player-container video,
    .player-container audio,
    .player-container img {
        min-height: 240px;
    }
}

@media (max-width: 560px) {
    .sidebar {
        width: 100%;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 200;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding-top: var(--spacing-lg);
    }
    .site-footer,
    .login-form-container,
    .admin-section,
    .section-content-wrapper {
        padding: var(--spacing-md);
    }
    .player-controls {
        flex-direction: column;
    }
}

/* Acessibilidade global */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2000;
    padding: 0.85rem 1rem;
    transform: translateY(-200%);
    border-radius: var(--radius-md);
    background: #fff;
    color: #111;
    font-weight: 700;
}

/* Transmissões ao vivo */
.lives-container {
    display: grid;
    gap: clamp(1rem, 2.5vw, 1.75rem);
    width: 100%;
    padding-bottom: var(--spacing-xl);
}

.lives-section,
.creator-live-section {
    min-width: 0;
    padding: clamp(1rem, 2.5vw, 1.75rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    box-shadow: 0 12px 32px var(--shadow);
}

.lives-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.lives-section h2,
.creator-live-section h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    line-height: 1.3;
}

.lives-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.lives-actions .button-primary,
.lives-actions .button-secondary,
.creator-live-section .go-live-btn,
.live-card-actions .button-secondary,
.live-camera-settings .button-secondary {
    min-height: 44px;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
}

.lives-actions .button-secondary,
.live-card-actions .button-secondary,
.live-camera-settings .button-secondary {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.lives-section > p {
    margin: 0;
    padding: 1.1rem 1.25rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: rgba(41, 73, 199, 0.035);
    color: var(--text-secondary);
}

.lives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: 1rem;
}

.lives-grid[hidden],
.active-lives-empty[hidden] {
    display: none;
}

.live-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    box-shadow: 0 6px 20px var(--shadow);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.live-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px var(--shadow);
}

.live-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary), var(--dark));
}

.live-card-body {
    display: grid;
    gap: 0.7rem;
    padding: 1rem;
}

.live-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.live-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(192, 57, 43, 0.1);
    color: #b42318;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.live-start {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.live-card-body h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.live-card-body p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--text-secondary);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.live-card-actions {
    display: flex;
    margin-top: 0.25rem;
}

.creator-live-section {
    display: grid;
    gap: 1.1rem;
    border-color: rgba(41, 73, 199, 0.2);
    background:
        radial-gradient(ellipse at top right, rgba(111, 140, 242, 0.13), transparent 55%),
        var(--bg-surface);
}

.creator-live-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.creator-live-heading p {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
}

.creator-live-icon {
    display: grid;
    flex: 0 0 2.65rem;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border-radius: 14px;
    background: rgba(41, 73, 199, 0.1);
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 900;
}

.live-share-link {
    width: fit-content;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--primary);
}

.live-preview-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: 0.75rem;
    overflow: hidden;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #080d19;
}

.live-preview-wrapper .live-stream-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    background: #080d19;
    object-fit: cover;
}

.live-camera-settings {
    display: grid;
    gap: 0.65rem;
    max-width: 34rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
}

.live-camera-settings label {
    color: var(--text-primary);
    font-weight: 700;
}

.live-camera-settings select {
    width: 100%;
    min-height: 5rem;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.live-device-settings {
    display: grid;
    gap: 1rem;
    width: 100%;
    padding: clamp(1rem, 2vw, 1.25rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
}

.live-device-heading,
.live-device-grid,
.live-broadcast-options {
    display: grid;
    gap: 0.85rem;
}

.live-device-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.live-device-heading h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.live-device-heading p,
.live-device-field small {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.live-device-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.live-device-field {
    display: grid;
    align-content: start;
    gap: 0.55rem;
    min-width: 0;
    margin: 0;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.live-device-field:disabled,
.live-device-field.live-device-disabled {
    opacity: 0.7;
}

.live-device-field legend,
.live-device-label {
    padding: 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
}

.live-device-options {
    display: grid;
    gap: 0.45rem;
    max-height: 12rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.live-device-option,
.live-option-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

.live-device-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(41, 73, 199, 0.08);
}

.live-device-option input,
.live-option-toggle input {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0.1rem 0 0;
    accent-color: var(--primary);
}

.live-device-option span,
.live-option-toggle span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.live-device-field select {
    width: 100%;
    min-height: 46px;
    padding: 0.65rem 2.25rem 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
}

.live-broadcast-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
}

.live-broadcast-options .live-screen-share-btn {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 700;
}

.live-screen-share-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.live-option-toggle {
    min-height: 44px;
    align-items: center;
    font-size: 0.88rem;
}

.live-device-hint,
.live-location-status,
.live-screen-status {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.live-location-status,
.live-screen-status,
.live-recording-note {
    grid-column: 1 / -1;
}

.live-location-badge {
    width: fit-content;
    max-width: 100%;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(41, 73, 199, 0.08);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}

@media (max-width: 640px) {
    .lives-section,
    .creator-live-section {
        padding: 1rem;
        border-radius: var(--radius-lg);
    }

    .lives-section-heading,
    .lives-actions {
        align-items: stretch;
    }

    .lives-actions {
        width: 100%;
    }

    .lives-actions > button {
        flex: 1 1 10rem;
    }

    .lives-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .live-device-heading,
    .live-device-grid,
    .live-broadcast-options {
        grid-template-columns: minmax(0, 1fr);
    }

    .live-device-heading .button-secondary,
    .live-broadcast-options > button {
        width: 100%;
    }
}

.skip-link:focus {
    transform: translateY(0);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid #ffbf47 !important;
    outline-offset: 3px;
}

html[data-text-scale="115"] { font-size: 115%; }
html[data-text-scale="130"] { font-size: 130%; }
html[data-text-scale="150"] { font-size: 150%; }

html.a11y-high-contrast {
    --primary: #003bb3;
    --secondary: #003bb3;
    --accent: #6b3700;
    --bg-main: #fff;
    --bg-primary: #fff;
    --bg-secondary: #fff;
    --bg-surface: #fff;
    --text-primary: #000;
    --text-secondary: #222;
    --border: #000;
    --shadow: transparent;
    color-scheme: light;
}

html.a11y-high-contrast body,
html.a11y-high-contrast body *:not(img):not(video):not(svg):not(path) {
    background-image: none !important;
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
}

html.a11y-high-contrast body {
    background: #fff !important;
    color: #000 !important;
}

html.a11y-high-contrast :where(a, button, input, select, textarea) {
    color: #000 !important;
    border-color: #000 !important;
}

html.a11y-high-contrast a {
    text-decoration: underline !important;
}

html.a11y-readable-font body,
html.a11y-readable-font body button,
html.a11y-readable-font body input,
html.a11y-readable-font body select,
html.a11y-readable-font body textarea {
    font-family: Arial, Verdana, sans-serif !important;
}

html.a11y-increased-spacing body {
    line-height: 1.7;
    letter-spacing: 0.035em;
    word-spacing: 0.12em;
}

html.a11y-increased-spacing :where(p, li, label, button, input, textarea) {
    line-height: 1.7;
}

html.a11y-highlight-links a {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    text-decoration: underline !important;
    font-weight: 700;
}

html.a11y-reduced-motion *,
html.a11y-reduced-motion *::before,
html.a11y-reduced-motion *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

.accessibility-controls {
    position: fixed;
    left: var(--spacing-lg);
    bottom: var(--spacing-lg);
    z-index: 600;
}

.a11y-launcher {
    min-width: 52px;
    min-height: 52px;
    padding: 0.5rem;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #17398f;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.a11y-panel {
    position: fixed;
    left: var(--spacing-lg);
    bottom: calc(var(--spacing-lg) + 64px);
    width: min(360px, calc(100vw - 2 * var(--spacing-lg)));
    max-height: min(75vh, 640px);
    overflow: auto;
    padding: 1rem;
    border: 2px solid var(--text-primary);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.a11y-panel-header h2 {
    font-size: 1.2rem;
}

.a11y-controls {
    display: grid;
    gap: 0.75rem;
}

.a11y-controls label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
}

.a11y-controls input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
}

.a11y-controls :where(button, select),
.a11y-close {
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    text-align: left;
}

.a11y-controls button,
.a11y-close {
    cursor: pointer;
}

.a11y-note {
    margin-top: 1rem;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .accessibility-controls {
        left: var(--spacing-md);
        bottom: var(--spacing-md);
    }

    .a11y-panel {
        left: var(--spacing-md);
        bottom: 80px;
        width: calc(100vw - 2 * var(--spacing-md));
    }
}

@media (forced-colors: active) {
    .a11y-launcher,
    .a11y-panel,
    .skip-link {
        border: 2px solid ButtonText;
        forced-color-adjust: auto;
    }
}

.main-layout.player-layout {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
}

.player-layout > .player-page-content {
    width: auto;
    max-width: none;
    min-width: 0;
    flex: 1 1 auto;
    margin-left: 260px;
    padding: clamp(1rem, 2vw, 2rem);
    border-radius: 0;
}

.player-view,
.player-columns,
.player-main {
    min-width: 0;
}

.player-view {
    display: block;
    width: 100%;
}

.player-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    align-items: start;
    gap: clamp(1rem, 2vw, 1.75rem);
}

.player-main {
    width: 100%;
}

.player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: calc(100dvh - 120px);
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: #05070b;
}

.player-container :is(iframe, video, img) {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: inherit;
}

.player-container :is(video, img) {
    object-fit: contain;
}

.player-container audio {
    display: block;
    width: min(100% - 2rem, 760px);
    min-height: 48px;
    margin: auto;
}

.player-container:has(audio) {
    display: grid;
    min-height: 160px;
    aspect-ratio: auto;
}

.player-container:fullscreen {
    width: 100vw;
    height: 100vh;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0;
}

.player-container:fullscreen :is(iframe, video, img) {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.player-viewport-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.65rem;
}

.player-viewport-actions button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
}

.player-controls {
    margin-top: 0.65rem;
}

.player-controls .control-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.content-details {
    overflow-wrap: anywhere;
}

.content-details h1 {
    margin-bottom: 0.75rem;
}

.content-meta {
    row-gap: 0.5rem;
}

.content-meta > span {
    overflow-wrap: anywhere;
}

.playlist-container {
    position: sticky;
    top: 1rem;
    max-height: min(76vh, 780px);
    overflow: auto;
    overscroll-behavior: contain;
    order: 0;
}

.playlist-container h2 {
    margin: 0 0 0.9rem;
    font-size: 1.15rem;
}

.playlist-item {
    min-height: 48px;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
}

.playlist-item[aria-current="true"] {
    border: 1px solid var(--primary);
    font-weight: 700;
}

.playlist-item p {
    margin: 0;
}

.comments-section,
.related-content {
    width: 100%;
    min-width: 0;
}

.comment-form {
    display: grid;
    gap: 0.75rem;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
}

.comment-form button {
    justify-self: start;
    min-height: 44px;
}

.comments-empty-state {
    padding: 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

.comment {
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
    .player-columns {
        grid-template-columns: minmax(0, 1fr) minmax(230px, 290px);
    }
}

@media (max-width: 900px) {
    .player-layout > .player-page-content {
        width: 100%;
        margin-left: 0;
        padding-top: calc(var(--spacing-lg) + 2rem);
    }

    .player-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .playlist-container {
        position: static;
        max-height: 45vh;
        order: 1;
    }
}

@media (max-width: 600px) {
    .player-layout > .player-page-content {
        padding: 1rem 0.75rem 1.5rem;
    }

    .player-container {
        max-height: calc(100dvh - 150px);
        border-radius: var(--radius-lg);
    }

    .player-viewport-actions {
        margin-top: 0.5rem;
    }

    .player-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-controls .control-button {
        min-width: 0;
    }

    .playlist-container {
        max-height: 40vh;
        padding: 1rem;
    }

    .content-details {
        margin-top: 1rem;
    }
}

.ia-projects-header {
    --ia-accent: var(--primary);
    max-width: 880px;
    margin: 0 auto 1.5rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    box-shadow: 0 12px 32px var(--shadow);
}

.dark-mode .ia-projects-header,
[data-theme="dark"] .ia-projects-header {
    --ia-accent: #9bb8ff;
}

.ia-projects-eyebrow,
.ia-project-category,
.ia-player-heading > p {
    color: var(--ia-accent, var(--primary));
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ia-projects-header h1,
.ia-player-heading h1 {
    margin: 0.3rem 0 0.6rem;
    color: var(--text-primary);
}

.ia-projects-header > p:not(.ia-projects-eyebrow),
.ia-project-card > p:not(.ia-project-category),
.ia-player-fallback {
    color: var(--text-secondary);
    line-height: 1.6;
}

.ia-projects-note {
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--ia-accent, var(--primary));
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--bg-primary);
}

.ia-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1rem;
}

.ia-project-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    box-shadow: 0 8px 24px var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ia-project-card:hover,
.ia-project-card:focus-within {
    transform: translateY(-3px);
    border-color: var(--ia-accent, var(--primary));
    box-shadow: 0 14px 30px var(--shadow);
}

.ia-project-card h2,
.ia-project-card p {
    margin: 0;
}

.ia-project-card h2 {
    color: var(--text-primary);
}

.ia-project-card .button-primary {
    align-self: flex-start;
    margin-top: auto;
    text-decoration: none;
}

.ia-project-card-icon {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
}

.ia-player-page {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1rem;
}

.ia-player-toolbar {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ia-player-heading {
    min-width: 0;
    flex: 1 1 180px;
}

.ia-player-heading > p,
.ia-player-heading h1 {
    margin-top: 0;
    margin-bottom: 0.25rem;
}

.ia-player-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ia-player-actions :where(a, button),
.ia-player-toolbar > a {
    min-height: 44px;
}

.ia-player-shell {
    width: 100%;
    height: min(76vh, 900px);
    min-height: 420px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: #080d15;
}

.ia-project-frame,
.player-container .ia-project-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #080d15;
}

.ia-player-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    min-height: 0;
    border: 0;
    border-radius: 0;
}

.ia-player-shell:fullscreen .ia-project-frame {
    height: 100%;
}

@media (max-width: 600px) {
    .ia-player-toolbar {
        align-items: stretch;
    }

    .ia-player-actions {
        width: 100%;
    }

    .ia-player-actions > * {
        flex: 1 1 auto;
    }

    .ia-player-shell {
        height: 72vh;
        min-height: 360px;
    }
}
