/* ==============================================================================
 * Mentifyll: Töltsd fel az elméd! — Fő Stíluslap (Google Material 3 Design)
 * Készítők: Kormos Attila és a Google Gemini valamint Claude Opus
 * ============================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 74px; /* Hely az alsó navigációs sávnak mobilon */
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Tipográfia */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-heading);
    font-weight: 700;
    letter-spacing: -0.01em;
}

p {
    color: var(--color-card-text);
}

/* Felső Fejléc (Google M3 App Bar) */
.app-header {
    position: sticky;
    top: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s, border-color 0.2s;
    height: 56px;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.brand-logo {
    width: 28px;
    height: 28px;
}

.brand-text h1 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-heading);
    line-height: 1.1;
}

.brand-text .slogan {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--color-primary);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.energy-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--color-yellow-container);
    color: var(--color-yellow-dark);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Fő Konténer */
.app-content {
    flex: 1;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-md);
}

/* Kártyák (Google Material Elevation & Card) */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s, border-color 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-card-title);
    margin-bottom: var(--space-xs);
    line-height: 1.3;
}

/* Napi Cél Gyűrű & Töltődés */
.charge-meter-box {
    text-align: center;
    padding: var(--space-lg) 0;
}

.charge-meter {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: conic-gradient(var(--color-primary) calc(var(--charge-pct, 45) * 1%), var(--color-border) 0);
    box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.2);
}

.charge-meter-inner {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.charge-pct-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-heading);
}

.charge-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Gombok (Google Material Rounded Buttons) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-target-min);
    padding: 0 var(--space-lg);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
    width: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(var(--color-primary-rgb), 0.3);
}

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

.btn-secondary {
    background: var(--color-surface-variant);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border);
}

.btn-accent {
    background: var(--color-yellow);
    color: #0f172a;
    font-weight: 700;
}

.btn-accent:hover {
    background: var(--color-yellow-dark);
    color: #ffffff;
}

/* Űrlap Elemek (Google Input) */
.form-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-main);
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}

/* Diktálás mikrofon animáció */
@keyframes pulse-mic {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.04); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.mic-active {
    background: #ef4444 !important;
    color: #ffffff !important;
    animation: pulse-mic 1.5s infinite;
}

/* Alsó Mobil Navigáció (Google Bottom Navigation) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: var(--color-bottom-nav);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
    z-index: 200;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    transition: background-color 0.2s, border-color 0.2s;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    height: 100%;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    transition: color 0.15s, transform 0.15s;
    padding: 2px 2px;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2px;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
    font-size: 0.64rem;
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-add-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-indigo));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(var(--color-primary-rgb), 0.4);
    transition: transform 0.15s;
    margin-bottom: 2px;
}

.nav-add-btn svg {
    width: 20px !important;
    height: 20px !important;
}

.nav-add-btn:active {
    transform: scale(0.92);
}

/* Szűrő Gombok & Jelvények (Chips & Badges) */
.filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

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

.filter-btn.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-remember { background: #e0f2fe; color: #0369a1; }
.badge-understand { background: #dcfce7; color: #15803d; }
.badge-apply { background: #fef3c7; color: #b45309; }
.badge-analyze { background: #f3e8ff; color: #6b21a8; }

.badge-draft { background: var(--color-surface-variant); color: var(--color-text-muted); }
.badge-flagged { background: #fee2e2; color: #b91c1c; }
.badge-approved { background: #dcfce7; color: #15803d; }

/* Lábjegyzet */
.app-footer {
    text-align: center;
    padding: var(--space-md) var(--space-sm);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Reszponzivitás (Mobil: < 600px és < 400px) */
@media (max-width: 600px) {
    .app-header {
        padding: 0 var(--space-sm);
        height: 52px;
    }
    .brand-text .slogan {
        display: none !important;
    }
    .brand-text h1 {
        font-size: 1.05rem !important;
    }
    .brand-logo {
        width: 26px !important;
        height: 26px !important;
    }
    #system-status-indicator {
        display: none !important;
    }
    .header-status {
        gap: 4px !important;
    }
    .header-status .btn {
        padding: 4px 6px !important;
        font-size: 0.8rem !important;
    }
    .energy-badge {
        padding: 3px 8px !important;
        font-size: 0.75rem !important;
    }
    .app-content {
        padding: var(--space-sm) !important;
    }
    .card {
        padding: var(--space-md) !important;
        border-radius: var(--radius-md) !important;
        margin-bottom: var(--space-sm) !important;
    }
    .card-title {
        font-size: 1.05rem !important;
    }
}

@media (max-width: 400px) {
    .app-header {
        padding: 0 4px;
    }
    .brand-text h1 {
        font-size: 0.95rem !important;
    }
    .header-status {
        gap: 2px !important;
    }
}

/* Reszponzivitás (Tablet & Desktop) */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
    .bottom-nav {
        display: none;
    }
}

/* Nyomtatási Stílus (Worksheet Print View) */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding-bottom: 0 !important;
    }
    .app-header, .bottom-nav, .app-footer, .no-print, button {
        display: none !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    .print-only {
        display: block !important;
    }
}

/* =============================================================================
   Gyakorló felület (F6) - Választó gombok és Magabiztossági tabletták
   ============================================================================= */
.confidence-pill {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-card-border);
    background: var(--color-card-bg);
    color: var(--color-text-main);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    user-select: none;
}

.confidence-pill:hover {
    border-color: var(--color-primary);
}

.confidence-pill.active {
    background: var(--color-primary);
    color: #ffffff !important;
    border-color: var(--color-primary);
    font-weight: 600;
}

.mcq-choice-btn {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-card-border);
    background: var(--color-card-bg);
    color: var(--color-text-main);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.mcq-choice-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-neutral-subtle);
}

.mcq-choice-btn.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}

/* Elemzés és Hőtérkép Stílusok (Phase F7) */
.analytics-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-pill-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-pill-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-heading);
    line-height: 1.2;
}

.stat-pill-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 4px;
}

/* Mesterségi Szint Jelvények */
.mastery-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
}

.mastery-master {
    background: #e0f2f1;
    color: #00695c;
    border: 1px solid #80cbc4;
}

.mastery-proficient {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.mastery-practicing {
    background: #fff8e1;
    color: #b78103;
    border: 1px solid #ffe082;
}

.mastery-familiar {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.mastery-new {
    background: #f5f5f5;
    color: #616161;
    border: 1px solid #e0e0e0;
}

/* Sötét téma specifikus felülírás a mesterségi jelvényekhez a magas kontrasztért */
body.theme-dark .mastery-master {
    background: #004d40;
    color: #80cbc4;
    border-color: #00897b;
}

body.theme-dark .mastery-proficient {
    background: #1b5e20;
    color: #a5d6a7;
    border-color: #2e7d32;
}

body.theme-dark .mastery-practicing {
    background: #78350f;
    color: #fde68a;
    border-color: #d97706;
}

body.theme-dark .mastery-familiar {
    background: #7f1d1d;
    color: #fca5a5;
    border-color: #dc2626;
}

body.theme-dark .mastery-new {
    background: #334155;
    color: #cbd5e1;
    border-color: #475569;
}

/* Kvadráns Mátrix Kártyák */
.quadrant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.quadrant-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid var(--color-border);
    transition: transform 0.2s ease;
}

.quadrant-card.fast-good {
    border-left: 5px solid #00897b;
}

.quadrant-card.slow-good {
    border-left: 5px solid #2e7d32;
}

.quadrant-card.fast-bad {
    border-left: 5px solid #ef4444;
}

.quadrant-card.slow-bad {
    border-left: 5px solid #d97706;
}

/* Heti AI Riport Dobozok */
.report-praise-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 5px solid #22c55e;
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
}

body.theme-dark .report-praise-box {
    background: #064e3b;
    border-color: #059669;
    color: #e2e8f0;
}

.report-trouble-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 5px solid #f59e0b;
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
}

body.theme-dark .report-trouble-box {
    background: #78350f;
    border-color: #d97706;
    color: #fef3c7;
}

.report-parent-box {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-left: 5px solid #0d9488;
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
}

body.theme-dark .report-parent-box {
    background: #134e4a;
    border-color: #14b8a6;
    color: #ccfbf1;
}

/* =============================================================================
   Témazáró Dolgozat Modul (Phase F8) - Stílusok
   ============================================================================= */
.exam-timer-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--color-surface-variant);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.exam-timer-warning {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #ef4444 !important;
    animation: pulse-timer 1s infinite alternate;
}

body.theme-dark .exam-timer-warning {
    background: #7f1d1d !important;
    color: #fecaca !important;
    border-color: #f87171 !important;
}

@keyframes pulse-timer {
    from { transform: scale(1); }
    to { transform: scale(1.04); }
}

.exam-nav-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 2px;
    margin-bottom: 16px;
    scrollbar-width: thin;
}

.exam-nav-pill {
    min-width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-main);
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.exam-nav-pill:hover {
    border-color: var(--color-indigo);
    background: var(--color-surface-hover);
}

.exam-nav-pill.current {
    border-color: var(--color-indigo);
    background: var(--color-indigo);
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.25);
}

.exam-nav-pill.answered {
    border-color: #10b981;
    background: #ecfdf5;
    color: #047857;
}

body.theme-dark .exam-nav-pill.answered {
    background: #064e3b;
    color: #a7f3d0;
    border-color: #10b981;
}

.exam-nav-pill.answered.current {
    background: var(--color-indigo) !important;
    color: #ffffff !important;
    border-color: var(--color-indigo) !important;
}

.exam-grade-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    font-size: 3.2rem;
    font-weight: 900;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin: 0 auto 12px auto;
    line-height: 1;
}

.exam-grade-5 { background: linear-gradient(135deg, #10b981, #059669); }
.exam-grade-4 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.exam-grade-3 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.exam-grade-2 { background: linear-gradient(135deg, #f97316, #c2410c); }
.exam-grade-1 { background: linear-gradient(135deg, #ef4444, #b91c1c); }

.unit-select-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-main);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.unit-select-chip:hover {
    border-color: var(--color-indigo);
    background: var(--color-surface-hover);
}

.unit-select-chip.selected {
    border-color: var(--color-indigo);
    background: var(--color-indigo-container);
    color: var(--color-indigo-text);
    font-weight: 600;
}

body.theme-dark .unit-select-chip.selected {
    background: #312e81;
    color: #c7d2fe;
    border-color: #6366f1;
}

.exam-history-item {
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.exam-history-item:hover {
    border-color: var(--color-indigo);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* =============================================================================
   Játékosítás & Avatar Modul (Phase F9) - Stílusok
   ============================================================================= */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.badge-card {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    user-select: none;
}

.badge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.badge-card.earned {
    border-color: #f59e0b;
    background: linear-gradient(180deg, var(--color-surface) 60%, rgba(245, 158, 11, 0.08));
}

.badge-card.earned .badge-icon-box {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

body.theme-dark .badge-card.earned .badge-icon-box {
    background: #78350f;
    border-color: #fbbf24;
}

.badge-card.locked {
    opacity: 0.6;
    background: var(--color-surface-variant);
    filter: grayscale(0.8);
}

.badge-card.locked:hover {
    opacity: 0.85;
    filter: grayscale(0.3);
}

.badge-icon-box {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--color-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.badge-card:hover .badge-icon-box {
    transform: scale(1.08);
}

.avatar-preview-container {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 14px auto;
    border: 4px solid var(--color-indigo);
    box-shadow: 0 8px 24px rgba(67, 56, 202, 0.25);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.avatar-preview-container:hover {
    transform: scale(1.03);
}

.avatar-preview-container img,
.avatar-preview-container svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-gallery-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 4px;
    margin-top: 10px;
    scrollbar-width: thin;
}

.avatar-gallery-thumb {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.avatar-gallery-thumb:hover {
    border-color: var(--color-indigo);
    transform: scale(1.1);
}

.avatar-gallery-thumb.selected {
    border-color: var(--color-indigo);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.35);
}

.avatar-gallery-thumb img,
.avatar-gallery-thumb svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==============================================================================
 * F10: AI-Tutor („Kérdezz!”) Stílusok (Material 3)
 * ============================================================================== */

.tutor-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tutor-header-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
}

.tutor-threads-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 2px;
    scrollbar-width: thin;
}

.tutor-thread-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--color-surface-variant);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tutor-thread-chip:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-container);
    color: var(--color-primary-dark);
}

.tutor-thread-chip.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(25, 195, 181, 0.4);
}

.tutor-chat-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-height: 480px;
    max-height: 72vh;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.tutor-chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-variant);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tutor-mode-toggle {
    display: flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    padding: 2px;
    gap: 2px;
}

.tutor-mode-btn {
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tutor-mode-btn.active {
    background: var(--color-primary);
    color: #ffffff;
}

.tutor-messages-stream {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--color-bg);
}

.tutor-message-row {
    display: flex;
    gap: 10px;
    max-width: 85%;
}

.tutor-message-row.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.tutor-message-row.assistant {
    align-self: flex-start;
}

.tutor-avatar-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.tutor-avatar-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tutor-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.tutor-message-row.user .tutor-bubble {
    background: var(--color-primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.tutor-message-row.assistant .tutor-bubble {
    background: var(--color-surface);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.tutor-bubble-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-bottom: 6px;
}

.tutor-bubble-badge.grounded {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.tutor-bubble-badge.general {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.tutor-bubble-badge.flagged {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.tutor-quick-prompts-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 14px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    scrollbar-width: none;
}

.tutor-prompt-chip {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    background: var(--color-primary-container);
    border: 1px solid var(--color-border);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tutor-prompt-chip:hover {
    background: var(--color-primary);
    color: #ffffff;
}

.tutor-composer {
    padding: 10px 14px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tutor-composer-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.tutor-composer textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    resize: none;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1.5px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text-main);
    outline: none;
    transition: border-color 0.2s;
}

.tutor-composer textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(25, 195, 181, 0.2);
}

/* =============================================================================
 * Phase F12: WCAG 2.1 AA/AAA Akadálymentesség, Magas Kontraszt & Sötét Téma
 * Készítők: Kormos Attila és a Google Gemini valamint Claude Opus
 * ============================================================================= */

/* Fókuszgyűrűk billentyűzetes navigációhoz */
:focus-visible {
    outline: 2px solid var(--color-primary) !important;
    outline-offset: 2px !important;
}

/* Reduced motion támogatás */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Google M3 Sötét Mód Automatikus Nagy Kontrasztú Korrekciók */
body.theme-dark, .theme-dark {
    color: #f1f5f9;
}

body.theme-dark strong[style*="color:#15803d"],
body.theme-dark strong[style*="color:#047857"],
body.theme-dark strong[style*="color:#166534"],
body.theme-dark strong[style*="color:#2e7d32"],
body.theme-dark [style*="color:#15803d"],
body.theme-dark [style*="color:#166534"],
body.theme-dark [style*="color:#047857"],
body.theme-dark [style*="color:#2e7d32"] {
    color: #34d399 !important; /* Élénk smaragdzöld a fekete/sötétzöld helyett */
}

body.theme-dark strong[style*="color:#b45309"],
body.theme-dark strong[style*="color:#92400e"],
body.theme-dark strong[style*="color:#d97706"],
body.theme-dark [style*="color:#b45309"],
body.theme-dark [style*="color:#92400e"],
body.theme-dark [style*="color:#d97706"] {
    color: #fbbf24 !important; /* Fényes borostyánsárga a sötétbarna helyett */
}

body.theme-dark strong[style*="color:#0f766e"],
body.theme-dark strong[style*="color:#00897b"],
body.theme-dark strong[style*="color:#00695c"],
body.theme-dark [style*="color:#0f766e"],
body.theme-dark [style*="color:#00897b"],
body.theme-dark [style*="color:#00695c"] {
    color: #2dd4bf !important; /* Ragyogó cián-türkiz a sötétkék/sötétpetrol helyett */
}

body.theme-dark div[style*="color:#450a0a"],
body.theme-dark div[style*="color:#7f1d1d"],
body.theme-dark span[style*="color:#7f1d1d"],
body.theme-dark [style*="color:#991b1b"],
body.theme-dark [style*="color:#b91c1c"],
body.theme-dark [style*="color:#450a0a"] {
    color: #fca5a5 !important; /* Világos korall/rózsaszín a sötétbordó helyett */
}

body.theme-dark [style*="color:#0369a1"] {
    color: #38bdf8 !important; /* Világoskék a sötétkék helyett */
}

body.theme-dark [style*="background:#fef2f2"],
body.theme-dark [style*="background:#fee2e2"] {
    background: rgba(239, 68, 68, 0.16) !important;
    border-color: rgba(248, 113, 113, 0.35) !important;
    color: #fca5a5 !important;
}

body.theme-dark [style*="background:#ecfdf5"],
body.theme-dark [style*="background:#dcfce7"],
body.theme-dark [style*="background:#f0fdf4"],
body.theme-dark [style*="background:#e8f5e9"],
body.theme-dark [style*="background:#e0f2f1"] {
    background: rgba(16, 185, 129, 0.16) !important;
    border-color: rgba(52, 211, 153, 0.35) !important;
    color: #6ee7b7 !important;
}

body.theme-dark [style*="background:#fffbeb"],
body.theme-dark [style*="background:#fef3c7"] {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(251, 191, 36, 0.35) !important;
    color: #fde68a !important;
}

body.theme-dark [style*="background:#e0f2fe"] {
    background: rgba(56, 189, 248, 0.16) !important;
    border-color: rgba(56, 189, 248, 0.35) !important;
    color: #7dd3fc !important;
}

body.theme-dark [style*="border-color:#fca5a5"] {
    border-color: rgba(248, 113, 113, 0.45) !important;
}

body.theme-dark [style*="border-color:#bbf7d0"] {
    border-color: rgba(52, 211, 153, 0.45) !important;
}

body.theme-dark .quadrant-card.fast-good strong,
body.theme-dark .quadrant-card.fast-good {
    color: #2dd4bf !important;
    background: rgba(45, 212, 191, 0.1) !important;
    border-color: rgba(45, 212, 191, 0.25) !important;
}

body.theme-dark .quadrant-card.slow-good strong,
body.theme-dark .quadrant-card.slow-good {
    color: #34d399 !important;
    background: rgba(52, 211, 153, 0.1) !important;
    border-color: rgba(52, 211, 153, 0.25) !important;
}

body.theme-dark .quadrant-card.fast-bad strong,
body.theme-dark .quadrant-card.fast-bad {
    color: #f87171 !important;
    background: rgba(248, 113, 113, 0.1) !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}

body.theme-dark .quadrant-card.slow-bad strong,
body.theme-dark .quadrant-card.slow-bad {
    color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: rgba(251, 191, 36, 0.25) !important;
}

/* ==========================================================================
   Google Material 3 Toast Értesítési Stack
   ========================================================================== */
.toast-stack-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    color: var(--color-text-main);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--color-card-border);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast-item.toast-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    line-height: 1;
}

.toast-close:hover {
    background: var(--color-neutral-subtle);
    color: var(--color-text-main);
}

.toast-item.toast-success {
    border-left: 4px solid var(--color-teal);
}

.toast-item.toast-error {
    border-left: 4px solid var(--color-coral);
}

.toast-item.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-item.toast-info {
    border-left: 4px solid var(--color-primary);
}

/* ==========================================================================
   3D Tanulókártya (Flashcard) Animáció
   ========================================================================== */
.flashcard-3d-container {
    perspective: 1000px;
    margin-bottom: 16px;
    cursor: pointer;
}

.flashcard-3d-inner {
    position: relative;
    width: 100%;
    min-height: 120px;
    text-align: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 12px;
}

.flashcard-3d-container.flipped .flashcard-3d-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--color-card-border);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.flashcard-front {
    border-left: 4px solid var(--color-coral);
}

.flashcard-back {
    transform: rotateY(180deg);
    border-left: 4px solid var(--color-teal);
    background: var(--color-surface-variant);
}

.flashcard-content {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 8px 0;
    color: var(--color-card-title);
}

/* ==========================================================================
   XP és Haladási Sáv Shimmer Fényeffekt
   ========================================================================== */
@keyframes xpShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

#rewards-level-progress-bar {
    background: linear-gradient(90deg, var(--color-primary) 0%, #38bdf8 50%, var(--color-primary) 100%);
    background-size: 200% 100%;
    animation: xpShimmer 3s infinite linear;
}

/* ==========================================================================
   Lebegő Üveg (Glassmorphism) Fejléc
   ========================================================================== */
.app-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.88);
    transition: box-shadow 0.3s ease;
}

body.theme-dark .app-header {
    background: rgba(15, 23, 42, 0.88);
}

/* Kártya finom lebegés és élénk mikro-interakció */
.card {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mcq-choice-btn {
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.mcq-choice-btn:active {
    transform: scale(0.98);
}

/* ==========================================================================
   Nyomtatási Stíluslap (@media print) — Hivatalos Feladatlap Nyomtatás
   ========================================================================== */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }

    .app-header,
    .nav-bar,
    .modal-backdrop,
    .toast-stack-container,
    #system-status-indicator,
    #btn-toggle-sound,
    #btn-toggle-theme-header,
    button,
    .filter-bar {
        display: none !important;
    }

    .container, main {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
    }

    .worksheet-header {
        border-bottom: 2pt solid #000000 !important;
        margin-bottom: 24pt !important;
    }

    .worksheet-line {
        border-bottom: 1pt dashed #666666 !important;
    }

    .worksheet-task {
        page-break-inside: avoid;
        border-bottom: 1pt solid #cccccc !important;
        margin-bottom: 20pt !important;
        padding-bottom: 12pt !important;
    }
}



