/* ============================================================
   AMA-400 Team Lead Interview App — Styles
   ============================================================ */

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

/* ---- Design tokens ---- */
:root {
    --primary-blue: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --accent-green: #059669;
    --accent-orange: #ea580c;
    --bg-light: #f3f4f6;
    --bg-white: #ffffff;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --border-gray: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg-answered: #f0fdf4;
    --page-bg: var(--bg-light);
    --app-shell-bg: var(--bg-light);
    --sidebar-width: 220px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --primary-blue: #3b82f6;
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;
    --accent-green: #34d399;
    --accent-orange: #fb923c;
    --bg-light: #1f2937;
    --bg-white: #111827;
    --text-dark: #f3f4f6;
    --text-gray: #9ca3af;
    --border-gray: #374151;
    --success: #10b981;
    --warning: #fbbf24;
    --error: #f87171;
    --bg-answered: #065f46;
    --page-bg: #020617;
    --app-shell-bg: #020617;
}

/* ---- Scrollbars ---- */
* {
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 #e5e7eb;
}

html[data-theme="dark"] * {
    scrollbar-color: #60a5fa #1f2937;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e40af;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1f2937;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #60a5fa;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #93c5fd;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--page-bg);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 10px auto 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: var(--app-shell-bg);
}

/* ============================================================
   LAYOUT
   ============================================================ */

.main-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--app-shell-bg);
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-gray);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease, min-width 0.2s ease;
    box-shadow: 1px 0 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

/* Collapsed state */
.sidebar--collapsed {
    width: 44px;
    min-width: 44px;
}

.sidebar--collapsed .sidebar-stats,
.sidebar--collapsed .sidebar-divider,
.sidebar--collapsed .sidebar-browse {
    display: none;
}

.sidebar--collapsed .sidebar-collapse-btn .collapse-text {
    display: none;
}

.sidebar--collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

/* Stats block */
.sidebar-stats {
    display: flex;
    justify-content: space-around;
    padding: 1rem 0.5rem 0.875rem;
    flex-shrink: 0;
}

.sidebar-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.sidebar-stat__value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.sidebar-stat__value--answered {
    color: var(--primary-blue);
}

.sidebar-stat__value--complete {
    color: var(--accent-green);
}

.sidebar-stat__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-gray);
    font-weight: 500;
}

/* Divider */
.sidebar-divider {
    height: 1px;
    background: var(--border-gray);
    flex-shrink: 0;
}

/* Browse section */
.sidebar-browse {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.sidebar-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.875rem 0.875rem 0.5rem;
}

/* Category list items */
.category-list {
    display: flex;
    flex-direction: column;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.875rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-dark);
    border-radius: 0;
    transition: background 0.12s ease;
    min-height: 36px;
    border-left: 2px solid transparent;
}

.category-item:hover {
    background: var(--bg-light);
}

.category-item.active {
    background: color-mix(in srgb, var(--primary-blue) 10%, transparent);
    border-left-color: var(--primary-blue);
    color: var(--primary-blue);
}

.category-item__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-item__name {
    flex: 1;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-item__count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-gray);
    background: var(--bg-light);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
}

.category-item.active .category-item__count {
    background: color-mix(in srgb, var(--primary-blue) 15%, transparent);
    color: var(--primary-blue);
}

/* Collapse button */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0.875rem;
    background: none;
    border: none;
    border-top: 1px solid var(--border-gray);
    color: var(--text-gray);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.sidebar-collapse-btn:hover {
    color: var(--text-dark);
}

.sidebar-collapse-btn svg {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

.content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--app-shell-bg);
}

/* ---- Content header (mode switcher + title + sparkline + more actions) ---- */

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 2rem 0.875rem;
    flex-shrink: 0;
    gap: 1rem;
}

.content-header__left {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
}

.content-header__right {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-shrink: 0;
}

/* Mode switcher pill */
.mode-switcher {
    display: flex;
    background: var(--bg-light);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-height: 30px;
}

.mode-btn:hover {
    color: var(--text-dark);
    background: var(--bg-white);
}

.mode-btn.active {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.view-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.view-title__accent {
    color: var(--primary-light);
}

/* Sparkline */
.sparkline {
    width: 100px;
    height: 28px;
    opacity: 0.85;
    flex-shrink: 0;
}

/* More actions dropdown */
.more-actions-wrapper {
    position: relative;
}

.more-actions-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    color: var(--text-dark);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-height: 32px;
}

.more-actions-btn:hover,
.more-actions-btn.active {
    border-color: var(--primary-light);
    color: var(--primary-blue);
}

/* Theme toggle button */
.theme-toggle-btn {
    display: inline-block;
    padding: 0.55rem 0.875rem;
    background: none;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    color: var(--text-gray);
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.theme-toggle-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary-blue);
    background: color-mix(in srgb, var(--primary-light) 5%, transparent);
}

@media (hover: hover) {
    .theme-toggle-btn:hover {
        border-color: var(--primary-light);
        color: var(--primary-blue);
    }
}

.more-actions-menu {
    position: fixed;
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14);
    min-width: 210px;
    z-index: 1000;
    overflow: hidden;
    padding: 4px 0;
}

.menu-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-dark);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.1s;
}

.menu-item:hover {
    background: var(--bg-light);
    color: var(--primary-blue);
}

.menu-item--danger {
    color: var(--error);
}

.menu-item--danger:hover {
    background: color-mix(in srgb, var(--error) 8%, transparent);
    color: var(--error);
}

.menu-divider {
    height: 1px;
    background: var(--border-gray);
    margin: 4px 0;
}

/* ---- Filter bar ---- */

.filter-bar {
    display: flex;
    gap: 0.625rem;
    padding: 0 2rem 0.875rem;
    align-items: stretch;
    flex-shrink: 0;
}

#search-input,
#status-filter,
#sort-select {
    padding: 0.55rem 0.875rem;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    background-color: var(--bg-white);
    color: var(--text-dark);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-height: 36px;
}

#search-input {
    flex: 1;
    min-width: 0;
}

#status-filter,
#sort-select {
    flex-shrink: 0;
}

#search-input:focus,
#status-filter:focus,
#sort-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-light) 20%, transparent);
}

.clear-filters-btn {
    padding: 0.4rem 0.75rem;
    background: none;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    color: var(--text-gray);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.clear-filters-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

/* ============================================================
   VIEWS
   ============================================================ */

.view {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.view.active {
    display: flex;
    flex-direction: column;
}

/* ============================================================
   QUESTION GRID
   ============================================================ */

#question-list-view {
    padding: 0 2rem 2rem;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    align-content: start;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-gray);
    padding: 3rem 2rem;
    font-size: 0.95rem;
}

/* ============================================================
   QUESTION CARDS
   ============================================================ */

.question-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-left: 4px solid var(--card-category-color, var(--border-gray));
    border-radius: 10px;
    padding: 1.25rem;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.question-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.question-card.answered {
    background-color: var(--bg-answered);
}

/* Card header: badges + star */
.card-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    flex-wrap: nowrap;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.category-badge {
    background-color: var(--card-category-color, var(--primary-light));
    color: white;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.answered-badge {
    background-color: var(--success);
    color: white;
}

.unanswered-badge {
    background-color: var(--warning);
    color: white;
}

/* Star / favorite button */
.star-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--border-gray);
    padding: 0.1rem 0.25rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s ease, transform 0.1s ease;
}

@media (hover: hover) {
    .star-btn:hover {
        color: var(--warning);
        transform: scale(1.2);
    }
}

.star-btn--active {
    color: var(--warning);
}

/* Evidence strength badge */
.evidence-strength-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    font-weight: 700;
}

.strength-posting-derived  { background-color: #0891b2; color: white; }
.strength-process-derived  { background-color: #7c3aed; color: white; }
.strength-resume-derived   { background-color: #059669; color: white; }
.strength-evidence-derived { background-color: #0d9488; color: white; }
.strength-historical       { background-color: #dc2626; color: white; }
.strength-strong-inference { background-color: #9333ea; color: white; }
.strength-package-derived  { background-color: #16a34a; color: white; }

.card-title {
    font-size: 1rem;
    font-weight: 600;
    padding-top: 0.75rem;
    padding-bottom: 0.375rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    line-height: 1.4;
}

html[data-theme="dark"] .card-title {
    color: #ffffff;
}

.card-notes {
    display: none;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background-color: transparent;
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-gray);
    opacity: 0.65;
}

/* ============================================================
   PRACTICE MODE
   ============================================================ */

#practice-mode-view {
    padding: 0 2rem 2rem;
}

.practice-header {
    margin-bottom: 1.5rem;
    padding-top: 0.25rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--border-gray);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--accent-green));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-gray);
}

.practice-container {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.question-display {
    background-color: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.question-meta {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.question-meta .badge {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

#q-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.4;
}

html[data-theme="dark"] #q-title {
    color: #ffffff;
}

.question-notes {
    background-color: var(--bg-light);
    border-left: 4px solid var(--primary-light);
    padding: 0.875rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    font-size: 0.925rem;
    color: var(--text-dark);
    line-height: 1.6;
}

.question-source-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.source-label {
    color: var(--text-gray);
    font-weight: 600;
}

.source-value {
    color: var(--text-gray);
    font-style: italic;
}

.confidence-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
}

.confidence-high {
    background-color: var(--success);
    color: white;
}

.confidence-medium-high {
    background-color: var(--warning);
    color: white;
}

.confidence-medium {
    background-color: var(--text-gray);
    color: white;
}

/* In practice mode, allow category badge to show full text untruncated */
.question-meta .category-badge {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

/* Question-type badge — neutral pill, secondary metadata */
.question-type-badge {
    background-color: var(--bg-light);
    color: var(--text-gray);
    border: 1px solid var(--border-gray);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}

[data-theme="dark"] .question-type-badge {
    background-color: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.12);
}

/* In practice mode, category badge shows full text — no truncation */
.question-meta .category-badge {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

#q-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.response-workspace {
    background-color: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-gray);
}

.response-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.response-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#response-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    background-color: var(--bg-white);
    color: var(--text-dark);
    transition: all 0.2s ease;
}

#response-textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-light) 20%, transparent);
}

.response-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-gray);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-gray);
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--warning);
}

.status-indicator.answered {
    background-color: var(--success);
}

.timestamp {
    font-style: italic;
}

.navigation-controls {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
}

.button-nav {
    flex: 1;
    max-width: 30%;
    padding: 0.7rem 1.25rem;
    background-color: var(--primary-blue);
    color: white;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.925rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    min-height: 42px;
}

/* Previous — blue tint, passive navigation */
.button-nav--prev {
    background-color: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.40);
    color: white;
}

.button-nav--prev:hover:not(:disabled) {
    background-color: rgba(59, 130, 246, 0.22);
    border-color: rgba(59, 130, 246, 0.65);
    box-shadow: none;
}

.button-nav--prev:disabled {
    opacity: 1;
    border-color: rgba(59, 130, 246, 0.35);
    cursor: not-allowed;
}

/* Back to List — amber tint, exit action */
.button-nav--back {
    background-color: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.40);
    color: #fbbf24;
}

.button-nav--back:hover:not(:disabled) {
    background-color: rgba(251, 191, 36, 0.20);
    border-color: rgba(251, 191, 36, 0.65);
    box-shadow: none;
}

/* Next — solid primary blue, dominant forward action */
.button-nav--next {
    background-color: var(--primary-blue);
    color: white;
    border-color: transparent;
}

.button-nav--next:hover:not(:disabled) {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.35);
}

.button-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.button-sm {
    padding: 0.5rem 1rem;
    background-color: var(--accent-green);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    touch-action: manipulation;
}

.button-sm:hover {
    background-color: #059669;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: var(--success);
}

.toast.error {
    background-color: var(--error);
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 1024px) {
    .sidebar {
        width: 100%;
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-gray);
        flex-direction: row;
        max-height: 80px;
        overflow-x: auto;
    }

    .sidebar-stats {
        flex-shrink: 0;
    }

    .sidebar-divider {
        display: none;
    }

    .sidebar-browse {
        display: flex;
        gap: 1rem;
        padding-bottom: 0;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .sidebar-label {
        padding: 0;
        font-size: 0.6rem;
        margin-right: 0.5rem;
    }

    .category-list {
        display: flex;
        gap: 0.5rem;
    }

    .sidebar-collapse-btn {
        border-top: none;
        border-left: 1px solid var(--border-gray);
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .content-header {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .sidebar {
        max-height: none;
        flex-direction: column;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-gray);
        padding: 1rem;
    }

    .sidebar-browse {
        flex-direction: column;
        gap: 0;
    }

    .sidebar-label {
        padding: 0.5rem 0 0.25rem;
    }

    .sidebar-collapse-btn {
        border-left: none;
        border-top: 1px solid var(--border-gray);
        margin-top: 0.5rem;
    }

    .content {
        overflow-y: auto;
    }

    .content-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .content-header__left {
        flex-direction: column;
        width: 100%;
    }

    .view-title {
        font-size: 1.25rem;
    }

    .content-header__right {
        width: 100%;
        flex-wrap: wrap;
    }

    .sparkline {
        display: none;
    }

    .filter-bar {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0 1rem 0.5rem;
    }

    #search-input,
    #status-filter,
    #sort-select {
        width: 100%;
    }

    #question-list-view {
        padding: 0 1rem 1rem;
    }

    #practice-mode-view {
        padding: 0 1rem 1rem;
    }

    .question-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .question-card {
        padding: 1rem;
    }

    .question-display {
        padding: 1rem;
    }

    .response-workspace {
        padding: 1rem;
    }

    .response-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .response-controls {
        width: 100%;
        flex-direction: column;
    }

    .button-sm {
        width: 100%;
    }

    .navigation-controls {
        flex-direction: column;
        gap: 0.75rem;
    }

    .button-nav {
        width: 100%;
    }

    .practice-container {
        gap: 1rem;
    }

    #response-textarea {
        min-height: 150px;
    }

    .card-header {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .view-title {
        font-size: 1.1rem;
    }

    .mode-switcher {
        min-width: auto;
    }

    .mode-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .more-actions-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .filter-bar {
        padding: 0 0.5rem 0.5rem;
    }

    #search-input,
    #status-filter,
    #sort-select {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    .question-card {
        padding: 0.875rem;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .card-notes {
        font-size: 0.8rem;
    }

    #q-title {
        font-size: 1.2rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }
}
