/* public/css/style.css - Silicon Valley Grade UI/UX + Full-Screen Live Cockpit + SVG System */
:root {
    --bg-dark: #090D16;
    --bg-surface: #111827;
    --bg-elevated: #172033;
    --bg-card: rgba(17, 24, 39, 0.78);
    --bg-card-hover: rgba(24, 34, 54, 0.9);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    /* Silicon Valley Neon Accents */
    --accent-cyan: #00F2FE;
    --accent-violet: #8B5CF6;
    --accent-emerald: #10B981;

    /* Institutional Brand Accents */
    --accent-upc: #E11D48;
    --accent-tls: #10B981;
    --accent-lps: #F97316;

    /* Dynamic Active Theme */
    --accent-current: #00F2FE;
    --accent-current-soft: rgba(0, 242, 254, 0.16);
    --accent-secondary: #8B5CF6;

    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --whatsapp: #25D366;

    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.65);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(circle at 12% 18%, var(--accent-current-soft) 0%, transparent 40%),
        radial-gradient(circle at 88% 82%, rgba(139, 92, 246, 0.10) 0%, transparent 42%);
    background-attachment: fixed;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Sistema de Iconos Vectoriales SVG Premium */
.icon-svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
    vertical-align: middle;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }

.container {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px 16px;
    flex: 1;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

/* Badges Institucionales */
.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: all 0.25s var(--ease-out-expo);
}

.brand-badge.upc { border-color: rgba(225, 29, 72, 0.5); color: #FB7185; background: rgba(225, 29, 72, 0.14); box-shadow: 0 0 20px rgba(225, 29, 72, 0.18); }
.brand-badge.tls { border-color: rgba(16, 185, 129, 0.5); color: #34D399; background: rgba(16, 185, 129, 0.14); box-shadow: 0 0 20px rgba(16, 185, 129, 0.18); }
.brand-badge.lps { border-color: rgba(249, 115, 22, 0.5); color: #FB923C; background: rgba(249, 115, 22, 0.14); box-shadow: 0 0 20px rgba(249, 115, 22, 0.18); }

/* Glassmorphism Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.25s var(--ease-out-expo), border-color 0.25s var(--ease-out-expo);
}

.card:hover {
    border-color: var(--border-strong);
}

/* Spotlight de Actividad en Vivo para el Alumno */
.live-activity-spotlight {
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.96), var(--accent-current-soft));
    border: 2px solid var(--accent-current) !important;
    box-shadow: 0 0 42px var(--accent-current-soft), var(--shadow);
    animation: popIn 0.4s var(--ease-out-expo);
}

/* Banner de sesión en vivo y Banner 1-Clic en Raíz */
.live-banner {
    background: linear-gradient(135deg, var(--accent-current-soft), rgba(17, 24, 39, 0.92));
    border: 1px solid var(--accent-current);
    box-shadow: 0 0 35px -5px var(--accent-current-soft), var(--shadow);
    position: relative;
    overflow: hidden;
}

.live-hero-banner {
    width: 100%;
    max-width: 600px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(139, 92, 246, 0.18), rgba(17, 24, 39, 0.92));
    border: 1px solid rgba(239, 68, 68, 0.55);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 28px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.22);
    animation: popIn 0.45s var(--ease-out-expo);
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #F87171;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #EF4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes popIn {
    0% { opacity: 0; transform: translateY(8px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Botones Interactivos */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.22s var(--ease-out-expo);
    text-decoration: none;
    font-family: inherit;
    color: var(--text-primary);
}

.btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--accent-current);
    color: #090D16;
    font-weight: 700;
    box-shadow: 0 6px 22px var(--accent-current-soft);
}

body.theme-light-text .btn-primary,
.btn-primary.light-text {
    color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

/* Botones de Ecosistema de Plataforma */
.btn-platform-blackboard {
    background: linear-gradient(135deg, #E11D48, #BE123C);
    color: #FFFFFF !important;
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.35);
}
.btn-platform-teams {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: #FFFFFF !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}
.btn-platform-moodle {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}
.btn-platform-meet {
    background: linear-gradient(135deg, #F97316, #EA580C);
    color: #FFFFFF !important;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.35);
}
.btn-platform-zoom {
    background: linear-gradient(135deg, #0EA5E9, #0284C7);
    color: #FFFFFF !important;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.btn-danger-outline {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #FCA5A5;
}
.btn-danger-outline:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
}

.btn-whatsapp {
    background: rgba(37, 211, 102, 0.14);
    border: 1px solid rgba(37, 211, 102, 0.4);
    color: #4ADE80;
}
.btn-whatsapp:hover {
    background: rgba(37, 211, 102, 0.24);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: all 0.2s var(--ease-out-expo);
}

.item-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-strong);
}

.countdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 254, 0.28);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Estrellas / Botones de calificación */
.star-rating {
    display: flex;
    gap: 10px;
    margin: 8px 0 16px;
    flex-wrap: wrap;
}

.star-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 9px 15px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s var(--ease-out-expo);
}

.star-btn.active, .star-btn:hover {
    background: var(--accent-current);
    color: #FFFFFF;
    border-color: var(--accent-current);
    box-shadow: 0 4px 14px var(--accent-current-soft);
}

/* Dinámicas en vivo */
.poll-option-btn {
    width: 100%;
    text-align: left;
    padding: 14px 18px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s var(--ease-out-expo);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poll-option-btn:hover, .poll-option-btn.selected {
    border-color: var(--accent-current);
    background: var(--accent-current-soft);
    transform: translateX(4px);
}

.poll-bar-wrap {
    margin-bottom: 14px;
}

.poll-bar-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
}

.poll-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-current), var(--accent-violet));
    border-radius: 999px;
    transition: width 0.4s var(--ease-out-expo);
}

.word-cloud-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    min-height: 160px;
    background: rgba(9, 13, 22, 0.72);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.word-pill {
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-current-soft), rgba(139, 92, 246, 0.24));
    border: 1px solid var(--accent-current);
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 0 22px var(--accent-current-soft);
    animation: popIn 0.35s var(--ease-out-expo);
    transition: transform 0.2s var(--ease-out-expo);
}

.word-pill:hover {
    transform: scale(1.06);
}

.postit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.postit-card {
    background: linear-gradient(145deg, rgba(254, 240, 138, 0.14), rgba(250, 204, 21, 0.05));
    border: 1px solid rgba(250, 204, 21, 0.38);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 0.92rem;
    color: #FEF9C3;
    animation: popIn 0.3s var(--ease-out-expo);
}

/* =========================================================================
   PÁGINA DEDICADA DE PANTALLA COMPLETA: LIVE COCKPIT (cockpit.html)
   ========================================================================= */
.cockpit-page-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.cockpit-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: rgba(11, 15, 23, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    flex-wrap: wrap;
}

.cockpit-workspace {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    padding: 24px;
    flex: 1;
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    align-items: start;
}

@media (max-width: 1080px) {
    .cockpit-workspace {
        grid-template-columns: 1fr;
        padding: 16px;
    }
}

.cockpit-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cockpit-main-stage {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.stage-nav {
    display: flex;
    gap: 8px;
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid var(--border);
    padding: 6px;
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.stage-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
}

.stage-tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.04);
}

.stage-tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.16), rgba(139, 92, 246, 0.2));
    color: white;
    border-color: rgba(0, 242, 254, 0.45);
}

.stage-surface {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
    min-height: 540px;
    box-shadow: var(--shadow);
}

/* Modales Desktop & Bottom-Sheets Mobile-First */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6, 9, 15, 0.84);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
    overflow-y: auto;
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 540px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 26px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.85);
    animation: popIn 0.28s var(--ease-out-expo);
}

.sheet-handle {
    display: none;
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    margin: 0 auto 14px;
}

@media (max-width: 640px) {
    .modal-overlay.bottom-sheet-mobile {
        align-items: flex-end;
        padding: 0;
    }
    .modal-overlay.bottom-sheet-mobile .modal {
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        border-bottom: none;
        padding: 18px 20px 28px;
        max-height: 90vh;
    }
    .modal-overlay.bottom-sheet-mobile .sheet-handle {
        display: block;
    }
}

/* Modo Proyector Pantalla Completa */
.projector-modal {
    max-width: 960px !important;
    text-align: center;
    background: radial-gradient(circle at center, rgba(0, 242, 254, 0.14), #090D16 75%);
    border: 1px solid rgba(0, 242, 254, 0.45);
    padding: 40px 32px !important;
}

.projector-pin-giant {
    font-size: clamp(3.5rem, 9vw, 6.2rem);
    font-weight: 900;
    letter-spacing: 12px;
    color: var(--accent-cyan);
    text-shadow: 0 0 35px rgba(0, 242, 254, 0.55);
    line-height: 1.05;
    margin: 12px 0;
}

/* Tablas CRM y Reporte Académico */
.crm-table-wrap {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.86rem;
}

.crm-table th {
    padding: 13px 16px;
    color: var(--text-secondary);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.025);
    white-space: nowrap;
}

.crm-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.crm-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
    flex-shrink: 0;
}

.avatar-circle.upc { background: linear-gradient(135deg, #E11D48, #9F1239); }
.avatar-circle.tls { background: linear-gradient(135deg, #10B981, #047857); }
.avatar-circle.lps { background: linear-gradient(135deg, #F97316, #C2410C); }

.optin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.optin-badge.yes {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.optin-badge.no {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.optin-badge.warn {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.optin-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

/* Inputs & Formularios */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    border-color: var(--accent-current);
    box-shadow: 0 0 0 3px var(--accent-current-soft);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.checkbox-group input {
    margin-top: 3px;
    accent-color: var(--accent-current);
    width: 16px;
    height: 16px;
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}
