/* ============================================================
   Church Bible — Frontend Styles
   ============================================================ */
:root {
    --cb-blue:      #1a5fcd;
    --cb-blue-dark: #1348a8;
    --cb-green:     #166534;
    --cb-green-bg:  #dcfce7;
    --cb-gold:      #92400e;
    --cb-gold-bg:   #fef3c7;
    --cb-gray-50:   #f9fafb;
    --cb-gray-100:  #f3f4f6;
    --cb-gray-200:  #e5e7eb;
    --cb-gray-400:  #9ca3af;
    --cb-gray-600:  #6b7280;
    --cb-gray-800:  #1f2937;
    --cb-radius:    10px;
    --cb-shadow:    0 2px 8px rgba(0,0,0,.06);
}

/* ── Shared utilities ── */
.cb-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer;
    font-size: .875rem; font-weight: 600; font-family: inherit;
    background: var(--cb-blue); color: #fff; transition: background .15s;
}
.cb-btn:hover { background: var(--cb-blue-dark); }
.cb-btn--sm   { padding: 5px 12px; font-size: .8rem; }
.cb-btn--ghost { background: transparent; border: 1px solid var(--cb-gray-200); color: var(--cb-gray-800); }
.cb-btn--ghost:hover { background: var(--cb-gray-100); }
.cb-btn--done  { background: var(--cb-green-bg); color: var(--cb-green); }
.cb-btn--done:hover { background: #bbf7d0; }
.cb-error { color: #dc2626; font-size: .9rem; padding: 10px 14px; background: #fef2f2; border-radius: 6px; }
.cb-note-saved { color: var(--cb-green); font-size: .8rem; font-weight: 600; margin-left: 8px; }

/* ============================================================
   Verse of the Day
   ============================================================ */
.cb-votd {
    background: #fff; border: 1px solid var(--cb-gray-200);
    border-radius: var(--cb-radius); box-shadow: var(--cb-shadow);
    padding: 28px 26px; width: 100%;
}
.cb-votd__header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px;
}
.cb-votd__label {
    font-size: .7rem; font-weight: 700; letter-spacing: 2.5px;
    text-transform: uppercase; color: var(--cb-blue);
}
.cb-votd__date { font-size: .8rem; color: var(--cb-gray-400); }

.cb-votd__verse {
    margin: 0 0 20px; padding: 0 0 0 18px;
    border-left: 3px solid var(--cb-blue);
}
.cb-votd__verse p { font-size: 1.1rem; line-height: 1.7; color: var(--cb-gray-800); font-style: italic; margin: 0 0 10px; }
.cb-votd__verse cite { font-style: normal; font-weight: 700; font-size: .9rem; }
.cb-votd__translation { font-weight: 400; color: var(--cb-gray-600); font-size: .8rem; }

/* Reflection expander */
.cb-votd__reflect-btn {
    background: none; border: none; cursor: pointer; font-weight: 700;
    font-size: .875rem; color: var(--cb-blue); padding: 0; display: flex;
    align-items: center; gap: 6px;
}
.cb-votd__reflect-btn[aria-expanded="true"] .cb-votd__chevron { transform: rotate(180deg); }
.cb-votd__chevron { display: inline-block; transition: transform .2s; }
.cb-votd__reflect-body { padding: 14px 0 0; font-size: .95rem; color: var(--cb-gray-600); }
.cb-votd__note-area { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cb-votd__note-input { width: 100%; padding: 8px 12px; border: 1px solid var(--cb-gray-200); border-radius: 6px; font-family: inherit; resize: vertical; }

.cb-votd__share { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ============================================================
   Bible Reader
   ============================================================ */
.cb-reader { border: 1px solid var(--cb-gray-200); border-radius: var(--cb-radius); overflow: hidden; }

.cb-reader__toolbar {
    background: var(--cb-gray-50); border-bottom: 1px solid var(--cb-gray-200);
    padding: 14px 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.cb-reader__ref-input {
    flex: 1; min-width: 180px; padding: 8px 12px; border: 1px solid var(--cb-gray-200);
    border-radius: 6px; font-size: .95rem;
}
.cb-reader__translation {
    padding: 8px 10px; border: 1px solid var(--cb-gray-200); border-radius: 6px;
    font-size: .875rem; background: #fff;
}
.cb-reader__search-wrap { display: flex; gap: 8px; flex-wrap: nowrap; margin-left: auto; }
.cb-reader__search-input {
    width: 180px; padding: 8px 12px; border: 1px solid var(--cb-gray-200);
    border-radius: 6px; font-size: .875rem;
}

.cb-reader__body { display: grid; grid-template-columns: 1fr 280px; min-height: 420px; }
@media(max-width:680px){ .cb-reader__body { grid-template-columns: 1fr; } }

.cb-reader__passage-col { padding: 24px 20px; }
.cb-reader__passage-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.cb-reader__passage-ref { font-size: 1.2rem; font-weight: 800; margin: 0; }
.cb-reader__passage-trans { font-size: .8rem; color: var(--cb-gray-600); background: var(--cb-gray-100); padding: 2px 8px; border-radius: 4px; }
.cb-reader__loading { color: var(--cb-gray-400); font-style: italic; }

/* Individual verses */
.cb-verse { display: flex; gap: 10px; padding: 4px 6px; border-radius: 4px; cursor: pointer; }
.cb-verse:hover { background: var(--cb-gray-50); }
.cb-verse.cb-verse--selected { background: #eff6ff; }
.cb-verse__num { font-size: .7rem; font-weight: 700; color: var(--cb-gray-400); min-width: 22px; padding-top: 3px; }
.cb-verse__text { font-size: 1rem; line-height: 1.75; color: var(--cb-gray-800); }

/* Highlight colours */
.cb-hl--yellow { background: #fef08a; }
.cb-hl--green  { background: #bbf7d0; }
.cb-hl--blue   { background: #bfdbfe; }
.cb-hl--pink   { background: #fbcfe8; }

/* Highlight picker */
.cb-highlight-picker {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    background: var(--cb-gray-50); border-top: 1px solid var(--cb-gray-200);
    border-radius: 0 0 6px 6px; flex-wrap: wrap;
}
.cb-highlight-swatch {
    width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(0,0,0,.1);
    cursor: pointer; transition: transform .1s;
}
.cb-highlight-swatch:hover { transform: scale(1.2); }

/* Notes column */
.cb-reader__notes-col {
    border-left: 1px solid var(--cb-gray-200); padding: 20px 16px;
    background: var(--cb-gray-50);
}
.cb-reader__notes-col--login { display: flex; align-items: center; padding: 24px; }
.cb-reader__notes-title { font-size: .875rem; font-weight: 700; margin: 0 0 14px; }
.cb-reader__note-input { width: 100%; border: 1px solid var(--cb-gray-200); border-radius: 6px; padding: 8px 10px; font-family: inherit; font-size: .875rem; resize: vertical; }
.cb-note-item { background: #fff; border: 1px solid var(--cb-gray-200); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; font-size: .875rem; position: relative; }
.cb-note-item__delete { position: absolute; top: 8px; right: 8px; background: none; border: none; cursor: pointer; color: var(--cb-gray-400); font-size: 14px; }

/* Search results */
.cb-reader__search-results { border-top: 1px solid var(--cb-gray-200); padding: 20px; }
.cb-search-result { padding: 12px 0; border-bottom: 1px solid var(--cb-gray-100); cursor: pointer; }
.cb-search-result:hover .cb-search-result__ref { color: var(--cb-blue); text-decoration: underline; }
.cb-search-result__ref { font-weight: 700; font-size: .875rem; margin-bottom: 4px; }
.cb-search-result__text { font-size: .875rem; color: var(--cb-gray-600); }

/* ============================================================
   Reading Plan
   ============================================================ */
.cb-plan { border: 1px solid var(--cb-gray-200); border-radius: var(--cb-radius); overflow: hidden; }

.cb-plan__header {
    background: linear-gradient(135deg, #0f2557 0%, #1a5fcd 100%);
    color: #fff; padding: 28px 26px;
}
.cb-plan__title { font-size: 1.4rem; font-weight: 800; margin: 0 0 8px; }
.cb-plan__desc  { color: rgba(255,255,255,.82); margin: 0 0 14px; font-size: .95rem; }
.cb-plan__stats { font-size: .85rem; color: rgba(255,255,255,.7); margin: 0; }

.cb-plan__progress-wrap { margin-top: 18px; }
.cb-plan__progress-bar {
    height: 8px; background: rgba(255,255,255,.25); border-radius: 4px; overflow: hidden; margin-bottom: 6px;
}
.cb-plan__progress-fill { height: 100%; background: #4ade80; border-radius: 4px; transition: width .5s ease; }
.cb-plan__progress-label { font-size: .8rem; color: rgba(255,255,255,.75); }

/* Day rows */
.cb-plan__days { padding: 12px 0; }
.cb-plan__day { border-bottom: 1px solid var(--cb-gray-100); }
.cb-plan__day:last-child { border-bottom: none; }
.cb-plan__day--done .cb-plan__day-header { opacity: .75; }

.cb-plan__day-header {
    width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 20px;
    background: none; border: none; cursor: pointer; text-align: left; font-family: inherit;
    font-size: 1rem; transition: background .1s;
}
.cb-plan__day-header:hover { background: var(--cb-gray-50); }
.cb-plan__day-header[aria-expanded="true"] .cb-plan__day-chevron { transform: rotate(180deg); }

.cb-plan__day-check {
    width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--cb-gray-200);
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; color: var(--cb-gray-600); flex-shrink: 0;
}
.cb-plan__day-check--done { background: var(--cb-green-bg); border-color: #86efac; color: var(--cb-green); }
.cb-plan__day-ref { flex: 1; font-weight: 600; }
.cb-plan__day-chevron { color: var(--cb-gray-400); font-size: .75rem; transition: transform .2s; }

.cb-plan__day-body { padding: 0 20px 18px 62px; }
.cb-plan__day-actions { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.cb-plan__day-reflection { background: var(--cb-gray-50); border-left: 3px solid var(--cb-blue); border-radius: 0 6px 6px 0; padding: 14px 16px; margin-bottom: 16px; }
.cb-plan__day-reflection p { margin: 6px 0 12px; font-size: .9rem; color: var(--cb-gray-600); }
.cb-plan__reflection-input { width: 100%; border: 1px solid var(--cb-gray-200); border-radius: 6px; padding: 8px 10px; font-family: inherit; font-size: .875rem; resize: vertical; }

/* Discussion thread */
.cb-plan__discussion { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--cb-gray-200); }
.cb-plan__discussion-title { font-size: .875rem; font-weight: 700; margin: 0 0 12px; }
.cb-plan__thread-list { margin-bottom: 12px; }
.cb-thread-msg { display: flex; gap: 10px; margin-bottom: 10px; }
.cb-thread-msg__avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--cb-gray-200); display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.cb-thread-msg__bubble { background: var(--cb-gray-50); border: 1px solid var(--cb-gray-200); border-radius: 0 8px 8px 8px; padding: 8px 12px; font-size: .875rem; }
.cb-thread-msg__meta { font-size: .75rem; color: var(--cb-gray-400); margin-bottom: 3px; }
.cb-thread-reply { margin-left: 40px; }
.cb-plan__thread-compose { display: flex; gap: 8px; align-items: flex-end; }
.cb-plan__thread-input { flex: 1; border: 1px solid var(--cb-gray-200); border-radius: 6px; padding: 8px 10px; font-family: inherit; font-size: .875rem; resize: none; }

/* Inline reader modal */
.cb-plan__reader-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.cb-plan__reader-modal-inner {
    background: #fff; border-radius: var(--cb-radius); width: 100%; max-width: 620px;
    max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.cb-plan__modal-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--cb-gray-200); position: sticky; top: 0; background: #fff;
}
.cb-plan__modal-ref { font-weight: 700; }
.cb-plan__modal-close { background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--cb-gray-600); }
.cb-plan__modal-text { padding: 20px; line-height: 1.8; }
