:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --background-color: #f8f9fa;
    --text-color: #333;
    --card-bg: #ffffff;
    --accent-color: #ff9a9e;
    --font-heading: 'Outfit', sans-serif;
    --font-tamil: 'Tiro Tamil', serif;
}

body {
    font-family: var(--font-heading);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    min-height: 100vh;
}

/* Local Database Viewer Styles */
.local-commentary {
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Georgia', serif;
    /* Better for reading */
    line-height: 1.8;
    color: #333;
    padding-bottom: 50px;
}

.local-commentary h2 {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.local-commentary p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.local-commentary a {
    color: var(--primary-color);
    text-decoration: none;
    pointer-events: none;
    /* Disable links for now as they point to external sites */
}

.local-commentary .versenum {
    font-weight: bold;
    color: #555;
    margin-top: 20px;
}

.local-commentary .verse {
    font-style: italic;
    color: #666;
    margin-bottom: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-left: 4px solid var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

header {
    text-align: center;
    padding: 40px 0 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.card .icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.card h2 {
    font-family: var(--font-tamil);
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.card p {
    font-size: 0.9rem;
    color: #666;
}

/* Search */
.search-bar-container {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#search-input {
    width: 100%;
    max-width: 500px;
    padding: 15px 20px;
    border-radius: 50px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    outline: none;
    transition: box-shadow 0.3s;
}

#search-input:focus {
    box-shadow: 0 5px 20px rgba(106, 17, 203, 0.2);
}

.filter-options {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: #e0e0e0;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    font-size: 0.9rem;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

/* List Styles */
.list-container {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.list-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item:hover {
    background: #f9f9f9;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item h3 {
    font-size: 1.1rem;
    margin: 0;
    font-family: var(--font-tamil);
}

/* Content View */
#content-view {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 0;
    box-shadow: none;
}

#reader-content {
    line-height: 1.8;
    font-size: 1.15rem;
    color: var(--text-color);
    padding: 10px;
    font-family: 'Inter', sans-serif;
    text-align: initial;
    /* Reset to allow HTML alignment */
}

#reader-content p {
    margin-bottom: 1.2rem;
}

#reader-content b, 
#reader-content strong {
    color: var(--primary-color);
    font-weight: 700;
}

#reader-content i, 
#reader-content em {
    color: #666;
    font-style: italic;
}

#reader-content h1, 
#reader-content h2, 
#reader-content h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-tamil);
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

#reader-content ul, 
#reader-content ol {
    margin-bottom: 1.2rem;
    padding-left: 20px;
}

#reader-content li {
    margin-bottom: 0.5rem;
}

/* Ensure images don't overflow */
#reader-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 10px 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#scroll-top-btn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: var(--secondary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 10001;
    transition: transform 0.3s, opacity 0.3s;
}

#scroll-top-btn:active {
    transform: scale(0.9);
}

/* Utility */
.back-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 20px;
}

#breadcrumbs {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

#home-link {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: bold;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    #content-view {
        padding: 5px 10px;
        /* Minimal padding for text readability */
    }
}

/* Auth Styles */
.auth-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(5px);
    z-index: 20000; display: none; justify-content: center; align-items: center; }
.auth-container {
    background: var(--card-bg); width: 95%; max-width: 450px; border-radius: 20px;
    overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.3); animation: slideUpAuth 0.3s ease-out; }
@keyframes slideUpAuth { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.auth-tabs { display: flex; background: var(--background-color); border-bottom: 1px solid #eee; }
.auth-tab { flex: 1; padding: 15px; text-align: center; cursor: pointer; font-weight: 700; color: #94a3b8; transition: 0.3s; font-size: 0.95rem; }
.auth-tab.active { background: var(--card-bg); color: var(--primary-color); border-bottom: 3px solid var(--primary-color); }
.auth-form { padding: 25px; max-height: 80vh; overflow-y: auto; }
.auth-form h2 { margin-top: 0; color: var(--primary-color); text-align: center; font-size: 1.3rem; }
.auth-form input, .auth-form select { width: 100%; padding: 12px; margin-bottom: 12px; border-radius: 10px; border: 1px solid #ddd; box-sizing: border-box; font-size: 0.95rem; outline: none; }
.auth-form input:focus { border-color: var(--primary-color); }
.auth-btn { width: 100%; padding: 14px; border-radius: 10px; border: none; background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: white; font-weight: 800; font-size: 1rem; cursor: pointer; }
.auth-toggle-link { text-align: center; margin-top: 15px; color: var(--primary-color); cursor: pointer; font-size: 0.9rem; font-weight: 600; }
.user-badge { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; padding: 6px 14px; border-radius: 30px; background: rgba(0,0,0,0.5); color: white; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.2); }