/**
 * Homepage Styles — Ubi Missa
 * Dark navy + gold palette, fluid clamp() typography, modern Catholic feel
 */

/* ── Base ── */

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

html {
    background: var(--color-bg-primary, #0f1d30);
    min-height: 100vh;
}

body {
    font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    background: linear-gradient(180deg,
        var(--color-bg-gradient-start, #0c1929) 0%,
        var(--color-bg-gradient-mid, #1a2744) 50%,
        var(--color-bg-gradient-end, #0f1d30) 100%);
    background-attachment: fixed;
    color: var(--color-text-primary, #e8e8e8);
    min-height: 100vh;
}

/* ── Hero ── */

.hero {
    padding: clamp(90px, 12vw, 130px) 24px clamp(32px, 4vw, 48px);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-icon {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    filter: drop-shadow(0 4px 24px rgba(255, 215, 0, 0.4));
}

.hero-icon svg {
    width: clamp(48px, 8vw, 72px);
    height: clamp(48px, 8vw, 72px);
}

.hero h1 {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.hero h1 span {
    color: #FFD700;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(16px, 2.2vw, 20px);
    color: var(--color-text-secondary, #94a3b8);
    margin-bottom: 36px;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ── CTA Buttons ── */

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn {
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: clamp(15px, 1.8vw, 17px);
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a2e;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.secondary-ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
}

.btn-text {
    color: var(--color-text-secondary, #94a3b8);
    font-weight: 500;
    font-size: 15px;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(148, 163, 184, 0.4);
    transition: all 0.2s ease;
}

.btn-text:hover {
    color: #FFD700;
    text-decoration-color: rgba(255, 215, 0, 0.6);
}

/* ── Next Mass Near You ── */

.next-mass-section {
    padding: 0 24px clamp(32px, 4vw, 48px);
    max-width: 700px;
    margin: 0 auto;
}

.next-mass-switcher {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: clamp(16px, 2vw, 24px);
}

.next-mass-tab {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--color-text-secondary, #94a3b8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.next-mass-tab:hover { border-color: rgba(255, 215, 0, 0.3); color: #ffffff; }

.next-mass-tab.active {
    background: rgba(255, 215, 0, 0.12);
    border-color: rgba(255, 215, 0, 0.4);
    color: #FFD700;
    font-weight: 600;
}

.next-mass-see-more {
    text-align: center;
    margin-top: 12px;
}

.next-mass-see-more a {
    color: var(--color-text-secondary, #94a3b8);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.next-mass-see-more a:hover { color: #FFD700; }

.next-mass-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.next-mass-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    transition: border-color 0.2s, background 0.2s;
}

.next-mass-card:hover {
    border-color: rgba(255, 215, 0, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.next-mass-info { flex: 1; min-width: 0; }

.next-mass-name {
    font-weight: 600;
    font-size: 15px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-mass-detail {
    font-size: 13px;
    color: var(--color-text-secondary, #94a3b8);
    margin-top: 2px;
}

.next-mass-time { color: #FFD700; font-weight: 600; }

.next-mass-directions {
    color: var(--color-text-secondary, #94a3b8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.next-mass-directions:hover {
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.3);
}

.next-mass-fallback {
    text-align: center;
    padding: 20px;
    color: var(--color-text-secondary, #94a3b8);
    font-size: 14px;
}

.next-mass-fallback a { color: #FFD700; text-decoration: underline; text-underline-offset: 2px; }

/* Skeleton loading */
.next-mass-skeleton {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px 20px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.06) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-name { width: 60%; margin-bottom: 8px; }
.skeleton-detail { width: 45%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Liturgy Feature Cards ── */

.liturgy-features {
    padding: clamp(48px, 6vw, 80px) 24px clamp(32px, 4vw, 60px);
    max-width: 1100px;
    margin: 0 auto;
}

.liturgy-features h2 {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: clamp(24px, 3.5vw, 32px);
    text-align: center;
    margin-bottom: clamp(32px, 4vw, 48px);
    color: #ffffff;
}

.liturgy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.liturgy-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.liturgy-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--card-accent-color) 0%, transparent 100%);
    opacity: 0.8;
}

.liturgy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.liturgy-card-mass { --card-accent-color: #22C55E; }
.liturgy-card-confession { --card-accent-color: #A855F7; }
.liturgy-card-adoration { --card-accent-color: #F59E0B; }

.liturgy-icon { color: var(--card-accent-color); margin-bottom: 16px; }
.liturgy-icon svg { width: 36px; height: 36px; }
.liturgy-emoji { font-size: 32px; }

.liturgy-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.liturgy-card .liturgy-desc {
    color: var(--color-text-secondary, #94a3b8);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.liturgy-cta {
    color: var(--card-accent-color);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}

.liturgy-cta .arrow { transition: transform 0.2s ease; }
.liturgy-card:hover .liturgy-cta .arrow { transform: translateX(4px); }

/* ── Browse Section ── */

.browse-section {
    padding: clamp(40px, 5vw, 60px) 24px;
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
}

.browse-map-view { max-width: 600px; margin: 0 auto; }

.browse-section h2 {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: clamp(22px, 3vw, 28px);
    color: #ffffff;
    margin-bottom: 12px;
}

.browse-subtitle {
    color: var(--color-text-secondary, #94a3b8);
    font-size: 15px;
    margin-bottom: 24px;
}

.browse-map {
    margin: 20px auto 24px;
    text-align: left;
    max-width: 720px;
    width: 100%;
}

.browse-map-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 12px;
}

.browse-map-label { color: #e2e8f0; font-size: 14px; font-weight: 600; }

.browse-map-cta {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.browse-map-cta:hover { border-color: rgba(255, 215, 0, 0.5); color: #FFD700; }

.home-mini-map {
    height: clamp(220px, 30vw, 320px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    background: rgba(15, 23, 42, 0.6);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.home-mini-map .mini-marker-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: #f0c674; border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.home-mini-map .leaflet-control-zoom a {
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.home-mini-map .leaflet-control-zoom a:hover { background: rgba(255, 255, 255, 0.1); }

.home-mini-map .leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
}

.home-mini-map .leaflet-popup-tip { background: rgba(15, 23, 42, 0.95); }

/* ── Diocese Directory (Global) ── */

.diocese-search-container { max-width: 500px; margin: 0 auto 24px; }

.diocese-search-input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}

.diocese-search-input::placeholder { color: var(--color-text-tertiary, #64748b); }
.diocese-search-input:focus { border-color: rgba(255, 215, 0, 0.5); background: rgba(255, 255, 255, 0.08); }

.filter-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.filter-tab {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-secondary, #94a3b8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.filter-tab:hover { border-color: rgba(255, 215, 0, 0.3); color: #ffffff; }

.filter-tab.active {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-color: transparent;
    color: #1a1a2e;
    font-weight: 600;
}

.diocese-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: left;
}

.diocese-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.diocese-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 215, 0, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.diocese-card-name {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: 17px;
    font-weight: 600;
    color: #FFD700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.diocese-card-meta {
    font-size: 13px;
    color: var(--color-text-secondary, #94a3b8);
    margin-bottom: 8px;
}

.diocese-card-count { font-size: 14px; color: var(--color-text-tertiary, #64748b); }
.diocese-card-count strong { color: #ffffff; font-weight: 600; }

.diocese-loading, .diocese-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 24px;
    color: var(--color-text-secondary, #94a3b8);
    font-size: 15px;
}

/* ── Signup Section ── */

.signup-section {
    padding: clamp(40px, 5vw, 60px) 24px clamp(60px, 7vw, 80px);
    max-width: 700px;
    margin: 0 auto;
}

.signup-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: clamp(28px, 4vw, 48px);
    text-align: center;
}

.signup-box h2 {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: clamp(22px, 3vw, 28px);
    color: #ffffff;
    margin-bottom: 10px;
}

.signup-box p {
    color: var(--color-text-secondary, #94a3b8);
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.5;
}

.signup-box .privacy-note {
    color: var(--color-text-tertiary, #64748b);
    font-size: 12px;
    margin-top: 16px;
}

.signup-form {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.signup-form input[type="email"],
.signup-popup-form input[type="email"] {
    padding: 14px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.signup-form input[type="email"] { width: 280px; }
.signup-popup-form input[type="email"] { width: 100%; padding: 12px 16px; }

.signup-form input[type="email"]::placeholder,
.signup-popup-form input[type="email"]::placeholder { color: var(--color-text-tertiary, #64748b); }

.signup-form input[type="email"]:focus,
.signup-popup-form input[type="email"]:focus { border-color: rgba(255, 215, 0, 0.5); background: rgba(255, 255, 255, 0.08); }

.signup-form button,
.signup-popup-form button {
    padding: 14px 28px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a2e;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.signup-popup-form button { padding: 12px 24px; width: 100%; }

.signup-form button:hover,
.signup-popup-form button:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(255, 215, 0, 0.35); }
.signup-form button:disabled,
.signup-popup-form button:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.signup-message,
.signup-popup-message { margin-top: 16px; font-size: 14px; min-height: 20px; }
.signup-popup-message { margin-top: 12px; font-size: 13px; min-height: 18px; }
.signup-message.success, .signup-popup-message.success { color: #4ade80; }
.signup-message.error, .signup-popup-message.error { color: #f87171; }

/* ── Stats Footer ── */

.stats-footer {
    text-align: center;
    padding: 20px 24px;
    color: var(--color-text-tertiary, #64748b);
    font-size: 13px;
    letter-spacing: 0.5px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Signup Popup Modal ── */

.signup-popup-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.signup-popup-overlay.active { display: flex; opacity: 1; }

.signup-popup {
    background: rgba(12, 25, 41, 0.98);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px 20px 0 0;
    padding: 32px 28px;
    max-width: 420px; width: 100%;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative;
}

.signup-popup-overlay.active .signup-popup { transform: translateY(0); }

.signup-popup-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none;
    color: var(--color-text-secondary, #94a3b8);
    font-size: 24px; cursor: pointer;
    padding: 4px; line-height: 1;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; transition: all 0.2s;
}

.signup-popup-close:hover { color: #FFD700; background: rgba(255, 215, 0, 0.1); }

.signup-popup h3 {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: 22px; color: #ffffff;
    margin-bottom: 8px; padding-right: 40px;
}

.signup-popup p {
    color: var(--color-text-secondary, #94a3b8);
    font-size: 14px; margin-bottom: 20px; line-height: 1.5;
}

.signup-popup-form { display: flex; flex-direction: column; gap: 12px; }

@media (min-width: 769px) {
    .signup-popup-overlay { align-items: center; }
    .signup-popup {
        border-radius: 20px; max-width: 400px;
        transform: scale(0.9); opacity: 0;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 215, 0, 0.1);
    }
    .signup-popup-overlay.active .signup-popup { transform: scale(1); opacity: 1; }
}

/* ── Animations ── */
.location-detected { animation: locationPulse 0.6s ease-out; }

@keyframes locationPulse {
    0% { opacity: 0.7; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

/* ── Responsive ── */

@media (max-width: 900px) {
    .liturgy-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .btn { width: 100%; justify-content: center; }
    .cta-buttons { flex-direction: column; width: 100%; }
    .secondary-ctas { flex-wrap: wrap; gap: 8px 16px; }
    .signup-form { flex-direction: column; }
    .signup-form input[type="email"],
    .signup-form button { width: 100%; }
    .diocese-grid { grid-template-columns: 1fr; }
    .filter-tabs { gap: 6px; }
    .filter-tab { padding: 6px 14px; font-size: 13px; }
}
