/* ==================== VARIABLES ==================== */
:root {
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --primary-light: #BBDEFB;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #F44336;
    --white: #FFFFFF;
    --background: #F5F5F5;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 300px;
    --max-content-width: 1400px;
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* ==================== APP CONTAINER - FULL WIDTH ==================== */
.app-container {
    width: 100%;
    max-width: var(--max-content-width);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--white);
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 70px;
}

/* ==================== BOTTOM NAVIGATION ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-content-width);
    display: flex;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    gap: 4px;
}

.nav-item i {
    font-size: 24px;
}

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

.nav-item:hover {
    background: var(--primary-light);
}

/* ==================== CARDS ==================== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin: 16px;
    box-shadow: var(--shadow);
}

.card-header {
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius) var(--radius) 0 0;
    margin: -20px -20px 20px -20px;
    padding: 20px;
}

.card-blue {
    background: var(--primary-color);
    color: var(--white);
}

.card-yellow {
    background: #FFF8E1;
    border: 1px solid #FFE082;
}

.card-green {
    background: #E8F5E9;
    border: 1px solid #A5D6A7;
}

/* ==================== EDIT PAGE ==================== */
.search-container {
    padding: 16px 24px;
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

/* Category Filter */
.category-filter {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    justify-content: center;
}

.filter-radio {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.3s;
    background: var(--white);
}

.filter-radio:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.filter-radio input[type="radio"] {
    margin: 0;
    margin-right: 8px;
    cursor: pointer;
}

.filter-radio input[type="radio"]:checked + span {
    font-weight: 600;
}

.filter-radio:has(input:checked) {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.filter-radio span {
    font-size: 14px;
}

.category-count-pill {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
    background: rgba(26, 115, 232, 0.12);
    border: 1px solid rgba(26, 115, 232, 0.22);
    color: var(--primary-color);
}

.category-count-pill:empty {
    display: none;
}

.filter-radio:has(input:checked) .category-count-pill {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    color: var(--white);
}

.search-input {
    width: 100%;
    max-width: 600px;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.vocabulary-list {
    padding: 16px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
}

.vocab-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.vocab-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.vocab-info {
    flex: 1;
}

.vocab-word {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Category Badges */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge-general {
    background: #4CAF50;
    color: var(--white);
}

.category-badge-toeic {
    background: #FF9800;
    color: var(--white);
}

.category-badge-vstep {
    background: #9C27B0;
    color: var(--white);
}

.category-badge-speaking {
    background: #2196F3;
    color: var(--white);
}

.category-badge-writing {
    background: #607D8B;
    color: var(--white);
}

.category-badge-popular {
    background: #E91E63;
    color: var(--white);
}

.vocab-stats {
    font-size: 13px;
    color: var(--text-secondary);
}

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

.vocab-actions button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
    font-size: 16px;
}

.vocab-actions button:hover {
    transform: scale(1.1);
}

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

.delete-item-btn {
    background: #FFEBEE;
    color: var(--danger-color);
}

/* FAB */
.fab {
    position: fixed;
    bottom: 100px;
    right: 40px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s, background 0.3s;
    z-index: 50;
}

.fab:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* ==================== LEARN PAGE - DESKTOP LAYOUT ==================== */
.learn-container {
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    grid-template-rows: auto auto 1fr auto;
    gap: 20px;
    min-height: calc(100vh - 70px);
}

/* Header Card - Full width */
.header-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 32px;
    border-radius: var(--radius);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.current-word {
    font-size: 36px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.current-word:hover {
    opacity: 0.8;
}

.current-word i {
    font-size: 24px;
}

.vietnamese-hint {
    font-size: 24px;
    font-style: italic;
    opacity: 0.9;
    white-space: pre-wrap;
    word-break: break-word;
}

.examples-count {
    font-size: 14px;
    opacity: 0.7;
}

.settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.3s;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main learning area - Left side */
.input-card {
    grid-column: 1;
    grid-row: 2 / 4;
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.answer-input {
    width: 100%;
    flex: 1;
    min-height: 200px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 18px;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
    font-family: inherit;
}

.answer-input:focus {
    border-color: var(--primary-color);
}

/* Action Buttons */
.action-buttons {
    grid-column: 1;
    display: flex;
    gap: 16px;
}

.action-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.check-btn {
    background: var(--primary-color);
    color: var(--white);
}

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

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

.skip-btn:hover {
    background: #BDBDBD;
}

.next-btn {
    background: var(--success-color);
    color: var(--white);
}

.next-btn:hover:not(:disabled) {
    background: #388E3C;
}

.next-btn:disabled {
    background: #C8E6C9;
    cursor: not-allowed;
}

/* Sidebar - Right side */
.queue-card {
    grid-column: 2;
    grid-row: 2;
    background: #FFF8E1;
    border: 1px solid #FFE082;
    border-radius: var(--radius);
    padding: 16px;
    max-height: 300px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.queue-title {
    font-size: 14px;
    font-weight: 600;
    color: #F57C00;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.word-queue {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

.queue-item {
    padding: 8px 12px;
    background: var(--white);
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid #FFE082;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.queue-item:hover {
    transform: scale(1.05);
}

.queue-item.current {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.queue-item.passed {
    background: #E8F5E9;
    border-color: var(--success-color);
    color: var(--success-color);
}

.queue-item-word {
    font-weight: 500;
}

.queue-item-stats {
    font-size: 11px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Days ago badges */
.days-ago {
    background: var(--warning-color);
    color: var(--white);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    opacity: 1;
}

.days-ago-urgent {
    background: var(--danger-color);
    color: var(--white);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    opacity: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Goal Card - Sidebar */
.goal-card {
    grid-column: 2;
    grid-row: 3;
    background: #E8F5E9;
    border: 1px solid #A5D6A7;
    border-radius: var(--radius);
    padding: 20px;
}

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

.goal-title {
    font-weight: 600;
    color: #2E7D32;
    font-size: 16px;
}

.goal-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.goal-time.warning {
    color: var(--warning-color);
}

.goal-time.danger {
    color: var(--danger-color);
}

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

.progress-text {
    font-size: 28px;
    font-weight: 700;
    color: #2E7D32;
}

.progress-bar-container {
    flex: 1;
    min-width: 100px;
    height: 12px;
    background: #C8E6C9;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--success-color);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.level-badge {
    background: #2E7D32;
    color: var(--white);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.debt-message {
    margin-top: 12px;
    font-size: 14px;
    color: var(--danger-color);
    font-weight: 500;
}

/* Progress Card - Below header */
.progress-card {
    grid-column: 1 / -1;
    grid-row: 1;
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 24px;
    box-shadow: var(--shadow);
    text-align: center;
    display: none; /* Hidden on desktop, show in header instead */
}

.sentence-progress {
    font-size: 18px;
    color: var(--text-secondary);
}

.sentence-progress span {
    font-weight: 700;
    color: var(--primary-color);
}

/* Error Details Card */
.error-card {
    grid-column: 1;
    background: #FFEBEE;
    border: 1px solid #FFCDD2;
    border-radius: var(--radius);
    padding: 20px;
}

.error-card.hidden {
    display: none;
}

.error-title {
    font-weight: 600;
    color: var(--danger-color);
    margin-bottom: 16px;
    font-size: 16px;
}

.correct-answers {
    margin-bottom: 16px;
}

.correct-answers-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.correct-answer-item {
    padding: 12px 16px;
    background: var(--white);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 15px;
}

.comparison-section {
    margin-top: 16px;
}

.comparison-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.comparison-content {
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius-sm);
}

.similarity-score {
    font-size: 15px;
    margin-bottom: 12px;
}

.similarity-score span {
    font-weight: 700;
}

.char-comparison {
    font-family: 'Roboto Mono', monospace;
    font-size: 15px;
    line-height: 2;
    word-break: break-all;
}

.char-correct {
    color: var(--success-color);
}

.char-wrong {
    color: var(--danger-color);
    background: #FFEBEE;
    text-decoration: underline;
}

.char-missing {
    color: var(--warning-color);
    background: #FFF8E1;
}

/* Grammar Section (used in both error and success cards) */
.grammar-section {
    margin-top: 16px;
    padding: 16px;
    background: #F3E5F5;
    border: 1px solid #E1BEE7;
    border-radius: var(--radius-sm);
}

.grammar-title {
    font-size: 14px;
    font-weight: 600;
    color: #7B1FA2;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grammar-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    font-style: italic;
    white-space: pre-wrap;
}

/* Success Details Card */
.success-card {
    grid-column: 1;
    background: #E8F5E9;
    border: 1px solid #C8E6C9;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.success-card.hidden {
    display: none;
}

.success-title {
    font-weight: 600;
    color: var(--success-color);
    margin-bottom: 16px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Instructions Card */
.instructions-card {
    grid-column: 2;
    grid-row: 4;
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.instructions-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.instructions-list {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 20px;
}

.instructions-list li {
    margin-bottom: 6px;
}

/* ==================== DIALOGS ==================== */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.dialog-overlay.hidden {
    display: none;
}

.dialog {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.dialog-header h2 {
    font-size: 20px;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
}

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

.dialog-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.dialog-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--primary-color);
}

/* Radio Groups in Dialogs */
.radio-group {
    display: flex;
    gap: 16px;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s;
    background: var(--white);
    flex: 1;
    justify-content: center;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.radio-label input[type="radio"] {
    margin: 0;
    margin-right: 8px;
    cursor: pointer;
}

.radio-label:has(input:checked) {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    font-weight: 500;
}

.input-with-btn {
    display: flex;
    gap: 12px;
}

.input-with-btn input {
    flex: 1;
}

.speak-btn {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--primary-color);
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
}

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

.examples-container {
    margin-top: 20px;
}

.example-item {
    background: #F5F5F5;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.example-item label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

.example-item textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    resize: vertical;
    margin-bottom: 12px;
}

.example-item textarea.example-grammar {
    min-height: 70px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.example-item input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    margin-bottom: 12px;
}

.remove-example-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 13px;
    padding: 6px 10px;
    margin-top: 8px;
    transition: opacity 0.3s;
}

.remove-example-btn:hover {
    opacity: 0.7;
}

.secondary-btn {
    background: var(--primary-light);
    color: var(--primary-color);
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
    font-weight: 500;
}

.secondary-btn:hover {
    background: #90CAF9;
}

.save-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

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

.cancel-btn {
    background: none;
    border: 2px solid var(--border-color);
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.cancel-btn:hover {
    background: #F5F5F5;
    border-color: var(--text-secondary);
}

.delete-btn {
    background: var(--danger-color);
    color: var(--white);
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-right: auto;
    transition: background 0.3s;
}

.delete-btn:hover {
    background: #D32F2F;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #323232;
    color: var(--white);
    padding: 14px 28px;
    border-radius: 28px;
    font-size: 15px;
    z-index: 2000;
    transition: opacity 0.3s, transform 0.3s;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

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

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

/* ==================== LOADING ==================== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 18px;
}

/* ==================== RESPONSIVE - TABLET ==================== */
@media (max-width: 1024px) {
    .learn-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .header-card {
        grid-column: 1;
    }

    .queue-card {
        grid-column: 1;
        grid-row: auto;
        max-height: 200px;
    }

    .goal-card {
        grid-column: 1;
        grid-row: auto;
    }

    .input-card {
        grid-column: 1;
        grid-row: auto;
    }

    .action-buttons {
        grid-column: 1;
    }

    .error-card {
        grid-column: 1;
    }

    .instructions-card {
        grid-column: 1;
        grid-row: auto;
    }

    .vocabulary-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* ==================== RESPONSIVE - MOBILE ==================== */
@media (max-width: 640px) {
    :root {
        --radius: 8px;
        --radius-sm: 6px;
    }

    .app-container {
        max-width: 100%;
    }

    .bottom-nav {
        max-width: 100%;
    }

    .nav-item {
        font-size: 12px;
    }

    .nav-item i {
        font-size: 20px;
    }

    .search-container {
        padding: 12px 16px;
    }

    .vocabulary-list {
        padding: 12px 16px;
        grid-template-columns: 1fr;
    }

    .vocab-item {
        padding: 16px;
    }

    .vocab-word {
        font-size: 18px;
    }

    .fab {
        right: 20px;
        bottom: 90px;
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

    .learn-container {
        padding: 12px;
    }

    .header-card {
        padding: 20px;
    }

    .current-word {
        font-size: 28px;
    }

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

    .answer-input {
        min-height: 150px;
        font-size: 16px;
    }

    .action-btn {
        padding: 14px 16px;
        font-size: 16px;
    }

    .dialog {
        max-width: 100%;
        margin: 0 10px;
        max-height: 95vh;
    }

    .dialog-header {
        padding: 16px 20px;
    }

    .dialog-content {
        padding: 20px;
    }

    .dialog-actions {
        padding: 16px 20px;
        flex-wrap: wrap;
    }

    .queue-card {
        max-height: 150px;
    }

    .goal-progress {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .progress-bar-container {
        width: 100%;
    }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F5F5F5;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #9E9E9E;
}

/* ==================== UTILITY ==================== */
.hidden {
    display: none !important;
}
