/* ==========================================================================
   RESET, DESIGN ENGINE VARIATIONS & THEMES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --clr-teal: #12b0a2;
    --clr-teal-hover: #0e8f83;
    --body-bg: #1b2738;
    --clr-dark-navy: #122758;
    --bg-header: #070d16;
    --clr-slate-text: #1e293b;
    --clr-muted-gray: #64748b;

    --clr-bio: #12b0a2;
    --clr-chem: #0ea5e9;
    --clr-phys: #6366f1;

    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --radius-section: 22px;
    --radius-element: 12px;
    --radius-pill: 30px;

    --transition-smooth: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-workspace: #f4f6f9;
    --bg-card: #2e2a2a;
    --border-line: #e2e8f0;

    --text-primary: #1e293b;
    --text-secondary: #64748b;

    --bg-input-field: #f1f5f9;
}

[data-theme="dark"] {
    --bg-workspace: #070d16;
    --bg-card: #191f29;
    --border-line: #1a2942;

    --text-primary: #eeeded;
    --text-secondary: #94a3b8;

    --bg-input-field: #1a2638;
}

body {
    font-family: var(--font-stack);
    background-color: var(--body-bg);
    color: var(--text-primary);
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   NAVIGATION / HEADER PANEL
   ========================================================================== */
.tablet-header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-line);
    height: 70px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 80px;
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background-color: var(--clr-teal);
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo svg {
    width: 18px;
    height: 18px;
}

.brand-text {
    display: flex;
    gap: 4px;
    font-size: 1rem;
    font-weight: 700;
}

.brand-name {
    color: var( --clr-teal);
}

.brand-tag {
    color: white;
}

.header-right-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.tablet-nav {
    display: flex;
    gap: 18px;
}

.nav-item {
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.nav-item:hover,
.nav-item.active {
    color: var(--clr-teal);
}

/* Toggle Switch Styling */
.theme-toggle-container {
    display: flex;
    align-items: center;
}

.switch-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch-toggle input {
    display: none;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border-radius: 34px;
    transition: 0.3s;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

[data-theme="dark"] .switch-slider {
    background-color: #1e293b;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    z-index: 2;
}

input:checked+.switch-slider:before {
    transform: translateX(22px);
}

.switch-icon {
    font-size: 10px;
    user-select: none;
}

/* ==========================================================================
   SEARCH & INTERACTIVE FILTER AREA
   ========================================================================== */
.filter-wrapper-section {
    padding: 24px 0 16px 0;
}

.search-filter-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-line);
    border-radius: var(--radius-section);
    padding: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.search-input-container {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
}

.search-icon-svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.search-field-control {
    width: 100%;
    background-color: var(--bg-input-field);
    border: 1px solid transparent;
    border-radius: var(--radius-element);
    padding: 14px 16px 14px 46px;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition-smooth);
}

.search-field-control:focus {
    outline: none;
    border-color: var(--clr-teal);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px var(--clr-teal-alpha);
}

.filter-rows-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-interactive-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-input-field);
    border-radius: var(--radius-element);
    padding: 14px 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.filter-interactive-row:hover {
    border-color: var(--border-line);
    background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .filter-interactive-row:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.filter-row-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-value-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
}

/* ==========================================================================
   RECENTLY STUDIED HEADER STRIP
   ========================================================================== */
.history-banner-section {
    padding: 8px 0;
    display: none;
}

.recently-studied-container {
    background-color: var(--bg-history-block);
    border-radius: var(--radius-section);
    padding: 16px 20px;
    color: #ffffff;
}

.history-headline {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #12b0a2;
    margin-bottom: 12px;
}

.history-strip-card {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-element);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.history-icon-box {
    width: 38px;
    height: 38px;
    background-color: rgba(18, 176, 162, 0.15);
    color: #12b0a2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-icon-box svg {
    width: 20px;
    height: 20px;
}

.history-details-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-title {
    font-size: 1rem;
    font-weight: 600;
}

.history-meta-text {
    font-size: 0.82rem;
    color: #94a3b8;
}

/* ==========================================================================
   WIDE QUIZ SELECTION ELEMENT ROWS
   ========================================================================== */
.quiz-list-section {
    padding: 16px 0 48px 0;
}

.wide-cards-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wide-quiz-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-line);
    border-radius: var(--radius-section);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition-smooth);
}

.wide-quiz-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

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

.subject-icon-pill {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subject-icon-pill svg {
    width: 18px;
    height: 18px;
    color: #ffffff;
}

.icon-bg-biology {
    background-color: var(--clr-bio);
}

.icon-bg-chemistry {
    background-color: var(--clr-chem);
}

.icon-bg-physics {
    background-color: var(--clr-phys);
}

.difficulty-level-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
}

.level-inter {
    background-color: rgba(18, 176, 162, 0.1);
    color: var(--clr-teal);
}

.level-begin {
    background-color: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.level-adv {
    background-color: #0b1424;
    color: #f87171;
}

[data-theme="dark"] .level-adv {
    background-color: rgba(248, 113, 113, 0.1);
}

.card-mid-body {
    margin-bottom: 18px;
}

.subject-category-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 4px;
}

.text-biology {
    color: var(--clr-bio);
}

.text-chemistry {
    color: #0ea5e9;
}

.text-physics {
    color: #70bd29;
}

.quiz-main-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: white;
}

.question-metric-text {
    font-size: 0.880rem;
    color: var(--text-secondary);
}

/* Action Trigger Configuration */
.btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: var(--radius-element);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
}

.btn-primary {
    background-color: var(--clr-teal);
    color: #ffffff;
    width: 100%;
}

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

/* ==========================================================================
   ADAPTIVE BREAKPOINTS ADJUSTMENT
   ========================================================================== */
@media (min-width: 600px) {
    .wide-quiz-card {
        padding: 24px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
    }

    .card-meta-header {
        margin-bottom: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        flex-shrink: 0;
    }

    .card-mid-body {
        margin-bottom: 0;
        flex-grow: 1;
    }

    .btn-action-trigger {
        width: auto;
        min-width: 140px;
        flex-shrink: 0;
    }
}