/* Main CSS for English Learning App */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

/* Theme Toggle Button */
#theme-toggle {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    padding: 0.5rem;
    cursor: pointer;
}

#theme-toggle:hover {
    color: #fff;
}

/* Dark Theme Adjustments */
[data-bs-theme="dark"] .vocab-word {
    background: #2b3035;
}

[data-bs-theme="dark"] .vocab-word:hover {
    background: #343a40;
}

[data-bs-theme="dark"] .reading-content {
    color: #dee2e6;
}

[data-bs-theme="dark"] .note-card {
    background: #212529;
    border-color: #495057;
}

/* General Styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Card Styles */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Note Card */
.note-card {
    border-left: 4px solid var(--primary-color);
}

.note-card.vocabulary {
    border-left-color: var(--success-color);
}

.note-card.grammar {
    border-left-color: var(--warning-color);
}

.note-card.question {
    border-left-color: var(--danger-color);
}

/* Book Card */
.book-card img {
    height: 300px;
    object-fit: cover;
}

/* Chapter Navigation */
.chapter-nav {
    position: sticky;
    top: 20px;
}

/* Reading View */
.reading-content {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* Vocabulary Card */
.vocab-word {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: background 0.2s;
}

.vocab-word:hover {
    background: #e9ecef;
}

.vocab-word .word {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.vocab-word .pronunciation {
    color: var(--secondary-color);
    font-style: italic;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Favorite Button */
.btn-favorite {
    color: #ffc107;
    transition: transform 0.2s;
}

.btn-favorite:hover {
    transform: scale(1.2);
}

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

/* Loading Indicator */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .reading-content {
        font-size: 1rem;
    }

    .book-card img {
        height: 200px;
    }
}

/* Utility Classes */
.text-truncate-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.text-truncate-3 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Section Title Highlight */
.section-title-highlight,
.section-content > h1:first-child,
.section-content > h2:first-child,
.section-content > h3:first-child,
.section-content > hgroup:first-child,
.section-content > header:first-child,
.section-content section > h1:first-child,
.section-content section > h2:first-child,
.section-content section > h3:first-child,
.section-content section > hgroup:first-child,
.section-content section > header:first-child {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-left: 5px solid var(--primary-color);
    border-radius: 0 4px 4px 0;
    margin-bottom: 1rem;
    display: block;
    width: 100%;
    font-size: 1.6rem;
}


[data-bs-theme="dark"] .section-title-highlight,
[data-bs-theme="dark"] .section-content > h1:first-child,
[data-bs-theme="dark"] .section-content > h2:first-child,
[data-bs-theme="dark"] .section-content > h3:first-child,
[data-bs-theme="dark"] .section-content > hgroup:first-child,
[data-bs-theme="dark"] .section-content > header:first-child,
[data-bs-theme="dark"] .section-content section > h1:first-child,
[data-bs-theme="dark"] .section-content section > h2:first-child,
[data-bs-theme="dark"] .section-content section > h3:first-child,
[data-bs-theme="dark"] .section-content section > hgroup:first-child,
[data-bs-theme="dark"] .section-content section > header:first-child {
    background-color: #2b3035;
    border-left-color: var(--primary-color);
}
