:root {
    --bg-dark: #0f1115;
    --bg-panel: #1a1d24;
    --bg-modal: #232730;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #d4af37;
    --accent-hover: #fcd34d;
    --border: rgba(255,255,255,0.08);
    --verse-hover: rgba(212, 175, 55, 0.1);
    --verse-active: rgba(212, 175, 55, 0.2);
}

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

/* Estilização Premium das Barras de Rolagem */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.4); /* Brilho dourado ao passar o mouse */
}
/* Firefox compatibility */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* 
 * MOBILE NATIVO: ROLAGEM LIVRE
 * Removemos o bloqueio de altura para que os celulares
 * usem a rolagem natural e ultra-suave do próprio sistema.
 */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    position: sticky; /* Mantém o menu no topo ao rolar */
    top: 0;
    z-index: 10;
}

.logo { font-family: 'Merriweather', serif; font-weight: bold; color: var(--accent); font-size: 1.2rem; }

.book-selector {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    cursor: pointer;
}

.app-layout { position: relative; }

.reading-area {
    padding: 1.5rem;
    padding-bottom: 5rem;
    scroll-behavior: smooth;
}

.chapter-title {
    font-family: 'Merriweather', serif;
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.bible-text { max-width: 800px; margin: 0 auto; }

.chapter-nav {
    max-width: 800px;
    margin: 2rem auto;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.chapter-nav button {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    flex: 1;
    transition: all 0.2s ease;
}

.chapter-nav button:hover { background: var(--verse-hover); color: var(--accent); border-color: var(--accent); }

.verse {
    font-family: 'Merriweather', serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #cbd5e1;
    margin-bottom: 0.8rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    gap: 0.5rem;
}

.verse sup { color: var(--accent); font-size: 0.75rem; font-weight: bold; margin-top: 0.5rem; user-select: none; }
.verse:hover { background-color: var(--verse-hover); }
.verse.active { background-color: var(--verse-active); border-left: 3px solid var(--accent); }

.study-panel {
    position: fixed;
    bottom: 0; left: 0; width: 100%; height: 85vh;
    background-color: var(--bg-panel);
    border-top-left-radius: 24px; border-top-right-radius: 24px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20; display: flex; flex-direction: column;
}
.study-panel:not(.hidden) { transform: translateY(0); }

.panel-drag-handle { width: 40px; height: 4px; background-color: var(--border); border-radius: 2px; margin: 12px auto; }
.panel-header { display: flex; justify-content: space-between; align-items: center; padding: 0 1.5rem 1rem; border-bottom: 1px solid var(--border); }
.panel-header h2 { font-size: 1.2rem; color: var(--accent); }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.panel-action { padding: 1.5rem; text-align: center; }

.primary-btn { width: 100%; background-color: var(--accent); color: #000; border: none; padding: 1rem; border-radius: 12px; font-size: 1.05rem; font-weight: 600; cursor: pointer; }
.primary-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.secondary-btn { width: 100%; background-color: #25D366; color: #fff; border: none; padding: 1rem; border-radius: 12px; font-size: 1.05rem; font-weight: 600; cursor: pointer; margin-top: 1rem; transition: background 0.2s; }
.secondary-btn:hover { background-color: #128C7E; }
.secondary-btn.hidden { display: none; }

.results-area { flex: 1; overflow-y: auto; padding: 0 1.5rem 2rem; display: flex; flex-direction: column; gap: 1rem; }
.results-area.hidden { display: none; }
.result-card { background: rgba(0,0,0,0.2); border: 1px solid var(--border); padding: 1.2rem; border-radius: 12px; }
.result-card h3 { color: var(--accent); font-size: 1rem; margin-bottom: 0.8rem; }
.result-card p { font-size: 0.95rem; line-height: 1.6; color: var(--text-main); }
.highlight-card { border: 1px solid var(--accent); background: rgba(212, 175, 55, 0.05); }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 50; display: none; justify-content: center; align-items: center; }
.modal.active { display: flex; }
.modal-content { background: var(--bg-modal); width: 90%; max-width: 500px; height: 80vh; border-radius: 16px; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; padding: 1.5rem; border-bottom: 1px solid var(--border); }
.modal-body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.books-grid, .chapters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.8rem; }
.chapters-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
.book-item, .chapter-item { background: var(--bg-panel); border: 1px solid var(--border); padding: 1rem; text-align: center; border-radius: 8px; cursor: pointer; font-size: 0.9rem; }

/* --- DESKTOP SIDEBAR (Mobile First: Oculta por padrão) --- */
.desktop-sidebar {
    display: none;
}
.sidebar-header h3 { color: var(--accent); font-size: 1.1rem; }
.sidebar-book-title { width: 100%; text-align: left; background: none; border: none; color: var(--text-main); padding: 0.8rem; font-size: 1rem; cursor: pointer; border-radius: 6px; font-family: 'Inter', sans-serif; transition: background 0.2s; }
.sidebar-book-title:hover { background: rgba(255,255,255,0.05); color: var(--accent); }
.sidebar-chapters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; padding: 0.5rem; background: rgba(0,0,0,0.2); border-radius: 8px; margin-bottom: 0.5rem; }
.sidebar-chapters.hidden { display: none; }
.sidebar-chapter-btn { background: var(--bg-panel); border: 1px solid var(--border); color: var(--text-main); padding: 0.5rem 0; border-radius: 4px; cursor: pointer; transition: 0.2s; }
.sidebar-chapter-btn:hover, .sidebar-chapter-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* --- PC / DESKTOP --- */
@media (min-width: 1024px) {
    /* Escondemos o botão de menu de celular no topo */
    .book-selector { display: none; }

    /* Exibimos a barra lateral esquerda */
    .desktop-sidebar {
        display: flex;
        flex-direction: column;
        width: 300px;
        min-width: 300px;
        background-color: var(--bg-panel);
        border-right: 1px solid var(--border);
        height: 100%;
    }
    
    .sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--border); }
    .sidebar-content { flex: 1; overflow-y: auto; padding: 1rem; }
    
    body {
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }
    
    .app-layout {
        display: flex;
        flex-direction: row; 
        flex: 1;
        overflow: hidden;
    }
    
    .reading-area {
        flex: 1;
        overflow-y: auto;
    }

    .bible-text { max-width: 900px; }

    .study-panel {
        position: relative;
        width: 450px;
        min-width: 450px;
        height: 100%;
        border-radius: 0;
        border-left: 1px solid var(--border);
        box-shadow: none;
        transform: translateX(100%);
    }
    .study-panel:not(.hidden) { transform: translateX(0); }
    .panel-drag-handle { display: none; }
}
