/* =================================== */
/* Wordbook Page Styles                */
/* =================================== */

/* Word List Item */
.word-list-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.word-list-item:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.word-list-item.selected {
    border-color: #f59e0b;
    background-color: #fffbeb;
}

.word-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.word-definition {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

.word-meta {
    margin-top: 0.5rem;
    color: #ca8a04;
}

.status-badge.status-learning {
    background-color: #ffedd5;
    color: #ea580c;
}

.status-badge.status-mastered {
    background-color: #dcfce7;
    color: #166534;
}

/* Learning Mode Styles */
.flashcard-container,
.spelling-container,
.dictation-container,
.quiz-container,
.results-container {
    max-width: 42rem;
    margin: 0 auto;
}

.quiz-option {
    text-align: left;
    font-size: 1rem;
}

/* Word Detail Panel */
.word-examples {
    margin-top: 1.5rem;
}

.example-sentence {
    padding: 1rem;
    background-color: #f8fafc;
    border-left: 3px solid #f59e0b;
    border-radius: 0.5rem;
}

/* Mobile Detail Modal Animation */
#mobile-detail-modal.show #mobile-detail-backdrop {
    opacity: 1;
}

#mobile-detail-modal.show #mobile-detail-panel {
    transform: translateY(0);
}

/* Stats Panel */
#stats-panel {
    transition: all 0.3s ease;
}

/* Ensure consistent heights and alignment for sidebar panels */
#wordbook-sidebar>div {
    min-height: fit-content;
}

#word-detail-panel>div {
    min-height: 800px;
    top: 0 !important;
    /* Override top-8 to align with sidebar */
}

/* =================================== */
/* Dark Mode                           */
/* =================================== */

body.dark-mode #wordbook-page {
    background-color: #0f172a;
}

body.dark-mode .word-list-item {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark-mode .word-list-item:hover {
    border-color: #fcd34d;
    background-color: #334155;
}

body.dark-mode .word-list-item.selected {
    border-color: #fcd34d;
    background-color: rgba(252, 211, 77, 0.1);
}

body.dark-mode .word-text {
    color: #f1f5f9;
}

body.dark-mode .word-definition {
    color: #cbd5e1;
}

body.dark-mode .status-badge.status-new {
    background-color: rgba(254, 249, 195, 0.1);
    color: #fde047;
    border: 1px solid #eab308;
}

body.dark-mode .status-badge.status-learning {
    background-color: rgba(255, 237, 213, 0.1);
    color: #fb923c;
    border: 1px solid #f97316;
}

body.dark-mode .status-badge.status-mastered {
    background-color: rgba(220, 252, 231, 0.1);
    color: #4ade80;
    border: 1px solid #22c55e;
}

body.dark-mode .example-sentence {
    background-color: #1e293b;
    border-left-color: #fcd34d;
}

body.dark-mode #stats-panel {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark-mode #mobile-detail-panel {
    background-color: #1e293b;
}

/* Dark mode for stats cards */
body.dark-mode header .bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode header .text-slate-800 {
    color: #f1f5f9 !important;
}

body.dark-mode header .text-slate-600 {
    color: #cbd5e1 !important;
}

body.dark-mode header .text-slate-500 {
    color: #94a3b8 !important;
}

/* Dark mode for sidebar panels */
body.dark-mode #wordbook-sidebar .bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode #wordbook-sidebar .text-slate-700 {
    color: #e2e8f0 !important;
}

body.dark-mode #wordbook-sidebar .text-slate-400 {
    color: #94a3b8 !important;
}

body.dark-mode #wordbook-sidebar .hover\:bg-amber-50:hover {
    background-color: rgba(251, 191, 36, 0.1) !important;
}

body.dark-mode #wordbook-sidebar .bg-amber-100 {
    background-color: rgba(251, 191, 36, 0.2) !important;
}

/* Dark mode for search bar and select all panel */
body.dark-mode #wordbook-page .bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode #wordbook-search {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-mode #wordbook-search::placeholder {
    color: #64748b !important;
}

/* Dark mode for word detail panel */
body.dark-mode #word-detail-panel .bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode #detail-empty {
    color: #64748b !important;
}

/* Dark mode for word detail content - Chinese definition box */
body.dark-mode #word-detail-panel .bg-amber-50 {
    background-color: rgba(251, 191, 36, 0.15) !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
}

body.dark-mode #word-detail-panel .text-amber-700 {
    color: #fbbf24 !important;
}

body.dark-mode #word-detail-panel .text-slate-700 {
    color: #e2e8f0 !important;
}

body.dark-mode #word-detail-panel .bg-slate-100 {
    background-color: #334155 !important;
}

body.dark-mode #word-detail-panel .text-slate-600 {
    color: #cbd5e1 !important;
}

body.dark-mode #word-detail-panel .hover\:bg-slate-100:hover {
    background-color: #334155 !important;
}

/* Dark mode for stats panel hover state */
body.dark-mode #stats-panel .hover\:bg-slate-50:hover {
    background-color: #334155 !important;
}

body.dark-mode #stats-panel .text-slate-800 {
    color: #f1f5f9 !important;
}

body.dark-mode #stats-panel .text-slate-600 {
    color: #cbd5e1 !important;
}

body.dark-mode #stats-panel .text-slate-500 {
    color: #94a3b8 !important;
}

body.dark-mode #stats-panel .border-slate-200 {
    border-color: #334155 !important;
}

body.dark-mode #stats-panel .bg-slate-100 {
    background-color: #334155 !important;
}

/* Dark mode for select dropdown backgrounds */
body.dark-mode select,
body.dark-mode #filter-status,
body.dark-mode #filter-date,
body.dark-mode #sort-by {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

/* Dark mode for learning mode modals */
body.dark-mode .flashcard-container .bg-white,
body.dark-mode .spelling-container .bg-white,
body.dark-mode .dictation-container .bg-white,
body.dark-mode .quiz-container .bg-white,
body.dark-mode .results-container .bg-white {
    background-color: #1e293b !important;
}

body.dark-mode .flashcard-container .text-slate-800,
body.dark-mode .spelling-container .text-slate-800,
body.dark-mode .dictation-container .text-slate-800,
body.dark-mode .quiz-container .text-slate-800,
body.dark-mode .results-container .text-slate-800 {
    color: #f1f5f9 !important;
}

body.dark-mode .flashcard-container .text-slate-600,
body.dark-mode .spelling-container .text-slate-600,
body.dark-mode .dictation-container .text-slate-600,
body.dark-mode .quiz-container .text-slate-600,
body.dark-mode .results-container .text-slate-600 {
    color: #cbd5e1 !important;
}

body.dark-mode .flashcard-container .text-slate-500,
body.dark-mode .spelling-container .text-slate-500,
body.dark-mode .dictation-container .text-slate-500,
body.dark-mode .quiz-container .text-slate-500,
body.dark-mode .results-container .text-slate-500 {
    color: #94a3b8 !important;
}

/* =================================== */
/* Eye-Care Mode                       */
/* =================================== */

body.eye-care-mode #wordbook-page {
    background-color: #f7f3e8;
}

body.eye-care-mode .word-list-item {
    background-color: #fdfaf3;
    border-color: #e5e0d3;
}

body.eye-care-mode .word-list-item:hover {
    border-color: #f59e0b;
    background-color: #f3eee5;
}

body.eye-care-mode .word-list-item.selected {
    border-color: #f59e0b;
    background-color: #fef9c3;
}

body.eye-care-mode .word-text {
    color: #4a463d;
}

body.eye-care-mode .word-definition {
    color: #5c4d38;
}

body.eye-care-mode .status-badge.status-new {
    background-color: #fef9c3;
    color: #ca8a04;
}

body.eye-care-mode .status-badge.status-learning {
    background-color: #ffedd5;
    color: #ea580c;
}

body.eye-care-mode .status-badge.status-mastered {
    background-color: #dcfce7;
    color: #166534;
}

body.eye-care-mode .example-sentence {
    background-color: #f3eee5;
    border-left-color: #f59e0b;
}

body.eye-care-mode #stats-panel {
    background-color: #fdfaf3;
    border-color: #e5e0d3;
}

body.eye-care-mode #mobile-detail-panel {
    background-color: #fdfaf3;
}

/* Eye-care mode for learning mode modal */
body.eye-care-mode #learning-mode-modal {
    background-color: rgba(74, 70, 61, 0.95);
}

body.eye-care-mode #learning-mode-modal button[onclick="LearningModes.hideModal()"] {
    background-color: rgba(202, 138, 4, 0.2) !important;
    color: #78350f !important;
}

body.eye-care-mode #learning-mode-modal button[onclick="LearningModes.hideModal()"]:hover {
    background-color: rgba(202, 138, 4, 0.3) !important;
}

body.eye-care-mode .flashcard-container .bg-white,
body.eye-care-mode .spelling-container .bg-white,
body.eye-care-mode .dictation-container .bg-white,
body.eye-care-mode .quiz-container .bg-white,
body.eye-care-mode .results-container .bg-white {
    background-color: #fdfaf3 !important;
}

body.eye-care-mode .flashcard-container .text-slate-800,
body.eye-care-mode .spelling-container .text-slate-800,
body.eye-care-mode .dictation-container .text-slate-800,
body.eye-care-mode .quiz-container .text-slate-800,
body.eye-care-mode .results-container .text-slate-800 {
    color: #4a463d !important;
}

body.eye-care-mode .flashcard-container .text-slate-600,
body.eye-care-mode .spelling-container .text-slate-600,
body.eye-care-mode .dictation-container .text-slate-600,
body.eye-care-mode .quiz-container .text-slate-600,
body.eye-care-mode .results-container .text-slate-600 {
    color: #5c4d38 !important;
}

/* =================================== */
/* Responsive                          */
/* =================================== */

@media (max-width: 1024px) {
    .word-list-item {
        padding: 0.875rem;
    }

    .word-text {
        font-size: 1rem;
    }

    .word-definition {
        font-size: 0.8125rem;
    }
}

@media (max-width: 640px) {
    .word-list-item {
        padding: 0.75rem;
    }

    .status-badge {
        font-size: 0.6875rem;
        padding: 0.2rem 0.6rem;
    }
}