:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --bg: #ffffff;
    --text: #111;
    --gray: #f4f4f4;
}

/* Global Reset & Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding-top: 60px; /* Space for fixed header */
    padding-bottom: 100px; /* Space for fixed audio controls */
    color: var(--text);
    background: var(--bg);
    /* Ensure the main container takes up space */
    min-height: 80vh;
}

/* Links Reset */
a {
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* --- HEADER --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

#back-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 10px 0;
}

/* --- VIEW 1: BOOK LIST --- */
.book-item {
    display: block;
    padding: 1.2rem;
    border-bottom: 1px solid #eee;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.book-item:active {
    background: var(--gray);
}

/* --- VIEW 2: CHAPTER GRID --- */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 15px;
}

.chapter-box {
    display: flex;
    aspect-ratio: 1; 
    background: var(--gray);
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}

.chapter-box:active {
    background: var(--accent);
    color: white;
}

/* --- VIEW 3: READING MODE --- */
.reader-container {
    padding: 20px;
    line-height: 1.8;
    font-size: 1.15rem;
    font-family: 'Georgia', serif; 
}

.verse-num {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--accent);
    vertical-align: top;
    margin-right: 4px;
    position: relative;
    top: -2px;
}

.active-word {
    background-color: #ffeb3b !important;
    color: black;
    border-radius: 3px;
    transition: background-color 0.1s;
}

/* --- BOTTOM PLAYER BAR --- */
#player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: #222;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box; 
    z-index: 200;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

#player-bar.hidden {
    transform: translateY(100%); 
    display: flex !important; /* Keep flex layout even when hidden off-screen */
}

/* Player Text Info */
.player-info {
    display: flex;
    flex-direction: column;
}

.player-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-subtitle {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
}

/* Player Controls */
.player-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.control-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 10px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
}

.control-btn:hover {
    color: var(--accent);
    background: rgba(255,255,255,0.1);
}

.control-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Larger Play Button */
#toggle-play-btn svg {
    width: 32px;
    height: 32px;
}

.hidden {
    display: none !important;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    #player-bar {
        padding: 0 15px;
    }
    .player-subtitle {
        font-size: 1rem;
    }
}

