/* main.css - Stylesheet chính cho trang web */

:root {
    /* Light theme (default) */
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --accent-color-rgb: 52, 152, 219; /* RGB values for accent color */
    --text-color: #333;
    --light-text: #ecf0f1;
    --background-color: #f9f9f9;
    --paper-color: #fff;
    --border-color: #eee;
    --code-bg: #f5f5f5;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --hover-bg: rgba(52, 152, 219, 0.1);
    --transition-time: 0.4s;
}

/* Dark theme */
[data-theme="dark"] {
    --primary-color: #ecf0f1;
    --secondary-color: #bdc3c7;
    --accent-color: #3498db;
    --accent-color-rgb: 52, 152, 219; /* RGB values for accent color */
    --text-color: #ecf0f1;
    --light-text: #ecf0f1;
    --background-color: #1a1a1a;
    --paper-color: #2c2c2c;
    --border-color: #404040;
    --code-bg: #363636;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --hover-bg: rgba(52, 152, 219, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Noto Serif", Georgia, serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--paper-color);
    box-shadow: 0 0 20px var(--shadow-color);
    border-radius: 5px;
    min-height: 100vh;
}

/* Header và navigation */
header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.home-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.home-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.5rem;
    transition: color var(--transition-time);
}

.home-link:hover {
    color: var(--accent-color);
}

.chapter-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0;
}

.chapter-header-nav, .chapter-footer-nav .chapter-nav {
    justify-content: center;
}

.prev-chapter, .next-chapter {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all var(--transition-time);
    white-space: nowrap;
    font-size: 0.9rem;
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

.prev-chapter:hover, .next-chapter:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb), 0.2);
}

.chapter-title {
    font-weight: bold;
    font-size: 0.9rem;
}

/* Nội dung chương */
.chapter-heading {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--primary-color);
}

.verse-container {
    margin: 0 auto;
    max-width: 600px;
}

.verse {
    margin-bottom: 2rem;
    line-height: 1.8;
    text-align: center;
}

/* Trang chủ */
.home-header {
    text-align: center;
    margin-bottom: 3rem;
}

.main-title {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-style: italic;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.author {
    margin-top: 1rem;
    color: var(--secondary-color);
}

.introduction {
    margin-bottom: 3rem;
}

.quote, .comment-quote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--secondary-color);
}

.intro-text {
    margin-top: 2rem;
}

.intro-text h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.intro-text p {
    margin-bottom: 1rem;
}

/* Danh sách chương */
.chapter-list {
    margin-bottom: 3rem;
}

.chapter-list h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.chapters {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.chapter-link {
    display: block;
    padding: 0.5rem;
    text-decoration: none;
    color: var(--secondary-color);
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
    transition: all var(--transition-time);
}

.chapter-link:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

.chapter-link.special-link {
    color: var(--accent-color);
    font-weight: bold;
    border-left: 3px solid var(--accent-color);
    padding-left: 10px;
}

.chapter-link.special-link:hover {
    background-color: rgba(var(--accent-color-rgb), 0.15);
    color: var(--accent-color);
}

/* Comment section */
.comment-section {
    margin: 4rem auto 2rem;
    max-width: 700px;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.comment-section h3 {
    position: relative;
    overflow: hidden;
    text-align: center;
    margin: 0 0 2rem;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.comment-section h3:before,
.comment-section h3:after {
    background-color: var(--border-color);
    content: "";
    display: inline-block;
    height: 1px;
    position: relative;
    vertical-align: middle;
    width: 50%;
}

.comment-section h3:before {
    right: 0.5em;
    margin-left: -50%;
}

.comment-section h3:after {
    left: 0.5em;
    margin-right: -50%;
}

/* Định dạng mới cho phần chú giải */
.commentary-container {
    padding: 0 1rem;
    margin: 1rem 0 2rem;
}

.commentary-item {
    margin-bottom: 2rem;
}

.commentary-item:last-child {
    margin-bottom: 0;
}

.commentary-item p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--text-color);
}

.commentary-item strong {
    color: var(--primary-color);
    font-weight: bold;
}

.commentary-item em {
    font-style: italic;
}

.commentary-item code {
    font-family: 'Courier New', monospace;
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.commentary-item a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted;
    transition: all var(--transition-time);
}

.commentary-item a:hover {
    border-bottom: 1px solid;
}

.commentary-item ul, .commentary-item ol {
    margin: 0.5rem 0 1rem 1.5rem;
    padding-left: 0.5rem;
}

.commentary-item li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Footer */
footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Chapter Footer Navigation */
.chapter-footer-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

/* Chapter dropdown navigation */
.chapter-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.dropdown-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    border-radius: 3px;
    transition: all var(--transition-time);
}

.dropdown-button:hover {
    background-color: var(--hover-bg);
    color: var(--accent-color);
}

.dropdown-button:focus {
    outline: none;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.15);
    z-index: 1;
    border-radius: 3px;
    left: 50%;
    transform: translateX(-50%);
}

.dropdown-content a {
    color: var(--secondary-color);
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    text-align: center;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--hover-bg);
    color: var(--accent-color);
}

.show {
    display: block;
}

.dropdown-icon {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid currentColor;
    margin-top: 2px;
    transition: transform var(--transition-time);
}

.rotate-icon {
    transform: rotate(180deg);
}

/* Định dạng Markdown */
.verse strong, .comment-quote strong {
    font-weight: 700;
}

.verse em, .comment-quote em {
    font-style: italic;
}

.verse code, .comment-quote code {
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.verse a, .comment-quote a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-time);
}

.verse a:hover, .comment-quote a:hover {
    text-decoration: underline;
}

/* Định dạng blockquote cho phần chú thích */
.comment-quote p {
    margin-bottom: 1rem;
}

.comment-quote strong {
    color: var(--primary-color);
    font-weight: bold;
}

.comment-quote em {
    font-style: italic;
}

.comment-quote code {
    font-family: 'Courier New', monospace;
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.comment-quote a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted;
}

.comment-quote a:hover {
    border-bottom: 1px solid;
}

/* Định dạng cho danh sách trong comment */
.comment-quote ol, .comment-quote ul {
    margin: 0.5rem 0 1rem 1.5rem;
    padding-left: 0.5rem;
}

.comment-quote li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 600px) {
    .navigation {
        flex-direction: column;
        align-items: center;
    }

    .chapters {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .main-title {
        font-size: 2.5rem;
    }
    
    .dropdown-content {
        left: 50%;
        transform: translateX(-50%);
        width: 200px;
        max-width: 90vw;
    }
    
    .chapter-nav {
        width: 100%;
        justify-content: space-between;
    }
    
    .home-link {
        margin-bottom: 0.5rem;
        font-size: 1.3rem;
    }
}

/* Theme switcher */
.theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--paper-color);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 1000;
    display: flex;
    gap: 0.5rem;
}

.theme-button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform var(--transition-time);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.theme-button.light {
    background: #f9f9f9;
    color: #333;
    border: 1px solid #ddd;
}

.theme-button.dark {
    background: #1a1a1a;
    color: #fff;
}

.theme-button.active {
    outline: 2px solid var(--accent-color);
}

@media (max-width: 600px) {
    .theme-switcher {
        bottom: 10px;
        right: 10px;
        padding: 8px;
    }
    
    .theme-button {
        width: 28px;
        height: 28px;
    }
}

/* Page transition animations are now in animations.css */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-2px);
    }
}

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

/* Hide scroll indicator on smaller screens */
@media (max-width: 600px) {
    .scroll-indicator {
        display: none;
    }
}

.hero-illustration {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 2rem auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 5px 20px var(--shadow-color);
    transition: transform var(--transition-time), box-shadow var(--transition-time);
}

.hero-illustration:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

@media (max-width: 600px) {
    .hero-illustration {
        max-width: 100%;
        margin: 1.5rem auto;
    }
}
