:root {
    --bg-primary: #f8f9fa;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f3f5;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --accent: #d97706;
    /* Traditional amber/saffron tone */
    --accent-light: #fef3c7;
    --border: #e9ecef;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
}

[data-theme="dark"] {
    --bg-primary: #0f1015;
    --bg-surface: #181a20;
    --bg-surface-elevated: #22252e;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent: #f59e0b;
    --accent-light: rgba(245, 158, 11, 0.15);
    --border: #282c37;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

#app-container {
    width: 100%;
    max-width: 540px;
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* App Bar */
.app-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-primary);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.app-title-wrapper {
    text-align: center;
    flex-grow: 1;
}

.app-bar h1 {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

#header-subtitle {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.icon-btn:active {
    transform: scale(0.92);
}

/* Search Bar */
.search-bar-wrapper {
    position: relative;
    margin: 16px 16px 8px;
    display: flex;
    align-items: center;
}

.search-bar-wrapper svg {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
}

.search-bar-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.search-bar-wrapper input:focus {
    border-color: var(--accent);
}

/* List Layout */
.list-container {
    padding: 12px 16px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Chapter Cards */
.chapter-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chapter-card:active {
    transform: scale(0.98);
    background: var(--bg-surface-elevated);
}

.chapter-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chapter-number-pill {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chapter-name {
    font-size: 0.98rem;
    font-weight: 600;
}

/* Hero Section inside Chapter view */
.chapter-hero {
    text-align: center;
    padding: 24px 16px 12px;
}

.chapter-hero .badge {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.chapter-hero h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.hero-caption {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Verse Cards */
.verse-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease, border-color 0.2s;
}

.verse-card:active {
    transform: scale(0.99);
    border-color: var(--accent);
}

.verse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.verse-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
}

.verse-text {
    font-size: 0.96rem;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-line;
}

/* Toast */
#toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    background: #1f2937;
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    z-index: 100;
}

#toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#toast svg {
    stroke: #10b981;
}