/* ===========================
   CSS VARIABLES & RESET
   =========================== */

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

:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #10b981;
    --accent: #00e5ff;
    --accent2: #7c3aed;
    --accent3: #f59e0b;
    --green: #10b981;
    --red: #ef4444;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --surface: #f8fafc;
    --card: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --muted: #6b7280;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --navbar-bg: #ffffff;
    --gradient: linear-gradient(135deg, #8b5cf6 0%, #10b981 100%);
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
}

[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --surface: #1a1a2e;
    --card: #16161f;
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --muted: #6b6b85;
    --border: #252535;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --navbar-bg: #0a0a0f;
    --code-bg: #0d0d14;
    --code-text: #c8c8e8;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(0,229,255,.03) 1px,transparent 1px),
                      linear-gradient(90deg,rgba(0,229,255,.03) 1px,transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ===========================
   HERO SECTION
   =========================== */

.hero {
    background: var(--gradient);
    padding: 4rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--border);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.hero-highlight {
    color: var(--accent);
}

.hero-para {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-stats span {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .hero {
    background: linear-gradient(to right, #111827, #1f2937);
}

[data-theme="dark"] .hero-para {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .hero-h1 {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .hero-stats span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border: 1px solid #7c3aed;
}

/* ===========================
   MAIN CONTAINER
   =========================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}

/* ===========================
   CONTROLS PANEL
   =========================== */

.controls-panel {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    border: 2px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

@media (max-width: 768px) {
    .controls-panel {
        grid-template-columns: 1fr;
    }
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.difficulty-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.diff-btn {
    flex: 1;
    min-width: 90px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

.diff-btn.active[data-diff="beginner"] {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--green);
    color: var(--green);
}

.diff-btn.active[data-diff="mid"] {
    background: rgba(245, 158, 11, 0.12);
    border-color: var(--accent3);
    color: var(--accent3);
}

.diff-btn.active[data-diff="faang"] {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--red);
    color: var(--red);
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.topic-select {
    width: 100%;
    padding: 12px 36px 12px 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s ease;
    appearance: none;
}

.topic-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.topic-select option {
    background: var(--bg-card);
}

.select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.generate-btn {
    padding: 13px 28px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
}

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

.generate-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ===========================
   NO MATCH SECTION
   =========================== */

.no-match {
    text-align: center;
    padding: 60px 24px;
    display: none;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    margin-bottom: 30px;
}

.no-match-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--muted);
}

.no-match-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.no-match-sub {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.no-match-link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ===========================
   QUESTION CARD
   =========================== */

.question-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px var(--shadow);
}

.question-card.visible {
    display: block;
}

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

.card-header {
    padding: 20px 24px;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tag-beginner {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-mid {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent3);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag-faang {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.tag-topic {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.diff-dots {
    display: flex;
    gap: 3px;
}

.diff-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.diff-dot.active-b {
    background: var(--green);
}

.diff-dot.active-m {
    background: var(--accent3);
}

.diff-dot.active-f {
    background: var(--red);
}

.card-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    color: var(--muted);
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ===========================
   TABS
   =========================== */

.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--surface);
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 14px 22px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    transition: all 0.3s ease;
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    padding: 28px 24px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===========================
   STATS BAR
   =========================== */

.stats-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.stat {
    flex: 1;
    min-width: 120px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ===========================
   QUESTION CONTENT
   =========================== */

.question-title {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 16px;
}

.question-description {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 15px;
    margin-bottom: 20px;
}

.hint-box {
    margin-top: 20px;
    padding: 16px;
    background: rgba(139, 92, 246, 0.05);
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    display: flex;
    gap: 12px;
}

.hint-icon {
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.hint-text {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.hint-text strong {
    color: var(--primary);
}

/* ===========================
   CODE BLOCKS
   =========================== */

.code-block {
    background: var(--code-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
}

.code-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn {
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

.copy-btn.copied {
    color: var(--green);
}

pre {
    padding: 20px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--code-text);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

pre::-webkit-scrollbar {
    height: 6px;
}

pre::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* ===========================
   SYNTAX HIGHLIGHTING
   =========================== */

.kw { color: #7c3aed; font-weight: 600; }
.fn { color: #06b6d4; }
.str { color: #10b981; }
.num { color: #f59e0b; }
.cm { color: #4a4a65; font-style: italic; }
.tbl { color: #f472b6; }
.col { color: #93c5fd; }

/* ===========================
   SCHEMA DIAGRAM
   =========================== */

.schema-diagram {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.schema-table {
    background: var(--code-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    min-width: 200px;
    flex: 1;
}

.schema-table-header {
    background: var(--surface);
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.schema-table-header::before {
    content: '▣';
    font-size: 11px;
    color: var(--muted);
}

.schema-col {
    padding: 10px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    border-bottom: 1px solid rgba(37,37,53,0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schema-col:last-child {
    border-bottom: none;
}

.col-name { color: var(--primary); }
.col-type { color: var(--accent3); font-size: 11px; }
.col-pk { color: var(--green); font-size: 10px; letter-spacing: 1px; margin-left: 6px; }
.col-fk { color: var(--accent); font-size: 10px; letter-spacing: 1px; margin-left: 6px; }

/* ===========================
   OUTPUT TABLE
   =========================== */

.output-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 2px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

thead tr {
    background: var(--surface);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(139, 92, 246, 0.03);
}

.null-val {
    color: var(--muted);
    font-style: italic;
}

/* ===========================
   SOLUTION SECTION
   =========================== */

.solution-gate {
    text-align: center;
    padding: 60px 24px;
}

.solution-gate-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--primary);
    opacity: 0.7;
}

.solution-gate-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.solution-gate-text {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.reveal-btn {
    padding: 14px 32px;
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: 12px;
    color: var(--primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.reveal-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
    transform: translateY(-2px);
}

.solution-content {
    display: none;
}

.solution-content.shown {
    display: block;
    animation: fadeIn 0.4s ease;
}

.section-label {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===========================
   SOLUTION STEPS
   =========================== */

.steps {
    margin-top: 24px;
}

.step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.step-num {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: rgba(139, 92, 246, 0.1);
    border: 2px solid rgba(139, 92, 246, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 1px;
}

.step-body {
    flex: 1;
}

.step-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.step-desc {
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.7;
}

/* ===========================
   HISTORY LIST
   =========================== */

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.history-item {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.history-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.history-q {
    font-size: 13.5px;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

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

/* ===========================
   EMPTY STATE
   =========================== */

.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--muted);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    opacity: 0.5;
    color: var(--primary);
}

.empty-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-sub {
    font-size: 14px;
}

/* ===========================
   NOTIFICATION
   =========================== */

.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 16px 24px;
    background: var(--gradient);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    transform: translateX(400px);
    transition: transform 0.4s ease;
    z-index: 1000;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--card);
    border: 2px solid var(--green);
    color: var(--green);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    z-index: 1000;
    animation: toastIn 0.3s ease;
    box-shadow: 0 4px 20px var(--shadow);
}

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

/* ===========================
   ANIMATIONS
   =========================== */

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

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

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

@media (max-width: 768px) {
    .hero-h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero-para {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .hero-stats span {
        padding: 6px 15px;
        font-size: 0.9rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .controls-panel {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .difficulty-tabs {
        flex-direction: row;
    }

    .diff-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-meta {
        width: 100%;
    }

    .card-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .tabs {
        overflow-x: auto;
    }

    .tab {
        padding: 12px 16px;
        font-size: 12px;
    }

    .stats-bar {
        flex-direction: column;
        gap: 10px;
    }

    .stat {
        min-width: 100%;
    }

    .step {
        flex-direction: column;
        gap: 8px;
    }

    .step-num {
        margin-bottom: 5px;
    }

    .schema-diagram {
        flex-direction: column;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-meta {
        width: 100%;
        justify-content: space-between;
    }

    .cookie-buttons {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        justify-content: center;
    }

    .cookie-settings-buttons {
        flex-direction: column;
    }

    .cookie-settings-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .diff-btn {
        min-width: auto;
        padding: 8px 12px;
    }

    .generate-btn {
        width: 100%;
        justify-content: center;
    }

    .card-header {
        padding: 15px 20px;
    }

    .card-actions {
        justify-content: space-between;
    }

    .icon-btn {
        width: 42px;
        height: 42px;
    }

    .tab {
        padding: 10px 12px;
        font-size: 11px;
    }

    .tab-content {
        padding: 20px 16px;
    }

    .question-title {
        font-size: 1.1rem;
    }

    .question-description {
        font-size: 14px;
    }

    .hint-box {
        flex-direction: column;
        gap: 10px;
    }

    .hint-icon {
        font-size: 20px;
    }

    pre {
        padding: 16px;
        font-size: 12px;
    }

    th, td {
        padding: 8px 12px;
        font-size: 12px;
    }

    .notification {
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        transform: translateY(-100px);
    }

    .notification.show {
        transform: translateY(0);
    }

    .toast {
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        text-align: center;
    }
}