/* ============================================
   ChemLearner - Mobile-First CSS
   ============================================ */

/* CSS Variables */
:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --bottom-nav-height: 64px;
    --header-height: 56px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   App Container & Layout
   ============================================ */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: var(--bottom-nav-height);
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.header-spacer {
    width: 40px;
}

/* Tab Navigation (Desktop) */
.tab-nav {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 16px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

.view-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.view-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gray-800);
}

/* ============================================
   Bottom Navigation (Mobile)
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: white;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 1000;
}

.bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    background: none;
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: var(--border-radius-sm);
}

.bottom-nav-btn:active {
    transform: scale(0.95);
}

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

.bottom-nav-btn.active svg {
    stroke: var(--primary);
}

/* ============================================
   Category Drawer
   ============================================ */

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1001;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.category-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: white;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.category-drawer.open {
    transform: translateX(0);
}

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

.drawer-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.add-category-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 16px;
    padding: 12px 16px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius-sm);
    background: none;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.add-category-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.category-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.category-item:hover {
    background: var(--gray-100);
}

.category-item.active {
    background: var(--primary-light);
}

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

.category-info {
    flex: 1;
    min-width: 0;
}

.category-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.category-count {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.category-mastery {
    flex: 1;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.mastery-fill {
    height: 100%;
    background: var(--success);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.category-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.category-item:hover .category-actions {
    opacity: 1;
}

.category-action-btn {
    padding: 4px;
    border: none;
    background: none;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.category-action-btn:hover {
    color: var(--gray-700);
    background: var(--gray-200);
}

.category-action-btn.delete:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* ============================================
   Forms & Inputs
   ============================================ */

.question-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--gray-800);
    background: white;
    transition: all 0.2s;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Textarea in symbol picker wrapper needs different alignment */
.input-with-symbol-picker textarea {
    resize: vertical;
    min-height: 80px;
}

.input-with-symbol-picker textarea + .symbol-picker-trigger {
    align-self: flex-start;
    margin-top: 8px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Checkbox */
.checkbox-group {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    transition: all 0.2s;
    position: relative;
}

.checkbox-label input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ============================================
   Buttons
   ============================================ */

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.icon-btn:active {
    transform: scale(0.95);
}

.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: var(--primary);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.primary-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.secondary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    background: white;
    color: var(--gray-700);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.danger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: var(--danger);
    color: white;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.danger-btn:hover {
    background: #dc2626;
}

/* Button Loading State */
.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-loading.hidden,
.btn-text.hidden {
    display: none;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   Recent Questions
   ============================================ */

.recent-questions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.recent-questions h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
}

.recent-item .category-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
}

.recent-item p {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Question Bank
   ============================================ */

.bank-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.bank-filters {
    display: flex;
    gap: 12px;
}

.bank-filters select {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.875rem;
}

.question-bank {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    transition: all 0.2s;
}

.question-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.question-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.category-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
}

.difficulty-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--gray-200);
    color: var(--gray-700);
}

.difficulty-tag.easy {
    background: var(--success-light);
    color: #065f46;
}

.difficulty-tag.moderate {
    background: var(--warning-light);
    color: #92400e;
}

.difficulty-tag.hard {
    background: var(--danger-light);
    color: #991b1b;
}

.mastery-badge {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}

.mastery-badge svg {
    width: 14px;
    height: 14px;
}

.question-card-text {
    font-size: 0.9375rem;
    color: var(--gray-800);
    margin-bottom: 8px;
    line-height: 1.5;
}

.question-card-answer {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.question-card-answer strong {
    color: var(--success);
    font-weight: 500;
}

.question-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.question-card-actions button {
    padding: 8px 12px;
    font-size: 0.8125rem;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--gray-400);
    text-align: center;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.empty-state span {
    font-size: 0.875rem;
}

.empty-state.hidden {
    display: none;
}

/* ============================================
   Quiz Section
   ============================================ */

.quiz-setup {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quiz-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Active Quiz */
.quiz-active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.quiz-active.hidden {
    display: none;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    white-space: nowrap;
}

.quiz-question {
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
}

.question-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.question-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.6;
}

.quiz-options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    color: var(--gray-800);
    text-align: left;
    width: 100%;
}

.quiz-option:hover:not(.selected):not(.correct):not(.incorrect) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.quiz-option:active {
    transform: scale(0.98);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.quiz-option.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.quiz-option.incorrect {
    border-color: var(--danger);
    background: var(--danger-light);
}

.quiz-option.disabled {
    pointer-events: none;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.quiz-option.selected .option-letter {
    background: var(--primary);
    color: white;
}

.quiz-option.correct .option-letter {
    background: var(--success);
    color: white;
}

.quiz-option.incorrect .option-letter {
    background: var(--danger);
    color: white;
}

/* Quiz Feedback */
.quiz-feedback {
    padding: 20px;
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.quiz-feedback.hidden {
    display: none;
}

.quiz-feedback.correct {
    background: var(--success-light);
}

.quiz-feedback.incorrect {
    background: var(--danger-light);
}

#feedback-text {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.quiz-feedback.correct #feedback-text {
    color: #065f46;
}

.quiz-feedback.incorrect #feedback-text {
    color: #991b1b;
}

.quiz-feedback .primary-btn {
    width: auto;
    display: inline-flex;
}

/* Quiz Results */
.quiz-results {
    text-align: center;
}

.quiz-results.hidden {
    display: none;
}

.quiz-results h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.results-score {
    margin-bottom: 32px;
}

.score-value {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
}

.score-label {
    font-size: 1.25rem;
    color: var(--gray-500);
}

.results-breakdown {
    margin-bottom: 32px;
}

.results-breakdown h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-category {
    flex: 1;
    text-align: left;
}

.breakdown-category .category-tag {
    font-size: 0.75rem;
}

.breakdown-score {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.breakdown-bar {
    width: 100px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.breakdown-bar-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
}

.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.results-actions button {
    width: auto;
}

/* ============================================
   Modals
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 2000;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-small {
    max-width: 360px;
    text-align: center;
}

.modal-small h3 {
    margin-bottom: 8px;
}

.modal-small p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions button {
    width: auto;
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--gray-800);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--gray-800);
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    left: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 3000;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--gray-800);
    color: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    pointer-events: auto;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(16px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.toast.warning {
    background: var(--warning);
    color: var(--gray-800);
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

.toast-close {
    padding: 4px;
    border: none;
    background: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
}

.toast-close:hover {
    opacity: 1;
}

/* ============================================
   Desktop Styles (768px+)
   ============================================ */

@media (min-width: 768px) {
    :root {
        --bottom-nav-height: 0px;
    }

    .app-container {
        padding-bottom: 0;
        padding-left: 280px;
    }

    /* Desktop Header */
    .app-header {
        padding: 16px 24px;
    }

    .menu-btn {
        display: none;
    }

    .header-spacer {
        display: none;
    }

    /* Desktop Tab Nav */
    .tab-nav {
        display: flex;
        gap: 8px;
        padding: 0 24px 16px;
        background: white;
        border-bottom: 1px solid var(--gray-200);
    }

    .tab-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        border: none;
        background: none;
        color: var(--gray-500);
        font-size: 0.875rem;
        font-weight: 500;
        cursor: pointer;
        border-radius: var(--border-radius-sm);
        transition: all 0.2s;
    }

    .tab-btn:hover {
        background: var(--gray-100);
        color: var(--gray-700);
    }

    .tab-btn.active {
        background: var(--primary-light);
        color: var(--primary);
    }

    /* Hide Bottom Nav */
    .bottom-nav {
        display: none;
    }

    /* Category Drawer as Sidebar */
    .drawer-overlay {
        display: none;
    }

    .category-drawer {
        position: fixed;
        transform: translateX(0);
        border-right: 1px solid var(--gray-200);
        box-shadow: none;
    }

    #close-drawer {
        display: none;
    }

    /* Main Content */
    .main-content {
        padding: 24px;
        max-width: 900px;
    }

    .view-container {
        padding: 32px;
    }

    /* Toast Position */
    .toast-container {
        bottom: 24px;
        left: auto;
        right: 24px;
        width: 360px;
    }

    /* Bank Header */
    .bank-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .bank-filters {
        flex: 0 0 auto;
    }

    .bank-filters select {
        width: 160px;
    }
}

/* ============================================
   Large Desktop (1024px+)
   ============================================ */

@media (min-width: 1024px) {
    .view-container {
        padding: 40px;
    }

    .question-bank {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .empty-state {
        grid-column: span 2;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================
   Symbol Picker
   ============================================ */

/* Input wrapper for symbol trigger */
.input-with-symbol-picker {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.input-with-symbol-picker input,
.input-with-symbol-picker textarea {
    flex: 1;
}

.symbol-trigger-wrapper {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-top: 2px;
}

.symbol-trigger-wrapper .trigger-label {
    font-size: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--gray-400);
    white-space: nowrap;
}

.symbol-trigger-wrapper:hover .trigger-label {
    color: var(--primary);
}

.symbol-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    background: white;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.symbol-picker-trigger .trigger-symbol {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1;
}

.symbol-picker-trigger:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.symbol-picker-trigger:active {
    transform: scale(0.95);
}

/* Symbol Picker Panel */
.symbol-picker {
    position: fixed;
    width: 420px;
    max-height: 480px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.symbol-picker.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.symbol-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.symbol-picker-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
}

.symbol-picker-close {
    width: 32px;
    height: 32px;
}

/* Search */
.symbol-picker-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    background: white;
}

.symbol-picker-search svg {
    color: var(--gray-400);
    flex-shrink: 0;
}

.symbol-picker-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.875rem;
    color: var(--gray-800);
    padding: 0;
}

.symbol-picker-search input::placeholder {
    color: var(--gray-400);
}

/* Body */
.symbol-picker-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Category Tabs */
.symbol-categories {
    width: 100px;
    flex-shrink: 0;
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    background: var(--gray-50);
    padding: 8px 0;
}

.symbol-category-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 10px 8px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.symbol-category-tab:hover {
    background: var(--gray-100);
}

.symbol-category-tab.active {
    background: white;
    border-right: 2px solid var(--primary);
    margin-right: -1px;
}

.symbol-category-tab .tab-icon {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-600);
}

.symbol-category-tab.active .tab-icon {
    color: var(--primary);
}

.symbol-category-tab .tab-name {
    font-size: 0.65rem;
    color: var(--gray-500);
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 80px;
}

.symbol-category-tab.active .tab-name {
    color: var(--gray-700);
    font-weight: 500;
}

/* Symbol Grid Container */
.symbol-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 0;
}

/* Symbol Grid */
.symbol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

.symbol-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: white;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 64px;
}

.symbol-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.symbol-btn:active {
    transform: translateY(0);
}

.symbol-char {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1;
}

.symbol-btn:hover .symbol-char {
    color: var(--primary);
}

.symbol-name {
    font-size: 0.625rem;
    color: var(--gray-500);
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Search Results */
.symbol-search-group {
    margin-bottom: 16px;
}

.symbol-search-group:last-child {
    margin-bottom: 0;
}

.symbol-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-200);
}

.symbol-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

/* Empty State */
.symbol-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Mobile Adjustments */
@media (max-width: 479px) {
    .symbol-picker {
        max-height: 60vh;
    }

    .symbol-categories {
        width: 70px;
    }

    .symbol-category-tab {
        padding: 8px 4px;
    }

    .symbol-category-tab .tab-name {
        font-size: 0.6rem;
        max-width: 60px;
    }

    .symbol-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 6px;
    }

    .symbol-btn {
        padding: 8px 4px;
        min-height: 56px;
    }

    .symbol-char {
        font-size: 1.125rem;
    }

    .symbol-name {
        font-size: 0.5625rem;
    }
}

/* Tablet and up - better trigger positioning */
@media (min-width: 768px) {
    .symbol-picker-trigger {
        width: 40px;
        height: 40px;
    }
}
