/*
 * Holyfy shared UI components
 * Principles: hierarchy through typography and spacing, not borders.
 * Only clickable items are "cards" (tiles); section titles are plain text.
 */

[hidden] {
    display: none !important;
}

/* Safety net: horizontal overflow anywhere would widen the layout viewport on phones and hide the fixed tab bar */
html,
body {
    overflow-x: clip;
}

/* ---------------------------------------------------------------- mobile tab bar (app-style footer) */
:root {
    --tab-bar-h: 0px;
}

.tab-bar {
    display: none;
}

@media (max-width: 767px) {
    body.has-tab-bar {
        --tab-bar-h: calc(3.75rem + env(safe-area-inset-bottom));
        padding-bottom: var(--tab-bar-h);
    }

    .tab-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 45;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        height: var(--tab-bar-h);
        padding-bottom: env(safe-area-inset-bottom);
        background-color: var(--glass-bg, var(--bg-secondary));
        -webkit-backdrop-filter: var(--glass-blur, none);
        backdrop-filter: var(--glass-blur, none);
        border-top: 1px solid var(--border);
    }

    .tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        color: var(--text-tertiary);
        font-size: 0.6875rem;
        font-weight: 600;
        -webkit-tap-highlight-color: transparent;
    }

    .tab i {
        font-size: 1.25rem;
        transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .tab:active i { transform: scale(0.85); }

    .tab.active {
        color: var(--text-primary);
    }

    .tab.active i {
        color: var(--accent);
    }
}

/* ---------------------------------------------------------------- page bar (back + title + section chips) */
.page-bar {
    position: sticky;
    top: 4rem;
    z-index: 30;
    background-color: var(--glass-bg, var(--bg-primary));
    -webkit-backdrop-filter: var(--glass-blur, none);
    backdrop-filter: var(--glass-blur, none);
    border-bottom: 1px solid var(--border);
}

.page-bar-inner {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0.75rem 1rem 0.875rem;
}

@media (min-width: 640px) {
    .page-bar-inner { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
    .page-bar-inner { padding: 1rem 3rem; }
}

@media (min-width: 1536px) {
    .page-bar-inner { padding-left: 4rem; padding-right: 4rem; }
}

.page-bar-title {
    margin: 0;
    font-size: 1.375rem;
    line-height: 1.3;
}

.page-bar-title a {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
    color: var(--text-primary);
}

.page-bar-title i {
    flex-shrink: 0;
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.page-bar-title a:hover i { transform: translateX(-3px); }

.page-bar-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .page-bar-title { font-size: 1.75rem; }
}

.page-bar-chips {
    margin-top: 0.75rem;
}

.page-bar-chips:empty {
    display: none;
}

.page-bar-chips .chip {
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
}

/* Mobile: the page bar replaces the app header */
@media (max-width: 767px) {
    body.has-page-bar > nav {
        display: none;
    }

    .page-bar {
        top: 0;
        padding-top: env(safe-area-inset-top);
    }
}

/* ---------------------------------------------------------------- page layout */
/* Pages use the full browser width on desktop (capped only on very large screens) */
.page,
.nav-inner {
    max-width: 1920px;
    margin: 0 auto;
}

.page {
    padding: 2rem 1rem 4rem;
    /* Never let bleeding rows/strips widen the page: a wider layout viewport pushes fixed bars off-screen on phones.
       "clip" (unlike "hidden") keeps position: sticky working. */
    overflow-x: clip;
}

.nav-inner {
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .page { padding: 2.5rem 1.5rem 5rem; }
    .nav-inner { padding: 0 1.5rem; }
}

@media (min-width: 1024px) {
    .page { padding: 3rem 3rem 5rem; }
    .nav-inner { padding: 0 3rem; }
}

@media (min-width: 1536px) {
    .page { padding-left: 4rem; padding-right: 4rem; }
    .nav-inner { padding: 0 4rem; }
}

.page-header {
    margin-bottom: 1.75rem;
}

.page-header h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 0.375rem;
}

.page-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

@media (min-width: 768px) {
    .page-header h1 { font-size: 2.5rem; }
}

.eyebrow {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.muted {
    color: var(--text-secondary);
}

/* ---------------------------------------------------------------- section headings */
.page-section {
    margin-top: 3rem;
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading h2 {
    font-size: 1.375rem;
    margin: 0;
}

.section-heading p {
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.section-link {
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.section-link:hover { text-decoration: underline; }

.group-label {
    margin: 3rem 0 0.25rem;
}

.group-label + .browse-row {
    margin-top: 1rem;
}

/* ---------------------------------------------------------------- buttons */
.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 999px;
    background-color: var(--accent);
    color: #1C1C1C;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 8px 24px var(--accent-glow);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease;
}

.btn-cta:hover { background-color: var(--accent-hover); }
.btn-cta:active { transform: scale(0.96); }

.btn-quiet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;
}

.btn-quiet:hover { background-color: var(--border-light); }

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0;
}

.link-btn:hover { color: var(--accent); }

/* ---------------------------------------------------------------- browse toolbar (search + filters) */
.browse-toolbar {
    position: sticky;
    top: 4rem;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
}

.browse-toolbar::before {
    /* Frosted strip behind the sticky toolbar so rows scrolling under it stay readable */
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    z-index: -1;
    background-color: var(--glass-bg, var(--bg-primary));
    -webkit-backdrop-filter: var(--glass-blur, none);
    backdrop-filter: var(--glass-blur, none);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.browse-toolbar.stuck::before { opacity: 1; }

.search-field {
    position: relative;
    flex: 1 1 260px;
    max-width: 420px;
}

.search-field i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-field input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border-radius: 999px !important;
    border: 1px solid var(--border);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.search-field input::placeholder { color: var(--text-tertiary); }

.chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.chip:hover { color: var(--text-primary); }

.chip.active {
    background-color: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
}

/* ---------------------------------------------------------------- rows (Netflix-style) */
.browse-row {
    margin-top: 2.25rem;
}

.row-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.875rem;
}

.row-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.row-header p {
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.row-nav {
    display: none;
    gap: 0.375rem;
    flex-shrink: 0;
}

@media (hover: hover) and (min-width: 768px) {
    .row-nav { display: flex; }
}

.row-nav button {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.row-nav button:disabled {
    opacity: 0.3;
    cursor: default;
}

.row-track {
    display: flex;
    gap: 0.875rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding-left: 1rem;
    scrollbar-width: none;
    /* Let tiles bleed to the screen edges on mobile */
    margin: 0 -1rem;
    padding: 0.25rem 1rem 1rem;
}

.row-track::-webkit-scrollbar { display: none; }

.row-track > * {
    scroll-snap-align: start;
    flex: 0 0 auto;
}

@media (min-width: 640px) {
    .row-track { margin: 0 -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; scroll-padding-left: 1.5rem; }
}

/* Desktop: rows run edge to edge of the window, aligned with the page content */
@media (min-width: 1024px) {
    .row-track { gap: 1.25rem; margin: 0 -3rem; padding-left: 3rem; padding-right: 3rem; scroll-padding-left: 3rem; }
}

@media (min-width: 1536px) {
    .row-track { margin: 0 -4rem; padding-left: 4rem; padding-right: 4rem; scroll-padding-left: 4rem; }
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.875rem;
    margin-top: 1rem;
}

.results-grid.wide {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

@media (min-width: 1024px) {
    .results-grid { grid-template-columns: repeat(auto-fill, minmax(222px, 1fr)); gap: 1.25rem; }
    .results-grid.wide { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
}

.results-grid > * {
    width: auto !important;
}

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

/* ---------------------------------------------------------------- tiles */
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tile:active { transform: scale(0.97); }

.tile-check {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    z-index: 2;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--success);
    color: white;
    font-size: 0.75rem;
}

/* Poster: books and characters (2:3, tinted by their group color) */
.poster {
    --tint: var(--accent);
    width: 148px;
    aspect-ratio: 2 / 3;
    justify-content: flex-end;
    padding: 1rem;
    background-image: linear-gradient(170deg,
        color-mix(in srgb, var(--tint) 42%, transparent) 0%,
        color-mix(in srgb, var(--tint) 10%, transparent) 55%,
        transparent 100%);
}

@media (min-width: 768px) {
    .poster { width: 164px; }
}

/* Desktop: 1.5x posters */
@media (min-width: 1024px) {
    .poster { width: 246px; padding: 1.375rem; border-radius: 22px; }
    .poster-mark { font-size: 5.25rem; top: 0.75rem; left: 1.25rem; }
    .poster-title { font-size: 1.5rem; }
    .poster-meta { font-size: 0.9375rem; }
    .tile-check { width: 1.875rem; height: 1.875rem; font-size: 0.875rem; top: 0.875rem; right: 0.875rem; }
}

/* Short text preview under the title (character summaries) */
.poster-summary {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .poster-summary { font-size: 0.9375rem; -webkit-line-clamp: 4; }
}

.poster-mark {
    position: absolute;
    top: 0.5rem;
    left: 0.875rem;
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 900;
    font-size: 3.5rem;
    line-height: 1;
    color: var(--text-primary);
    opacity: 0.14;
    pointer-events: none;
}

.poster-title {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    font-size: 1.0625rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.poster-meta {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Wide tile: sermon outlines */
.wide-tile {
    width: 280px;
    min-height: 168px;
    padding: 1.125rem 1.25rem;
    gap: 0.375rem;
}

@media (min-width: 768px) {
    .wide-tile { width: 300px; }
}

/* Desktop: 1.5x sermon cards */
@media (min-width: 1024px) {
    .wide-tile { width: 450px; min-height: 252px; padding: 1.75rem 1.875rem; gap: 0.625rem; border-radius: 22px; }
    .wide-tile-ref { font-size: 0.9375rem; }
    .wide-tile-title { font-size: 1.5rem; -webkit-line-clamp: 3; }
    .wide-tile-text { font-size: 1rem; -webkit-line-clamp: 3; }
}

.wide-tile-ref {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
}

.wide-tile-title {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    font-size: 1.0625rem;
    line-height: 1.35;
    padding-right: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wide-tile-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------------------------------------------------------------- stats & bars */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1rem;
}

@media (min-width: 768px) {
    .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat-value {
    display: block;
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    font-size: 1.75rem;
    line-height: 1.1;
    color: var(--text-primary);
}

.stat-label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.bar-row + .bar-row {
    margin-top: 1rem;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.bar-label span:last-child {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
}

.bar {
    height: 6px;
    border-radius: 999px;
    background-color: var(--bg-tertiary);
    overflow: hidden;
}

.bar > span {
    display: block;
    height: 100%;
    min-width: 6px;
    border-radius: 999px;
    background-color: var(--accent);
    transition: width 0.6s ease;
}

/* ---------------------------------------------------------------- week strip (daily plan) */
.week {
    display: flex;
    gap: 0.375rem;
}

.day {
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    border: 1px solid var(--border);
}

.day-complete { background-color: var(--success); border-color: var(--success); color: white; }
.day-partial { background-color: color-mix(in srgb, var(--warning) 30%, transparent); border-color: var(--warning); color: var(--text-primary); }
.day-failed { background-color: color-mix(in srgb, var(--error) 22%, transparent); border-color: color-mix(in srgb, var(--error) 60%, transparent); color: var(--text-primary); }
.day.is-today { box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent); }

@media (prefers-reduced-motion: reduce) {
    .tile, .btn-cta { transition: none; }
    .tile:hover { transform: none; }
}


/* ---------- Loading: spinner, page loader, persistent chrome ---------- */
.spinner {
    display: inline-block;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 3px solid var(--border-color, rgba(128,128,128,.25));
    border-top-color: var(--accent, #D4AF37);
    animation: holyfy-spin .8s linear infinite;
}
@keyframes holyfy-spin { to { transform: rotate(360deg); } }

.content-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
}

/* Covers only the content area: header on top and tab bar at the bottom stay visible */
.page-loader {
    position: fixed;
    inset: 4rem 0 0 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease, visibility 0s linear .15s;
}
.page-loader.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity .15s ease;
}
@media (max-width: 767px) {
    body.has-tab-bar .page-loader { bottom: var(--tab-bar-h); }
    body.has-page-bar .page-loader { top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 1.6s; }
}

/* Cross-page navigation keeps the header and the tab bar in place (Chrome/Edge/Safari 18+) */
@view-transition { navigation: auto; }
body > nav { view-transition-name: holyfy-header; }
.tab-bar { view-transition-name: holyfy-tab-bar; }
::view-transition-group(holyfy-header),
::view-transition-group(holyfy-tab-bar) { animation: none; }
::view-transition-old(root) { animation: 120ms ease-out both holyfy-fade-out; }
::view-transition-new(root) { animation: 160ms ease-in both holyfy-fade-in; }
@keyframes holyfy-fade-out { to { opacity: 0; } }
@keyframes holyfy-fade-in { from { opacity: 0; } }

/* ---------------------------------------------------------------- profiles, friends and timelines */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--accent);
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
}

.avatar.avatar-lg {
    width: 4.5rem;
    height: 4.5rem;
    font-size: 1.75rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.profile-header h1 {
    font-size: 2rem;
    margin: 0;
}

.profile-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-left: auto;
}

.profile-actions form { margin: 0; }

.profile-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    margin-top: 2rem;
}

.profile-tabs a {
    padding: 0.625rem 1rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-weight: 500;
}

.profile-tabs a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.badge-count {
    display: inline-block;
    min-width: 1.25rem;
    padding: 0 0.375rem;
    margin-left: 0.25rem;
    border-radius: 999px;
    background-color: var(--accent);
    color: #1C1C1C;
    font-size: 0.75rem;
    text-align: center;
}

.private-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.person-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.person-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.person-row:last-child { border-bottom: none; }

.person-row .person-name {
    flex: 1;
    min-width: 0;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-row .person-name:hover { color: var(--accent); }

.person-row form { margin: 0; }

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.timeline-item {
    display: flex;
    gap: 0.875rem;
    padding-bottom: 1.25rem;
    position: relative;
}

/* Thin vertical line connecting the icons */
.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 2.25rem;
    bottom: 0.25rem;
    width: 1px;
    background-color: var(--border);
}

.timeline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    color: var(--accent);
    font-size: 0.8rem;
}

.timeline-body { min-width: 0; padding-top: 0.25rem; }

.timeline-body p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.5;
}

.timeline-body time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.timeline-user {
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-user:hover { color: var(--accent); }

.timeline-empty { color: var(--text-secondary); }

.privacy-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border);
}

.privacy-field select {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Verse box in timelines: tinted with the highlight color the user picked */
.verse-quote {
    --quote-color: var(--accent);
    margin: 0.625rem 0 0.375rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border-left: 3px solid var(--quote-color);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--quote-color) 16%, transparent),
        color-mix(in srgb, var(--quote-color) 5%, transparent));
    max-width: 40rem;
}

.verse-quote-yellow { --quote-color: rgb(251, 191, 36); }
.verse-quote-green { --quote-color: rgb(34, 197, 94); }
.verse-quote-blue { --quote-color: rgb(59, 130, 246); }
.verse-quote-pink { --quote-color: rgb(236, 72, 153); }

.verse-quote blockquote {
    margin: 0;
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.verse-quote-line + .verse-quote-line::before { content: ' '; }

.verse-quote sup {
    color: var(--quote-color);
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.65rem;
    margin-right: 0.2rem;
}

.verse-quote figcaption {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--quote-color);
}

.timeline-note {
    margin: 0.25rem 0 0.375rem !important;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background-color: var(--bg-tertiary);
    white-space: pre-line;
    max-width: 40rem;
}

/* Profile: activity and friends in a centered reading column */
.profile-column {
    max-width: 42rem;
    margin: 0 auto;
}

/* Bible references in timelines open the reader at that chapter/verse */
.timeline-link {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.timeline-link:hover { border-bottom-color: currentColor; }

.verse-quote figcaption a { color: inherit; text-decoration: none; }
.verse-quote figcaption a:hover { text-decoration: underline; }
.verse-quote figcaption i { font-size: 0.7rem; margin-left: 0.2rem; }

/* Profile progress: compact strip (ring + three small stats) */
.profile-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.profile-progress-ring {
    --p: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--bg-tertiary) 0);
    position: relative;
}

/* Inner disc turns the conic gradient into a ring; the number sits on top */
.profile-progress-ring::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background-color: var(--bg-primary);
}

.profile-progress-ring span {
    position: relative;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-progress-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: auto;
}

.profile-progress-stats {
    display: flex;
    gap: 1.25rem;
    margin: 0;
}

.profile-progress-stats div { text-align: center; }

.profile-progress-stats dt {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.profile-progress-stats dd {
    margin: 0;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.profile-progress-private { margin-top: 1.25rem; }

/* Featured verse at the top of a profile */
.profile-verse {
    position: relative;
    margin: 1.5rem 0 0;
    padding: 1.5rem 1.75rem 1.25rem 3.5rem;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--accent) 16%, transparent),
        color-mix(in srgb, var(--accent) 4%, transparent));
}

.profile-verse-mark {
    position: absolute;
    left: 1.25rem;
    top: 1.4rem;
    font-size: 1.25rem;
    color: var(--accent);
    opacity: 0.8;
}

.profile-verse blockquote {
    margin: 0;
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.2rem;
    line-height: 1.65;
    color: var(--text-primary);
}

.profile-verse figcaption {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.profile-verse figcaption a { color: inherit; text-decoration: none; }
.profile-verse figcaption a:hover { text-decoration: underline; }
.profile-verse figcaption span { color: var(--text-secondary); font-weight: 500; }

@media (max-width: 640px) {
    .profile-verse { padding: 1.25rem 1.25rem 1rem 2.75rem; }
    .profile-verse-mark { left: 1rem; font-size: 1rem; }
    .profile-verse blockquote { font-size: 1.05rem; }
}

.featured-verse-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 0.75rem;
    align-items: end;
}

.featured-verse-form label span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.featured-verse-form select,
.featured-verse-form input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.featured-verse-form .fv-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

@media (max-width: 640px) {
    .featured-verse-form { grid-template-columns: 1fr 1fr; }
    .featured-verse-form .fv-book,
    .featured-verse-form .fv-translation { grid-column: 1 / -1; }
}

/* Own profile without a featured verse: dashed invitation in the same spot */
.profile-verse-invite {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1.1rem 1.5rem;
    border-radius: 18px;
    border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
    background-color: color-mix(in srgb, var(--accent) 5%, transparent);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.profile-verse-invite:hover {
    background-color: color-mix(in srgb, var(--accent) 12%, transparent);
    border-color: var(--accent);
}

.profile-verse-invite > i:first-child {
    font-size: 1.25rem;
    color: var(--accent);
}

.profile-verse-invite strong {
    display: block;
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.profile-verse-invite-plus {
    margin-left: auto;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent);
    color: #1C1C1C;
}

/* Dashboard: pending friend requests, highlighted like the profile's featured verse */
.friend-requests-card {
    margin: 1rem 0 2rem;
    padding: 1.5rem 1.75rem 0.75rem;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--accent) 18%, transparent),
        color-mix(in srgb, var(--accent) 4%, transparent));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 6%, transparent);
}

.friend-requests-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.friend-requests-head > div { flex: 1; min-width: 0; }

.friend-requests-mark {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent);
    color: #1C1C1C;
    font-size: 1.05rem;
}

.friend-requests-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.friend-requests-head p {
    margin: 0.15rem 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.friend-requests-card .person-row {
    border-bottom-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

.friend-requests-card .person-row form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.friend-accept { padding: 0.5rem 1.1rem; font-size: 0.875rem; }

@media (max-width: 640px) {
    .friend-requests-card { padding: 1.25rem 1.1rem 0.5rem; }
    .friend-requests-head .section-link { display: none; }
    .friend-requests-card .person-row form { gap: 0.25rem; }
    .friend-decline-text { display: none; }
}

@media (min-width: 641px) {
    .friend-decline-icon { display: none; }
}
