* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Noto Serif Bengali', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #e2e8f0;
    color: #1e293b;
    transition: all 0.3s ease;
    overflow-x: hidden;
    touch-action: manipulation;
}

body.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}

body.font-small { font-size: 14px; }
body.font-medium { font-size: 16px; }
body.font-large { font-size: 18px; }
body.font-small h1 { font-size: 1.2rem; }
body.font-medium h1 { font-size: 1.4rem; }
body.font-large h1 { font-size: 1.6rem; }
body.font-small h2 { font-size: 1.4rem; }
body.font-medium h2 { font-size: 1.6rem; }
body.font-large h2 { font-size: 1.8rem; }
body.font-small h3 { font-size: 1.1rem; }
body.font-medium h3 { font-size: 1.2rem; }
body.font-large h3 { font-size: 1.3rem; }
body.font-small input, body.font-small select { font-size: 0.9rem; }
body.font-medium input, body.font-medium select { font-size: 1rem; }
body.font-large input, body.font-large select { font-size: 1.1rem; }

body.theme-purple { --primary-color: #6200ea; --primary-light: #a78bfa; --primary-gradient: linear-gradient(135deg, #6200ea, #8b5cf6); }
body.theme-blue { --primary-color: #0288d1; --primary-light: #4fc3f7; --primary-gradient: linear-gradient(135deg, #0288d1, #4fc3f7); }
body.theme-green { --primary-color: #2e7d32; --primary-light: #66bb6a; --primary-gradient: linear-gradient(135deg, #2e7d32, #66bb6a); }
body.theme-red { --primary-color: #d32f2f; --primary-light: #ff6659; --primary-gradient: linear-gradient(135deg, #d32f2f, #ff6659); }
body.theme-orange { --primary-color: #f57c00; --primary-light: #ffa726; --primary-gradient: linear-gradient(135deg, #f57c00, #ffa726); }
body.theme-teal { --primary-color: #00897b; --primary-light: #4db6ac; --primary-gradient: linear-gradient(135deg, #00897b, #4db6ac); }
body.theme-pink { --primary-color: #c2185b; --primary-light: #f06292; --primary-gradient: linear-gradient(135deg, #c2185b, #f06292); }
body.theme-indigo { --primary-color: #3f51b5; --primary-light: #7986cb; --primary-gradient: linear-gradient(135deg, #3f51b5, #7986cb); }

.container {
    max-width: 600px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 1000;
    animation: fadeOut 0.5s ease 1.5s forwards;
}

.splash-screen h1 {
    font-size: 2rem;
    margin-bottom: 20px;
}

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

header {
    background: var(--primary-gradient);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 10;
}

header h1 {
    font-weight: 600;
}

.header-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 8px;
    color: white;
    position: relative;
    overflow: hidden;
}

.dark-mode-toggle {
    display: flex;
    align-items: center;
    width: 60px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 16px;
    padding: 3px;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease;
}

body.dark-mode .dark-mode-toggle {
    background: #475569;
}

.dark-mode-toggle input {
    display: none;
}

.toggle-circle {
    width: 26px;
    height: 26px;
    background: #ffffff;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.dark-mode-toggle input:checked + .toggle-circle {
    transform: translateX(28px);
    background: var(--primary-color);
}

body.dark-mode .dark-mode-toggle input:checked + .toggle-circle {
    background: var(--primary-light);
}

.toggle-circle::before {
    content: '\f185';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1rem;
    color: #f59e0b;
    transition: content 0.3s ease, color 0.3s ease;
}

.dark-mode-toggle input:checked + .toggle-circle::before {
    content: '\f186';
    color: #F6F1D5;
}

.dark-mode-toggle:hover .toggle-circle {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.dark-mode-toggle:active .toggle-circle {
    transform: scale(0.9);
}

.dark-mode-toggle input:checked:active + .toggle-circle {
    transform: translateX(28px) scale(0.9);
}

.search-container {
    padding: 16px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 0 0 16px 16px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

body.dark-mode .search-container {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.search-wrapper {
    flex: 1;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 12px 48px 12px 16px;
    border: 3px solid var(--primary-color);
    border-radius: 25px;
    background: #f1f5f9;
    font-weight: 500;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

body.dark-mode #search-input {
    border: 3px solid var(--primary-light);
    background: #1e293b;
    color: #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

#search-input::placeholder {
    color: #94a3b8;
    opacity: 0.7;
}

.search-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: var(--primary-gradient);
    color: #fff;
    border: 1px solid #000000;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 18px;
    border-radius: 25px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

body.dark-mode .search-btn {
    border: 1px solid #fff;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.clear-btn {
    background: var(--primary-gradient);
    color: #fff;
    border: 1px solid #000;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 18px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    line-height: 1;
    text-align: center;
}

.clear-btn i {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

body.dark-mode .clear-btn {
    background: var(--primary-gradient);
    color: #fff;
    border: 1px solid #fff;
}

.clear-btn:not(:disabled):hover {
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

body.dark-mode .clear-btn:not(:disabled):hover {
    color: #fff;
}

.content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    position: relative;
}

.tab-content {
    display: none;
    animation: slideInTab 0.3s ease;
}

.tab-content.active {
    display: block;
}

.word-card {
    background: #ffffff;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    animation: slideIn 0.3s ease;
}

body.dark-mode .word-card {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

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

.word-header h2 {
    text-transform: capitalize;
    font-weight: 600;
    color: var(--primary-color);
}

body.dark-mode .word-header h2 {
    color: var(--primary-light);
}

.meaning {
    font-size: 1.1rem;
    margin-top: 8px;
    font-family: 'Noto Serif Bengali', sans-serif;
}

#favorites h3 {
    margin-bottom: 18px;
    color: var(--primary-color);
}

body.dark-mode #favorites h3 {
    color: var(--primary-light);
}

.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 8px;
    position: relative;
    overflow: hidden;
    color: #cbd5e1;
}

.favorite-btn.active {
    color: #f43f5e;
}

.tts-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 8px;
    position: relative;
    overflow: hidden;
    color: #64748b;
}

body.dark-mode .tts-btn {
    color: #94a3b8;
}

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

body.dark-mode .tts-btn:hover {
    color: var(--primary-light);
}

.ripple {
    position: absolute;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    color: var(--primary-color);
}

body.dark-mode .history-header {
    color: var(--primary-light);
}

.clear-history-btn {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

body.dark-mode .clear-history-btn {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
}

.clear-history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.history-list, .favorites-list, .quiz-stats-list {
    list-style: none;
}

.history-list li, .favorites-list li {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: slideIn 0.3s ease;
}

.quiz-stats-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 8px 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
}

body.dark-mode .history-list li, body.dark-mode .favorites-list li, body.dark-mode .quiz-stats-list li {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.history-list li:hover, .favorites-list li:hover, .quiz-stats-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body.dark-mode .history-list li:hover, body.dark-mode .favorites-list li:hover, body.dark-mode .quiz-stats-list li:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.list-icon {
    margin-right: 12px;
    color: var(--primary-color);
    font-size: 1rem;
}

body.dark-mode .list-icon {
    color: var(--primary-light);
}

.quiz-stats-list .list-icon {
    color: var(--primary-color);
    font-size: 1rem;
}

body.dark-mode .quiz-stats-list .list-icon {
    color: var(--primary-light);
}

.quiz-number {
    font-size: 1rem;
    font-weight: 600;
    margin-right: 8px;
    color: var(--primary-color);
}

body.dark-mode .quiz-number {
    color: var(--primary-light);
}

.quiz-score {
    font-size: 1.2rem;
    font-weight: 700;
}

.quiz-timestamp {
    font-size: 0.9rem;
    color: #64748b;
    margin-left: auto;
    margin-right: 16px;
}

body.dark-mode .quiz-timestamp {
    color: #94a3b8;
}

.quiz-progress {
    position: relative;
    width: 70px;
    height: 70px;
}

.progress-ring-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 4;
}

body.dark-mode .progress-ring-bg {
    stroke: #475569;
}

.progress-ring {
    fill: none;
    stroke: #22c55e;
    stroke-width: 4;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.5s ease;
}

body.dark-mode .progress-ring {
    stroke: #4ade80;
}

.quiz-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: 700;
    color: #22c55e;
}

body.dark-mode .quiz-percentage {
    color: #4ade80;
}

.list-word {
    flex: 1;
    font-weight: 500;
    font-family: 'Inter', 'Noto Serif Bengali', sans-serif;
}

.list-word::after {
    content: '';
    display: inline-block;
    width: 8px;
}

.english-word {
    font-size: 1.1rem;
    color: var(--primary-color);
    text-transform: capitalize;
}

body.dark-mode .english-word {
    color: var(--primary-light);
}

.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #ef4444;
    padding: 8px;
    position: relative;
    overflow: hidden;
}

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

.quiz-header h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary-color);
}

body.dark-mode .quiz-header h3 {
    color: var(--primary-light);
}

.quiz-content {
    margin-top: 16px;
    padding: 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    animation: slideIn 0.3s ease;
}

body.dark-mode .quiz-content {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.quiz-progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

body.dark-mode .quiz-progress-bar {
    background: #475569;
}

.quiz-progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.5s ease;
}

.quiz-score-timer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.quiz-timer {
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: #f59e0b;
    background: #fef3c7;
    padding: 4px 8px;
    border-radius: 6px;
}

body.dark-mode .quiz-timer {
    color: #fbbf24;
    background: #78350f;
}

.quiz-timer i {
    margin-right: 6px;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.quiz-option {
    background: #ffffff;
    padding: 8px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
    text-transform: capitalize;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    animation: slideInOption 0.3s ease;
    min-height: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .quiz-option {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.quiz-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body.dark-mode .quiz-option:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

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

.quiz-option.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
    animation: popCorrect 0.3s ease;
}

body.dark-mode .quiz-option.correct {
    background: #166534;
    border-color: #22c55e;
    color: #dcfce7;
}

.quiz-option.incorrect {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
    animation: shakeIncorrect 0.3s ease;
}

body.dark-mode .quiz-option.incorrect {
    background: #991b1b;
    border-color: #ef4444;
    color: #fee2e2;
}

.quiz-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.quiz-btn, .quiz-action-btn, #view-statistics, .quiz-stats-back-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 120px;
}

body.dark-mode .quiz-btn, body.dark-mode .quiz-action-btn, body.dark-mode #view-statistics, body.dark-mode .quiz-stats-back-btn {
    background: var(--primary-gradient);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.quiz-btn:hover, .quiz-action-btn:hover, #view-statistics:hover, .quiz-stats-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.quiz-btn:disabled, .quiz-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.quiz-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

#quiz-container {
    position: relative;
}

#quiz-score {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

body.dark-mode #quiz-score {
    color: var(--primary-light);
}

.quiz-question {
    margin-bottom: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    animation: fadeInQuestion 0.5s ease;
}

.quiz-question p {
    font-family: 'Noto Serif Bengali', sans-serif;
}

.quiz-feedback {
    text-align: center;
    margin-bottom: 10px;
    min-height: 25px;
    font-size: 1.1rem;
    font-weight: 500;
}

.quiz-feedback .correct {
    color: #22c55e;
    animation: fadeInFeedback 0.3s ease;
}

.quiz-feedback .incorrect {
    color: #ef4444;
    animation: fadeInFeedback 0.3s ease;
}

.settings-panel {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: #ffffff;
    padding: 24px;
    box-shadow: 4px 0 12px rgba(0,0,0,0.15);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    overflow-y: auto;
}

body.dark-mode .settings-panel {
    background: #1e293b;
}

.settings-panel.active {
    left: 0;
}

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

.settings-panel h3 {
    font-size: 1.4rem;
}

.close-settings-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--primary-color);
    padding: 8px;
    position: relative;
    overflow: hidden;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.2s;
}

body.dark-mode .close-settings-btn {
    color: var(--primary-light);
}

.close-settings-btn:hover {
    background: rgba(0,0,0,0.1);
}

.settings-item {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

body.dark-mode .settings-item {
    background: #334155;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.settings-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

body.dark-mode .settings-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.settings-item i {
    margin-right: 12px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

body.dark-mode .settings-item i {
    color: var(--primary-light);
}

.settings-item label {
    flex: 1;
    font-weight: 500;
}

.settings-item select {
    width: 100px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #ffffff;
}

body.dark-mode .settings-item select {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #475569;
}

.settings-item button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

body.dark-mode .settings-item button {
    background: var(--primary-gradient);
}

.settings-item button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-left: 8px;
    border: 1px solid #e2e8f0;
}

body.dark-mode .color-swatch {
    border-color: #475569;
}

nav {
    background: #ffffff;
    padding: 4px 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-around;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

body.dark-mode nav {
    background: #1e293b;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.2);
}

.nav-btn {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: #64748b;
    cursor: pointer;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-width: 60px;
}

body.dark-mode .nav-btn {
    color: #94a3b8;
}

.nav-btn i {
    font-size: 1rem;
    margin-bottom: 4px;
}

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

body.dark-mode .nav-btn.active {
    color: var(--primary-light);
}

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

body.dark-mode .nav-btn:hover {
    color: var(--primary-light);
}

.offline-message {
    display: none;
    background: #fef3c7;
    color: #b45309;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 500;
}

body.dark-mode .offline-message {
    background: #78350f;
    color: #fed7aa;
}

.loading-spinner {
    display: none;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 16px auto;
}

body.dark-mode .loading-spinner {
    border: 4px solid #475569;
    border-top: 4px solid var(--primary-light);
}

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

@keyframes slideInTab {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

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

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

@keyframes popCorrect {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shakeIncorrect {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

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

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

@media (max-width: 400px) {
    .container {
        width: 100%;
    }

    header {
        padding: 12px;
    }

    .search-container {
        padding: 12px;
    }

    #search-input {
        padding: 10px 40px 10px 12px;
    }

    .search-btn { right: 4px; width: 32px; height: 32px; }
    .clear-btn { width: 32px; height: 32px; }
    
    .word-header h2 { font-size: 1.4rem; }

    .quiz-content {
        padding: 16px;
    }

    .quiz-option {
        padding: 8px;
        min-height: 30px;
    }

    .quiz-btn, .quiz-action-btn, #view-statistics, .quiz-stats-back-btn {
        padding: 8px 16px;
        min-width: 100px;
    }

    .quiz-stats-list li {
        padding: 8px 12px;
    }
    .quiz-number {
        font-size: 0.9rem;
        margin-right: 6px;
    }
    .quiz-score {
        font-size: 1.2rem;
    }
    .quiz-timestamp {
        font-size: 0.8rem;
        margin-right: 12px;
    }
    .quiz-progress {
        width: 60px;
        height: 60px;
    }
    .quiz-progress svg {
        width: 60px;
        height: 60px;
    }
    .quiz-percentage {
        font-size: 0.9rem;
    }
}