/* ==========================================================================
   KÓDOLÁSTECHNIKA (BMEVIHIAB04) - ZH FELKÉSZÍTŐ PORTÁL
   Styling System: Cyber-Academic Glassmorphism & High-Contrast Dark Mode
   ========================================================================== */

:root {
    --bg-base: #060913;
    --bg-surface: #0c1222;
    --bg-card: rgba(15, 23, 42, 0.78);
    --bg-card-hover: rgba(23, 34, 61, 0.88);
    --bg-card-active: rgba(30, 45, 80, 0.95);
    
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.35);
    --primary-hover: #7dd3fc;
    
    --accent: #a855f7;
    --accent-glow: rgba(168, 85, 247, 0.35);
    --accent-hover: #c084fc;
    
    --emerald: #34d399;
    --emerald-glow: rgba(52, 211, 153, 0.35);
    --emerald-bg: rgba(52, 211, 153, 0.12);
    
    --amber: #fbbf24;
    --amber-glow: rgba(251, 191, 36, 0.35);
    --amber-bg: rgba(251, 191, 36, 0.12);
    
    --rose: #f43f5e;
    --rose-glow: rgba(244, 63, 94, 0.35);
    --rose-bg: rgba(244, 63, 94, 0.12);
    
    --cyan: #06b6d4;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(56, 189, 248, 0.35);
    --border-active: rgba(168, 85, 247, 0.5);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.15);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Cyber Mesh */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(52, 211, 153, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.portal-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 80px 20px;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   TOP BAR & NAVIGATION
   ========================================================================== */

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.breadcrumb-tag {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-tag span {
    color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.header-title-wrap {
    margin-bottom: 24px;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 30%, var(--primary) 70%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ==========================================================================
   HAMBURGER DROPDOWN
   ========================================================================== */

.hamburger-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.hamburger-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.hamburger-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 260px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
    backdrop-filter: blur(16px);
}

.hamburger-dropdown.open {
    display: flex;
    animation: dropdownFade 0.2s ease forwards;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary);
}

.dropdown-item.active {
    background: rgba(56, 189, 248, 0.2);
    color: #ffffff;
    font-weight: 600;
}

/* ==========================================================================
   SUBNAV CONTROLS & PILLS
   ========================================================================== */

.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.subnav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subnav-pill {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.subnav-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--primary);
}

.subnav-pill.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(168, 85, 247, 0.2));
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 16px var(--primary-glow);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.2);
    color: var(--primary);
}

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

.btn-secondary:hover {
    background: rgba(244, 63, 94, 0.12);
    color: var(--rose);
    border-color: var(--rose);
}

/* Filter pill tags */
.topic-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.filter-tag {
    padding: 5px 12px;
    font-size: 0.82rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-tag:hover {
    color: var(--text-primary);
    border-color: var(--primary);
}

.filter-tag.active {
    background: rgba(56, 189, 248, 0.18);
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

/* ==========================================================================
   QUIZ CARDS & GRIDS (IGAZ/HAMIS & FELELETVÁLASZTÓS)
   ========================================================================== */

.quiz-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.quiz-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(12px);
    position: relative;
}

.quiz-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.quiz-card-tags {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.statement-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 18px;
    line-height: 1.6;
}

.tf-actions {
    display: flex;
    gap: 12px;
}

.tf-btn {
    flex: 1;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.tf-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--primary);
}

.tf-btn.selected-correct {
    background: var(--emerald-bg) !important;
    border-color: var(--emerald) !important;
    color: var(--emerald) !important;
    box-shadow: 0 0 16px var(--emerald-glow);
}

.tf-btn.selected-wrong {
    background: var(--rose-bg) !important;
    border-color: var(--rose) !important;
    color: var(--rose) !important;
    box-shadow: 0 0 16px var(--rose-glow);
}

.tf-btn.highlight-correct {
    border-color: var(--emerald) !important;
    color: var(--emerald) !important;
}

/* Multiple choice options */
.mc-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.mc-option-btn {
    width: 100%;
    padding: 14px 16px;
    text-align: left;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.15s ease;
}

.mc-option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.mc-option-btn.selected-correct {
    background: var(--emerald-bg) !important;
    border-color: var(--emerald) !important;
    color: var(--emerald) !important;
    font-weight: 600;
}

.mc-option-btn.selected-wrong {
    background: var(--rose-bg) !important;
    border-color: var(--rose) !important;
    color: var(--rose) !important;
}

.mc-option-btn.highlight-correct {
    border-color: var(--emerald) !important;
    color: var(--emerald) !important;
    font-weight: 600;
}

.option-prefix {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Explanation Box */
.explanation-box {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: rgba(56, 189, 248, 0.08);
    border-left: 3px solid var(--primary);
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    animation: fadeIn 0.25s ease;
    white-space: pre-line;
}

.explanation-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   KIDOLGOZOTT SZÁMOLÁSOS FELADATOK
   ========================================================================== */

.calc-grid {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.calc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
    transition: border-color 0.2s ease;
}

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

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

.calc-type-badge {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent);
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.calc-source-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.calc-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.calc-problem-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 22px;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.65;
    white-space: pre-line;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
}

.step-box {
    background: rgba(12, 18, 34, 0.65);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.step-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-content {
    font-size: 0.94rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-line;
}

.final-answer-box {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--emerald-bg);
    border: 1px solid rgba(52, 211, 153, 0.3);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.final-answer-icon {
    color: var(--emerald);
    flex-shrink: 0;
}

.final-answer-text {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--emerald);
}

.exam-tip-box {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--amber-bg);
    border: 1px solid rgba(251, 191, 36, 0.25);
    font-size: 0.88rem;
    color: var(--amber);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: pre-line;
}

/* ==========================================================================
   KÉPLET- ÉS SZABÁLYTÁR (CHEAT SHEET)
   ========================================================================== */

.cheat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.cheat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.cheat-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cheat-item {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cheat-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.cheat-item-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.cheat-formula-display {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    overflow-x: auto;
    overflow-y: hidden;
}

.cheat-formula-display .katex-display {
    margin: 6px 0 !important;
}

.cheat-item-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* MathJax / KaTeX adjustments */
.katex-display {
    margin: 8px 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
}

.katex-display::-webkit-scrollbar,
.cheat-formula-display::-webkit-scrollbar {
    height: 4px;
}

.katex-display::-webkit-scrollbar-track,
.cheat-formula-display::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.katex-display::-webkit-scrollbar-thumb,
.cheat-formula-display::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.25);
    border-radius: 4px;
}

.katex-display::-webkit-scrollbar-thumb:hover,
.cheat-formula-display::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.6rem;
    }
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .subnav-pills {
        width: 100%;
        justify-content: stretch;
    }
    .subnav-pill {
        flex: 1;
        justify-content: center;
    }
    .cheat-grid {
        grid-template-columns: 1fr;
    }
}

