/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --background: #ffffff;
    --background-alt: #f8f9fa;
    --border-color: #e1e8ed;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background);
    font-weight: 400;
}

/* Reset default link styles */
a {
    color: inherit;
    text-decoration: none !important;
}

a:hover {
    text-decoration: none !important;
}

a:focus {
    text-decoration: none !important;
}

a:active {
    text-decoration: none !important;
}

a:visited {
    text-decoration: none !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.logo h1 a {
    color: inherit;
    text-decoration: none;
}

.logo h1 a:hover {
    color: inherit;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-light);
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-btn:hover,
.nav-btn.active {
    background: var(--background-alt);
    color: var(--primary-color);
    text-decoration: none;
}

/* Main content */
.main {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* Views */
.view {
    display: block;
}

.view.active {
    display: block;
}

/* Welcome section */
.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-section h2 {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.welcome-text {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
    font-weight: 400;
}

.quick-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 400;
    transition: var(--transition);
    min-width: 120px;
    justify-content: center;
    font-size: 0.9rem;
}

.action-btn.primary {
    background: var(--accent-color);
    color: white;
}

.action-btn.primary:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}

.action-btn.secondary {
    background: var(--background-alt);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.action-btn.secondary:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}

/* Books grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.book-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    z-index: 1;
    text-decoration: none;
    color: inherit;
    display: block;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
    text-decoration: none;
}

.book-card h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    grid-column: unset;
    text-align: left;
    margin: 0 0 0.5rem 0;
}

.book-card .book-info {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Search section */
.search-section {
    text-align: center;
    margin-bottom: 2rem;
}

.search-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.search-box input {
    flex: 1;
    padding: 1rem;
    border: none;
    outline: none;
    font-size: 1rem;
}

.search-box button {
    padding: 1rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: #c0392b;
}

/* Search results */
.search-results {
    max-width: 800px;
    margin: 0 auto;
}

.search-results h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

.verses-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.verse-result {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.verse-result:hover {
    box-shadow: var(--shadow);
}

.verse-reference {
    margin-bottom: 0.5rem;
}

.reference-link {
    font-weight: 300;
    color: var(--accent-color);
    text-decoration: none !important;
    transition: var(--transition);
}

.reference-link:hover {
    color: #c0392b;
    text-decoration: none !important;
}

.verse-text {
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
    font-weight: 300;
}

.verse-text mark {
    background: #fff3cd;
    color: #856404;
    padding: 0.1em 0.2em;
    border-radius: 3px;
}

.no-results {
    text-align: center;
    padding: 2rem;
    background: var(--background-alt);
    border-radius: var(--radius);
    margin-top: 2rem;
}

.no-results p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.search-tips {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.search-tips h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.search-tips ul {
    color: var(--text-light);
    line-height: 1.6;
}

.search-tips li {
    margin-bottom: 0.25rem;
}

/* Random verse section */
.random-verse-section {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.random-verse-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.verse-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.verse-content .verse-text {
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-style: italic;
    font-weight: 300;
}

.verse-content .verse-reference {
    font-weight: 300;
    color: var(--accent-color);
}

.verse-content .verse-reference a {
    color: inherit;
    text-decoration: none !important;
    transition: var(--transition);
}

.verse-content .verse-reference a:hover {
    color: #c0392b;
    text-decoration: none !important;
}

/* Reading view */
.reading-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.chapter-info {
    width: 100%;
}

.chapter-info h1,
.chapter-info h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.book-info {
    margin-bottom: 1rem;
}

.book-description {
    color: var(--text-light);
    font-size: 1rem;
}

.chapter-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.chapter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
}

.chapter-btn:hover {
    background: #c0392b;
    text-decoration: none;
}

.chapter-btn.disabled {
    background: var(--text-light);
    cursor: not-allowed;
    pointer-events: none;
}

.current-chapter {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    white-space: nowrap;
}

/* Audio Player */
.audio-player {
    margin: 1.5rem auto;
    padding: 0;
    max-width: 800px;
    text-align: center;
}

.audio-player audio {
    width: 100%;
    max-width: 100%;
    height: 40px;
    border-radius: var(--radius);
    outline: none;
}

/* Chapter content */
.chapter-content {
    max-width: 800px;
    margin: 0 auto;
}

.chapter-title {
    margin-bottom: 2rem;
}

.title-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 500;
    color: var(--primary-color);
}

.verse {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    transition: var(--transition);
    scroll-margin-top: 80px; /* Account for sticky header */
}

.verse:hover {
    background: var(--background-alt);
}

.verse:target {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    box-shadow: var(--shadow);
}

.verse-number {
    display: inline-block;
    min-width: 8px;
    font-weight: 400;
    color: var(--accent-color);
    font-size: 0.9rem;
    vertical-align: top;
    margin-right: 0.5rem;
}

.verse-content {
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
    font-weight: 300;
}

/* Chapter navigation */
.chapter-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.chapter-navigation h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.chapter-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.chapter-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: var(--background-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 300;
    font-size: 0.85rem;
}

.chapter-link:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    text-decoration: none;
}

.chapter-link.current {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Book overview */
.book-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.book-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.chapters-grid {
    max-width: 800px;
    margin: 0 auto;
}

.chapters-grid h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.chapter-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.chapter-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.chapter-card:hover {
    background: var(--background-alt);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.chapter-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    font-weight: 300;
    font-size: 1rem;
}

.chapter-label {
    font-weight: 400;
    color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--background-alt);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .nav-btn {
        flex: 1;
        justify-content: center;
    }

    .welcome-section h2 {
        font-size: 2rem;
    }

    .welcome-text {
        font-size: 1.1rem;
    }

    .quick-actions {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 300px;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .audio-player {
        margin: 1rem auto;
        padding: 0;
    }

    .audio-player audio {
        width: 100%;
        height: 40px;
    }

    .reading-header {
        margin-bottom: 1.5rem;
        text-align: center;
    }

    .chapter-info h1,
    .chapter-info h2 {
        font-size: 1.6rem;
        margin-bottom: 1.2rem;
    }

    .chapter-nav {
        justify-content: space-between;
        gap: 0.5rem;
        max-width: 100%;
        margin: 0;
    }

    .chapter-btn {
        min-width: 70px;
        font-size: 0.8rem;
        padding: 0.5rem 0.6rem;
        justify-content: center;
    }

    .current-chapter {
        font-size: 1rem;
        font-weight: 600;
        text-align: center;
        flex: 1;
    }

    .search-box {
        flex-direction: column;
        max-width: 100%;
    }

    .search-box button {
        padding: 0.75rem;
    }

    .verse-content {
        font-size: 1.1rem;
    }

    .chapter-links {
        gap: 0.25rem;
    }

    .chapter-link {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .book-header {
        margin-bottom: 1.5rem;
    }

    .book-info h1 {
        font-size: 1.5rem;
    }

    .chapter-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .welcome-section h2 {
        font-size: 1.5rem;
    }

    .verse-number {
        min-width: 25px;
        font-size: 0.8rem;
    }

    .verse-content {
        font-size: 1rem;
    }

    .chapter-info h1,
    .chapter-info h2 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .chapter-nav {
        gap: 0.25rem;
        justify-content: space-between;
        margin: 0;
    }

    .chapter-btn {
        min-width: 60px;
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
        justify-content: center;
    }

    .current-chapter {
        font-size: 0.9rem;
        flex: 1;
        text-align: center;
    }

    .chapter-links {
        max-width: 100%;
    }

    .chapter-link {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}
