/* CSS Variables for Themes */
:root {
    --font-primary: 'Inter', Arial, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --border-radius-sm: 8px;
}

/* Dark Theme (Default) */
.theme-dark {
    --bg-primary: #0B0C0D;
    --bg-secondary: #1a1b1e;
    --bg-tertiary: #2a2b2e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #888888;
    --accent-primary: #E5B557;
    --accent-secondary: #d4a843;
    --border-color: #E5B557;
    --border-light: #3a3b3e;
    --highlight-bg: rgba(229, 181, 87, 0.3);
    --highlight-text: #E5B557;
}

/* Light Theme */
.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --accent-primary: #0066cc;
    --accent-secondary: #0052a3;
    --border-color: #0066cc;
    --border-light: #dee2e6;
    --highlight-bg: rgba(0, 102, 204, 0.2);
    --highlight-text: #0066cc;
}

/* Sepia Theme */
.theme-sepia {
    --bg-primary: #f4f1e8;
    --bg-secondary: #ede6d3;
    --bg-tertiary: #e6dcc3;
    --text-primary: #3c2e26;
    --text-secondary: #5d4e42;
    --text-muted: #8b7355;
    --accent-primary: #8b4513;
    --accent-secondary: #a0522d;
    --border-color: #8b4513;
    --border-light: #d4c4a8;
    --highlight-bg: rgba(139, 69, 19, 0.2);
    --highlight-text: #8b4513;
}

/* Blue Theme */
.theme-blue {
    --bg-primary: #f0f4f8;
    --bg-secondary: #e2e8f0;
    --bg-tertiary: #cbd5e0;
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    --text-muted: #4a5568;
    --accent-primary: #3182ce;
    --accent-secondary: #2c5aa0;
    --border-color: #3182ce;
    --border-light: #e2e8f0;
    --highlight-bg: rgba(49, 130, 206, 0.2);
    --highlight-text: #3182ce;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition-smooth);
}

.container {
    width: 100%;
    max-width: none;
    padding: 0;
}

/* Header */
.header {
    background-color: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.title-icon {
    width: 32px;
    height: 32px;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 8px;
    background-color: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
}

.theme-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    background-color: var(--bg-primary);
    color: var(--accent-primary);
}

.theme-btn.active {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

.theme-btn svg {
    width: 18px;
    height: 18px;
}

/* Controls */
.controls {
    background-color: var(--bg-secondary);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}

.navigation {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.select-control {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    min-width: 150px;
}

.select-control:hover {
    border-color: var(--accent-primary);
}

.select-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(229, 181, 87, 0.1);
}

.nav-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.nav-btn {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.nav-btn:hover:not(:disabled) {
    background-color: var(--accent-secondary);
    transform: translateY(-1px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nav-btn svg {
    width: 16px;
    height: 16px;
}

/* Search Container */
.search-container {
    background-color: var(--bg-secondary);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}

.search-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 0 20px;
    padding: 0 20px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 14px 50px 14px 50px;
    font-size: 16px;
    transition: var(--transition-smooth);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(229, 181, 87, 0.1);
}

.clear-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.clear-btn:hover {
    color: var(--accent-primary);
    background-color: var(--bg-primary);
}

.clear-btn svg {
    width: 16px;
    height: 16px;
}

.search-mode,
.search-lang {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.search-mode:hover,
.search-lang:hover {
    border-color: var(--accent-primary);
}

/* Bible Content */
.bible-content {
    padding: 30px 20px;
}

.bible-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

.bible-column {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.bible-column:hover {
    box-shadow: var(--shadow-medium);
}

.column-header {
    background-color: var(--bg-tertiary);
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
}

.column-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.lang-flag {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.chapter-info {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.verses-container {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-tertiary);
}

.verses-container::-webkit-scrollbar {
    width: 6px;
}

.verses-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.verses-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.verse {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.verse:hover {
    background-color: var(--bg-tertiary);
}

.verse-number {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    min-width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.verse-text {
    flex: 1;
    line-height: 1.7;
    font-size: 16px;
}

/* Search Highlighting */
.search-highlight {
    background-color: #ffff00 !important;
    color: #000000 !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    font-weight: bold !important;
    border: 1px solid #ff6600 !important;
    display: inline !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    color: var(--accent-primary);
    animation: spin 1s linear infinite;
}

.loading-spinner svg {
    width: 48px;
    height: 48px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (min-width: 1025px) {
    .mobile-toggle {
        display: none;
    }
}

@media (max-width: 1024px) {
    .bible-columns {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .navigation {
        justify-content: center;
    }
    
    .nav-buttons {
        margin-left: 0;
        margin-top: 12px;
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile View Toggle */
    .mobile-toggle {
        display: flex;
        justify-content: center;
        margin-bottom: 20px;
        padding: 0 20px;
    }
    
    .toggle-btn {
        background-color: var(--bg-tertiary);
        color: var(--text-secondary);
        border: 1px solid var(--border-light);
        padding: 8px 16px;
        cursor: pointer;
        transition: var(--transition-smooth);
        font-size: 14px;
        font-weight: 500;
    }
    
    .toggle-btn:first-child {
        border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
        border-right: none;
    }
    
    .toggle-btn:last-child {
        border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    }
    
    .toggle-btn.active {
        background-color: var(--accent-primary);
        color: var(--bg-primary);
    }
    
    /* Combined View Styles */
    .bible-content.combined-view .bible-columns {
        display: none;
    }
    
    .bible-content.combined-view .combined-view-container {
        display: block !important;
    }
    
    .combined-view-container {
        display: none;
    }
    
    .combined-chapter-header {
        background-color: var(--bg-secondary);
        padding: 20px;
        border-radius: var(--border-radius);
        margin-bottom: 20px;
        text-align: center;
        border: 2px solid var(--border-color);
    }
    
    .combined-chapter-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--accent-primary);
        margin-bottom: 8px;
    }
    
    .combined-verse-group {
        background-color: var(--bg-secondary);
        border-radius: var(--border-radius);
        margin-bottom: 32px;
        padding: 24px;
        border: 1px solid var(--border-light);
    }
    
    .combined-verse-number {
        background-color: var(--accent-primary);
        color: var(--bg-primary);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 14px;
        margin-right: 12px;
        flex-shrink: 0;
    }
    
    .combined-verse {
        margin-bottom: 16px;
        padding: 12px 0;
        display: flex;
        align-items: flex-start;
        gap: 12px;
    }
    
    .combined-verse-text {
        font-size: 16px;
        line-height: 1.7;
        flex: 1;
    }
    
    .combined-verse[data-lang="tamil"] .combined-verse-text {
        font-family: 'Noto Sans Tamil', var(--font-primary);
    }
    
    .combined-verse[data-lang="telugu"] .combined-verse-text {
        font-family: 'Noto Sans Telugu', var(--font-primary);
    }
    
    .bible-content.combined-view .bible-columns {
        display: none;
    }
    
    .bible-content.combined-view .combined-view-container {
        display: block !important;
    }
    
    .combined-view-container {
        display: none;
    }
    
    .combined-chapter-header {
        background-color: var(--bg-secondary);
        padding: 20px;
        border-radius: var(--border-radius);
        margin-bottom: 20px;
        text-align: center;
        border: 2px solid var(--border-color);
    }
    
    .combined-chapter-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--accent-primary);
        margin-bottom: 8px;
    }
    
    .combined-verses-container {
        display: block;
    }
    
    .combined-verse-group {
        background-color: var(--bg-secondary);
        border-radius: var(--border-radius);
        margin-bottom: 24px;
        padding: 20px;
        border: 1px solid var(--border-light);
    }
    
    .combined-verse {
        margin-bottom: 16px;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-light);
    }
    
    .combined-verse:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .combined-verse-number {
        background-color: var(--accent-primary);
        color: var(--bg-primary);
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 12px;
        margin-right: 12px;
        flex-shrink: 0;
    }
    
    .combined-verse-text {
        font-size: 16px;
        line-height: 1.7;
    }
    
    .search-result-info {
        background-color: var(--bg-secondary);
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-light);
        text-align: center;
        color: var(--text-secondary);
        font-size: 14px;
        font-weight: 500;
    }
    
    .verse-reference {
        background-color: var(--accent-primary);
        color: var(--bg-primary);
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 8px;
        display: inline-block;
    }
    
    .combined-verse[data-lang="tamil"] {
        font-family: 'Baloo Chettan', var(--font-primary);
    }
    
    .combined-verse[data-lang="telugu"] {
        font-family: 'Noto Sans Telugu', var(--font-primary);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 0 16px;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .search-group {
        flex-direction: column;
        align-items: stretch;
        padding: 0 16px;
    }
    
    .search-input-wrapper {
        min-width: auto;
    }
    
    .navigation {
        flex-direction: column;
        gap: 12px;
        padding: 0 16px;
    }
    
    .select-control {
        width: 100%;
    }
    
    .nav-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .verse-text {
        font-size: 15px;
    }
    
    .verses-container {
        max-height: 60vh;
    }
    
    .bible-content {
        padding: 30px 16px;
    }
    
    .mobile-toggle {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .verse {
        flex-direction: column;
        gap: 8px;
    }
    
    .verse-number {
        align-self: flex-start;
        min-width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .title {
        font-size: 1.25rem;
    }
    
    .theme-selector {
        gap: 4px;
    }
    
    .theme-btn {
        padding: 6px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Focus States */
button:focus,
select:focus,
input:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Print Styles */
@media print {
    .header,
    .controls,
    .search-container {
        display: none;
    }
    
    .bible-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .verse {
        break-inside: avoid;
    }
}