@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Merriweather:wght@300;400&display=swap');

:root {
    --background: #faf8f5;
    --surface: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #2563eb;
    --border: #e5e7eb;
    --reading-font-size: 1.25rem;
}


.dark-mode {
    --background: #111827;
    --surface: #1f2937;
    --text: #f9fafb;
    --muted: #9ca3af;
    --accent: #3b82f6;
    --border: #374151;
}

body,
.card,
.button {
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

html,
body {
    margin: 0;
    height: 100%;
}

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

body {
    background: var(--background);
    color: var(--text);
    font-family: Inter, sans-serif;
    overflow: hidden;
}

.app {
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

.reader {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 0;
}

/* Top Navigation */

.topbar {
    z-index: 100;
    background: var(--background);
    backdrop-filter: blur(12px);

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 1rem 2rem;
    flex-shrink: 0;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
}

.selectors {
    display: flex;
    gap: 2rem;
    margin: 8px 2px 8px 2px;
}

select {
    padding: .6rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: .95rem;
    color: var(--text);
}

.hidden {
    display: none !important;
}

/* .overlay {
    height: 50vh;
    padding: 24px 24px 24px 24px;
    position: fixed;
    background-color: var(--surface);
    border-radius: 24px;
    box-shadow:
        0 10px 30px rgba(0,0,0,.05);    z-index: 999;
    top: 200px;
    left: 25%;
    overflow-x: hidden;
    border: 1px solid;
    border-radius: 18px;
    transition: width 0.4s ease-in-out;
    width: 50%;
    display: flex;
    flex-direction: column;

    
} */

.overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: min(720px, 92vw);
    max-height: 85vh;

    padding: 24px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06);

    z-index: 999;

    overflow: hidden;
    gap: 16px;
    
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.98);
    transition: 
        opacity 0.2s ease,
        transform 0.2s ease;
}

.overlay > :first-child {
    grid-column: span 2;
    justify-self: center;
    width: 50%;
}

#menuClose {
    padding: .6rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: .95rem;
    color: var(--text);
}

.overlay > :last-child {
  grid-column: span 2;  /* Forces the item to take up the full row width */
  justify-self: center; /* Centers the item horizontally within that row */
  width: 50%;           /* Optional: Matches the width of the items above it */
}

/* Optional: active state */
.overlay.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Scrollable content area inside */
.overlay-content {
    overflow-y: auto;
    padding-right: 6px;
}

#themeBtn {
    padding: .6rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: .95rem;
    color: var(--text);
}

#fontText {
    padding: .6rem 1rem;
    background: var(--surface);
    font-size: .95rem;
    color: var(--text);
}

#sliderContainer {
    background: var(--surface);
    font-size: .95rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text);
    width: 100%;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#fontSizing {
    margin: 2px 8px 12px 8px;
    width: 75%;
    color: var(--text);

}

/* Reading Area */


.chapter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface);
    border-radius: 24px;
    box-shadow:
        0 10px 30px rgba(0,0,0,.05);
}

.chapter-header button {
    background-color: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    display: flex;
    align-items: center;
    color: var(--text);
}


.chapter-header button:active {
    transform: translateY(1px);
}

.chapter-header button i {
    height: 20px;
    height: 20px;
    stroke-width: 2;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#headerBtn {
    flex-grow: 1;
    font-size: clamp(1.25rem, 4vw, 2rem);    
    font-weight: 700;
    margin: 0;
    color: var(--text);
    border-radius: 999px;
    padding: .6rem 1rem;
    background: transparent;
    letter-spacing: -0.02em;
}

#chapter {
    background: var(--surface);
    padding: 3rem;
    border-radius: 24px;
    box-shadow:
        0 10px 30px rgba(0,0,0,.05);
    max-width: 760px;
    margin: 0 auto;
}

.verses {
    font-family: Merriweather, serif;
    font-size: var(--reading-font-size);
    line-height: 2.0;
    margin-bottom: 1.5rem;
}

/* Hover */

.verse {
    padding: 6px 0;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.verse.selected {
    background-color: #fff3b0;
    border-radius: 6px;
}

.verse.dim {
    opacity: 0.45;
}

.verse.focused {
    background-color: #fff3b0; /* soft yellow highlight */
    border-radius: 6px;
}

/* Mobile */

@media (prefers-color-scheme: dark) {
    :root {
        --background: #111827;
        --surface: #1f2937;
        --text: #f9fafb;
        --muted: #9ca3af;
        --accent: #3b82f6;
        --border: #374151;
    }
}

@media (max-width: 768px) {

    .topbar {
        flex-direction: column;
        gap: 1rem;
    }

    #chapter {
        padding: 1.5rem;
    }

    .verse {
        font-size: 1.1rem;
    }

    .chapter-header h1 {
        font-size: 2rem;
    }
}