@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@600;800&display=swap');

:root {
    /* Academy Professional Palette */
    --bg-main: #0a0f18;
    --bg-side: #121926;
    --bg-card: #1c2535;

    /* Accents (Clean & Tech) */
    --accent-primary: #3b82f6;
    /* Modern Blue */
    --accent-secondary: #10b981;
    /* Emeral Green (Success/Playful) */
    --accent-highlight: #f59e0b;
    /* Amber (Trivia/Tips) */
    --accent-danger: #ef4444;

    /* Text */
    --text-white: #f8fafc;
    --text-glass: rgba(248, 250, 252, 0.8);
    --text-muted: #94a3b8;

    /* UI elements */
    --radius-main: 12px;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    --border-soft: 1px solid rgba(255, 255, 255, 0.08);

    --font-head: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* ==========================================================================
   Base & Background
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-white);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-size: 1rem;
    position: relative;
}

/* Subtle Tech Pattern Background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    pointer-events: none;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-head);
    letter-spacing: 1px;
    font-weight: 800;
}

/* ==========================================================================
   Header & Layout
   ========================================================================== */
.app-header {
    background: rgba(18, 25, 38, 0.95);
    border-bottom: 1px solid var(--accent-primary);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-soft);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.glow-text {
    color: #fff;
    font-size: 1.4rem;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fff, var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.system-status {
    font-family: var(--font-body);
    color: var(--accent-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--accent-secondary);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.1);
    text-transform: uppercase;
}

.app-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem;
    position: relative;
    z-index: 10;
}

.app-footer {
    text-align: center;
    padding: 2.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: var(--border-soft);
}

/* ==========================================================================
      Buttons & Cards (Cyberpunk Style)
      ========================================================================== */
.btn {
    font-family: var(--font-head);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   Buttons & Professional Cards
   ========================================================================== */
.btn {
    font-family: var(--font-body);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    border: none;
    gap: 0.5rem;
}

.academy-btn {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.academy-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.23);
}

.sec-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sec-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Academy Cards */
.academy-card {
    background: var(--bg-card);
    border: var(--border-soft);
    border-radius: var(--radius-main);
    padding: 2rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.academy-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    background: #232d41;
}

/* ==========================================================================
   SPA Views & Animations
   ========================================================================== */
.view {
    display: none;
}

.view.d-block {
    display: block;
}

.fade-in {
    animation: smoothFadeIn 0.6s ease-out forwards;
}

@keyframes smoothFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Home & Subject Selection
   ========================================================================== */
.hero-section {
    text-align: center;
    margin-bottom: 5rem;
    padding: 3rem 0;
}

.main-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.main-sub {
    color: var(--text-muted);
    font-size: 1.25rem;
    font-weight: 400;
}

.asignaturas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.subject-card {
    position: relative;
    overflow: hidden;
}

.subject-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.subject-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-weight: 700;
}

/* ==========================================================================
   Resumen Layout (Academy Sidebar + Content)
   ========================================================================== */
.resumen-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 3rem;
    align-items: start;
}

.academy-sidebar {
    background: var(--bg-side);
    border-radius: var(--radius-main);
    padding: 2rem;
    position: sticky;
    top: 120px;
    box-shadow: var(--shadow-soft);
}

.sidebar-heading {
    color: var(--accent-primary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-list {
    list-style: none;
}

.nav-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-glass);
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-primary);
    font-weight: 700;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Content Rendering */
.lecture-container {
    max-width: 900px;
}

.lecture-title {
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
    color: #fff;
    line-height: 1.2;
}

.lecture-body {
    font-size: 1.15rem;
    color: var(--text-glass);
    line-height: 1.8;
}

/* Study Blocks */
.academy-note {
    background: #1e293b;
    border-radius: 12px;
    padding: 2rem;
    margin: 2.5rem 0;
    border-left: 4px solid var(--accent-primary);
}

.note-header {
    font-family: var(--font-head);
    font-size: 0.9rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-weight: 800;
}

.academy-tip {
    background: rgba(245, 158, 11, 0.1);
    border: 1px dashed rgba(245, 158, 11, 0.4);
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    color: var(--accent-highlight);
}

.briefing-panel {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 2.5rem;
    border-radius: var(--radius-main);
    margin-bottom: 3rem;
}

.lecture-body ul {
    margin: 1.5rem 0 2rem 1.5rem;
}

.lecture-body li {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.lecture-body code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    color: var(--accent-primary);
}

/* ==========================================================================
   Quiz Interface
   ========================================================================== */
.quiz-box {
    background: var(--bg-side);
    padding: 3rem;
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
}

.question-counter {
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    display: block;
}

.question-text {
    font-size: 1.6rem;
    margin-bottom: 2.5rem;
    color: #fff;
    font-weight: 600;
}

.options-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.option-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.option-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(10px);
}

.option-card.correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.option-card.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-danger);
    color: #fca5a5;
}

/* Responsive */
@media (max-width: 1024px) {
    .resumen-layout {
        grid-template-columns: 1fr;
    }

    .academy-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}