@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&family=Noto+Sans:wght@400;600;700&display=swap');

body {
    font-family: 'Noto Sans', 'Noto Sans KR', sans-serif;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* --- Scrollbar Utility --- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* --- UI State --- */
.hide-meaning .meaning-container { opacity: 0; }
.hide-meaning .meaning-container.revealed { opacity: 1; }

/* --- Card Interaction --- */
.card-touch {
    transition: transform 0.1s, opacity 0.3s;
    touch-action: pan-y;
}

.filter-active {
    ring-width: 3px;
    --tw-ring-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* --- Swipe Hints --- */
.swipe-hint {
    position: absolute; top: 50%; transform: translateY(-50%);
    font-size: 2rem; opacity: 0; transition: opacity 0.2s;
    pointer-events: none; z-index: 10;
}
.hint-left { right: 15px; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.hint-right { left: 15px; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* --- Celebration Overlay --- */
#celebration-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 100;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s;
}
#celebration-overlay.active { opacity: 1; pointer-events: auto; }

.thumb-up {
    font-size: 8rem;
    animation: thumbsUp 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite alternate;
}
@keyframes thumbsUp {
    0% { transform: scale(1) rotate(-10deg); }
    100% { transform: scale(1.2) rotate(10deg); }
}

.btn-pop { animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Mode Tabs --- */
.mode-tab {
    background: #e5e7eb;
    color: #6b7280;
}
.mode-tab.active {
    background: #4f46e5;
    color: white;
}

/* --- Day Filter Buttons --- */
.day-btn {
    background: #e5e7eb;
    color: #374151;
}
.day-btn.active {
    background: #4f46e5;
    color: white;
}

/* --- IPA Display --- */
.ipa-text {
    font-family: 'Noto Sans', serif;
    color: #8b5cf6;
    font-size: 13px;
    font-weight: 500;
}

/* --- Word Root Etymology --- */
.root-etymology {
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd;
    font-size: 11px;
    line-height: 1.4;
}

.root-parts {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

.root-part {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
}

.root-part-word {
    font-weight: 700;
    color: #2563eb;
    font-size: 12px;
}

.root-part-meaning {
    font-size: 9px;
    color: #6b7280;
}

.root-plus {
    font-weight: bold;
    color: #3b82f6;
    font-size: 14px;
}

.root-note {
    margin-top: 2px;
    font-size: 10px;
    color: #2563eb;
    font-weight: 600;
}

/* --- Phrasal Verb Display --- */
.phrasal-box {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1.5px solid #f59e0b;
}

.phrasal-formula {
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.phrasal-verb {
    color: #1f2937;
}

.phrasal-particle {
    color: #dc2626;
    font-size: 14px;
    font-weight: 800;
}

.phrasal-meaning {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.phrasal-example {
    margin-top: 4px;
    font-size: 11px;
    color: #374151;
    font-style: italic;
    border-left: 2px solid #d1d5db;
    padding-left: 6px;
}

.phrasal-example-ko {
    font-size: 10px;
    color: #9ca3af;
    font-style: normal;
}

.phrasal-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 6px 0;
}

/* --- Collocation Display --- */
.collocation-box {
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #86efac;
    font-size: 11px;
}

.collocation-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.collocation-combo {
    font-weight: 700;
    color: #16a34a;
    font-size: 12px;
}

.collocation-wrong {
    font-size: 10px;
    color: #dc2626;
    text-decoration: line-through;
}

/* --- Word Family Display --- */
.family-box {
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, #fdf4ff, #fae8ff);
    border: 1px solid #e879f9;
    font-size: 11px;
}

.family-members {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.family-member {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 1px 6px;
}

.family-member-word {
    font-weight: 700;
    color: #a21caf;
    font-size: 11px;
}

.family-member-pos {
    font-size: 9px;
    color: #6b7280;
}

.family-member-meaning {
    font-size: 9px;
    color: #9ca3af;
}

/* --- Confusing Pair Display --- */
.confusing-box {
    margin-top: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff1f2, #ffe4e6);
    border: 1.5px solid #fb7185;
    font-size: 11px;
}

.confusing-vs {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 4px;
}

.confusing-word {
    font-weight: 800;
    font-size: 14px;
    color: #e11d48;
}

.confusing-vs-label {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 700;
}

.confusing-explanation {
    font-size: 10px;
    color: #6b7280;
    text-align: center;
}

.confusing-tip {
    margin-top: 4px;
    font-size: 10px;
    color: #be123c;
    font-weight: 700;
    text-align: center;
}

/* --- Quiz Mode --- */
.quiz-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-option:hover {
    border-color: #818cf8;
    background: #eef2ff;
}

.quiz-option.correct {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #16a34a;
}

.quiz-option.wrong {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

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

/* --- Stats Day Grid --- */
.day-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: white;
    transition: transform 0.2s;
}

.day-cell:hover {
    transform: scale(1.2);
}

.day-cell.level-0 { background: #e5e7eb; color: #9ca3af; }
.day-cell.level-1 { background: #bfdbfe; color: #1e40af; }
.day-cell.level-2 { background: #93c5fd; color: #1e3a8a; }
.day-cell.level-3 { background: #60a5fa; color: white; }
.day-cell.level-4 { background: #3b82f6; color: white; }
.day-cell.level-5 { background: #2563eb; color: white; }

/* --- Hard Word Item --- */
.hard-word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #fef2f2;
    border-radius: 6px;
    border-left: 3px solid #ef4444;
}

/* === DARK MODE === */
body.dark-mode {
    background-color: #111827;
    color: #e5e7eb;
}

body.dark-mode .bg-white\/95,
body.dark-mode .bg-white {
    background-color: rgba(31, 41, 55, 0.97) !important;
}

body.dark-mode .bg-gray-100,
body.dark-mode .footer-bg {
    background-color: #111827 !important;
}

body.dark-mode .shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
}

body.dark-mode .text-gray-800 {
    color: #e5e7eb !important;
}

body.dark-mode .text-gray-700 {
    color: #d1d5db !important;
}

body.dark-mode .text-gray-500 {
    color: #9ca3af !important;
}

body.dark-mode .text-gray-400 {
    color: #9ca3af !important;
}

/* Dark card */
body.dark-mode .card-touch {
    background-color: #1f2937 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

body.dark-mode .card-touch .text-gray-800 {
    color: #f3f4f6 !important;
}

/* Dark mode tabs */
body.dark-mode .mode-tab {
    background: #374151;
    color: #9ca3af;
}
body.dark-mode .mode-tab.active {
    background: #4f46e5;
    color: white;
}

/* Dark day buttons */
body.dark-mode .day-btn {
    background: #374151;
    color: #d1d5db;
}
body.dark-mode .day-btn.active {
    background: #4f46e5;
    color: white;
}

/* Dark root etymology */
body.dark-mode .root-etymology {
    background: linear-gradient(135deg, #1e3a5f, #1e3050);
    border-color: #3b82f6;
}
body.dark-mode .root-part {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}
body.dark-mode .root-part-word { color: #60a5fa; }
body.dark-mode .root-part-meaning { color: #9ca3af; }
body.dark-mode .root-note { color: #93c5fd; }

/* Dark phrasal verb */
body.dark-mode .phrasal-box {
    background: linear-gradient(135deg, #451a03, #78350f);
    border-color: #d97706;
}
body.dark-mode .phrasal-verb { color: #f3f4f6; }
body.dark-mode .phrasal-meaning { color: #9ca3af; }
body.dark-mode .phrasal-example { color: #d1d5db; border-left-color: #4b5563; }
body.dark-mode .phrasal-example-ko { color: #6b7280; }
body.dark-mode .phrasal-separator { background: #374151; }

/* Dark collocation */
body.dark-mode .collocation-box {
    background: linear-gradient(135deg, #052e16, #14532d);
    border-color: #22c55e;
}
body.dark-mode .collocation-combo { color: #4ade80; }

/* Dark word family */
body.dark-mode .family-box {
    background: linear-gradient(135deg, #3b0764, #581c87);
    border-color: #c084fc;
}
body.dark-mode .family-member {
    background: #374151;
    border-color: #4b5563;
}
body.dark-mode .family-member-word { color: #d946ef; }

/* Dark confusing pair */
body.dark-mode .confusing-box {
    background: linear-gradient(135deg, #4c0519, #881337);
    border-color: #fb7185;
}
body.dark-mode .confusing-word { color: #fda4af; }
body.dark-mode .confusing-explanation { color: #d1d5db; }
body.dark-mode .confusing-tip { color: #fda4af; }

/* Dark quiz */
body.dark-mode .quiz-option {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}
body.dark-mode .quiz-option:hover {
    border-color: #818cf8;
    background: #312e81;
}
body.dark-mode .quiz-option.correct {
    border-color: #22c55e;
    background: #052e16;
    color: #4ade80;
}
body.dark-mode .quiz-option.wrong {
    border-color: #ef4444;
    background: #450a0a;
    color: #fca5a5;
}

/* Dark stats */
body.dark-mode .bg-white.rounded-xl {
    background-color: #1f2937 !important;
}

body.dark-mode .hard-word-item {
    background: #450a0a;
    border-left-color: #ef4444;
    color: #fca5a5;
}

body.dark-mode .bg-gray-200 {
    background-color: #374151 !important;
}

/* Dark dictation input */
body.dark-mode #dict-input {
    background: #1f2937;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .ipa-text {
    color: #a78bfa;
}

/* IPA on card */
body.dark-mode .card-ipa {
    color: #a78bfa;
}
