:root {
    --bg-dark: #0f111a;
    --bg-panel: #1a1d2d;
    --bg-card: #22263b;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #60a5fa; /* Blue for Midrash */
    --accent-glow: rgba(96, 165, 250, 0.4);
    --border: #334155;
    --hebrew-font: 'Noto Sans Hebrew', sans-serif;
    --tamil-font: 'Noto Sans Tamil', sans-serif;
    --main-font: 'Inter', sans-serif;
}

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

body {
    font-family: var(--main-font);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 4px 0 15px rgba(0,0,0,0.5);
    z-index: 10;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--accent);
}

.logo i {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-select {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--main-font);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.premium-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.premium-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-group {
    margin-top: 0.5rem;
}

.premium-btn {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.premium-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.premium-btn:disabled {
    background: var(--bg-card);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

.view-toggles {
    margin-top: auto;
    background-color: var(--bg-card);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.view-toggles h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.slider {
    position: relative;
    width: 38px;
    height: 20px;
    background-color: var(--border);
    border-radius: 20px;
    transition: 0.3s;
}

.slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.toggle-switch input:checked + .slider {
    background-color: var(--accent);
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(18px);
}

.label-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

.icon-btn {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--border);
    color: var(--accent);
}

/* Main Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: var(--bg-dark);
}

.content-header {
    padding: 1.5rem 2.5rem;
    background: rgba(26, 29, 45, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.title-gradient {
    font-size: 1.8rem;
    font-weight: 300;
}

.status-message {
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    border-radius: 4px;
}

.status-message.success { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.status-message.error { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

.results-container {
    flex: 1;
    padding: 2rem 2.5rem;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.results-container::-webkit-scrollbar { width: 8px; }
.results-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.3; }

/* Verse Card */
.verse-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease backwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.verse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.75rem;
}

.verse-ref {
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.verse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.verse-col { display: flex; flex-direction: column; gap: 0.5rem; }
.lang-title { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }

.hebrew-text { font-family: var(--hebrew-font); font-size: 1.6rem; direction: rtl; text-align: right; line-height: 1.8; }
.tanglish-text { font-style: italic; color: #cbd5e1; }
.tamil-text { font-family: var(--tamil-font); line-height: 1.8; }

/* Loader Overlay */
.loader-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 17, 26, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.premium-spinner {
    width: 50px; height: 50px;
    border: 3px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
