:root {
    --bg-0: #f3f7fb;
    --bg-1: #dbe8f3;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --surface-dark: #0f1e2d;
    --text-main: #112033;
    --text-soft: #5a6b7f;
    --primary: #0b7bb5;
    --primary-strong: #095e89;
    --accent: #f28f3b;
    --success: #1f9d6d;
    --danger: #d04545;
    --ring: rgba(11, 123, 181, 0.28);
    --shadow-sm: 0 6px 20px rgba(12, 34, 58, 0.08);
    --shadow-md: 0 18px 44px rgba(9, 34, 59, 0.14);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --transition: 220ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    background:
        radial-gradient(circle at 12% 15%, #edf5fb 0%, transparent 35%),
        radial-gradient(circle at 88% 10%, #d8ecff 0%, transparent 40%),
        linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 100%);
    overflow-x: hidden;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: "Sora", "Plus Jakarta Sans", sans-serif;
    letter-spacing: -0.02em;
    color: #0d2137;
}

p {
    margin-top: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
}

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0e2d48 0%, #0b7bb5 100%);
    transition: opacity 0.65s ease;
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.preloader-content {
    text-align: center;
    color: #fff;
}

.preloader-logo {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.25);
    animation: pulse-logo 2s infinite;
}

.preloader-text {
    margin-top: 16px;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}

.preloader-spinner {
    width: 40px;
    height: 40px;
    margin: 18px auto 0;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-logo {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(248, 251, 255, 0.78);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-sm);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}

.logo a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.header-logo-img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 8px 22px rgba(9, 53, 84, 0.25);
}

.logo-text {
    font-family: "Sora", sans-serif;
    font-size: 1.06rem;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-weight: 600;
    color: #2a4258;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff5858;
    box-shadow: 0 0 0 0 rgba(255, 88, 88, 0.6);
}

.live-indicator.pulsing {
    animation: ping 1.5s infinite;
}

@keyframes ping {
    0% { box-shadow: 0 0 0 0 rgba(255, 88, 88, 0.55); }
    70% { box-shadow: 0 0 0 10px rgba(255, 88, 88, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 88, 88, 0); }
}

.live-text {
    font-size: 0.86rem;
    color: var(--text-soft);
    font-weight: 600;
}

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(11, 123, 181, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary-strong);
    cursor: pointer;
    place-items: center;
}

.mobile-menu-toggle:hover {
    background: #fff;
}

.mobile-menu-toggle i {
    pointer-events: none;
}

/* Buttons */
.btn {
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 700;
    border-radius: 999px;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #289ed7);
    color: #fff;
    box-shadow: 0 10px 22px rgba(11, 123, 181, 0.33);
}

.btn-primary:hover {
    box-shadow: 0 14px 30px rgba(11, 123, 181, 0.4);
}

.btn-secondary {
    padding: 10px 18px;
    background: #e9f4fb;
    color: var(--primary-strong);
}

.btn-secondary:hover {
    background: #d9ecf8;
}

.btn-ghost {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--primary-strong);
    border: 1px solid rgba(11, 123, 181, 0.2);
}

.btn-ghost:hover {
    background: #fff;
}

.btn-large {
    padding: 14px 24px;
    font-size: 0.98rem;
}

.btn-outline {
    padding: 14px 24px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Hero */
.hero {
    position: relative;
    min-height: 84vh;
    display: grid;
    align-items: center;
    overflow: hidden;
}

.hero-background,
.hero-bg-img,
.hero-overlay {
    position: absolute;
    inset: 0;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.03);
}

.hero-overlay {
    background:
        radial-gradient(circle at 15% 15%, rgba(242, 143, 59, 0.34) 0%, transparent 38%),
        linear-gradient(130deg, rgba(7, 30, 49, 0.88) 0%, rgba(7, 30, 49, 0.58) 45%, rgba(8, 51, 80, 0.78) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    width: min(1200px, 92%);
    margin: 0 auto;
    color: #fff;
    padding: 88px 0 116px;
    animation: rise-in 0.75s ease both;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 0.9rem;
    font-weight: 600;
}

.badge-icon {
    font-size: 0.95rem;
}

.hero-title {
    margin-top: 18px;
    font-size: clamp(2.1rem, 4.8vw, 4rem);
    line-height: 1.05;
    color: #fff;
}

.hero-title .highlight {
    color: #ffe7a5;
}

.hero-subtitle {
    margin-top: 14px;
    max-width: 620px;
    color: #dae8f8;
    font-size: clamp(1rem, 2.1vw, 1.25rem);
}

.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.hero-stats {
    margin-top: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.stat-item {
    min-width: 140px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.stat-number {
    display: block;
    font-family: "Sora", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    display: block;
    color: #d6e7fa;
    font-size: 0.84rem;
    margin-top: 2px;
}

.current-date {
    position: relative;
    z-index: 1;
    width: min(1200px, 92%);
    margin: -72px auto 0;
    color: #edf5ff;
    font-weight: 600;
}

.scroll-indicator {
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    animation: bob 1.4s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-4px); }
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shared Section */
section {
    padding: 84px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 34px;
}

.section-subtitle {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary-strong);
}

.section-title {
    margin-top: 8px;
    font-size: clamp(1.7rem, 3vw, 2.55rem);
}

.section-divider {
    width: 84px;
    height: 4px;
    margin: 14px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
}

.section-header-light .section-subtitle,
.section-header-light .section-title {
    color: #fff;
}

.section-header-light .section-divider {
    background: linear-gradient(90deg, #ffe0aa, #8fd6ff);
}

/* Announcements */
.announcements-section {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.58));
}

.announcement-feed {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.announcement-card {
    padding: 20px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid rgba(196, 214, 231, 0.62);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 230px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.announcement-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 14px;
    border: 1px solid rgba(196, 214, 231, 0.62);
    background: #f1f6fb;
}

.announcement-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.card-body h3 {
    margin-bottom: 10px;
    font-size: 1.16rem;
}

.card-body p {
    color: var(--text-soft);
}

.card-footer {
    margin-top: auto;
    font-size: 0.82rem;
    color: #7b8b9a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 6px 10px;
    border-radius: 999px;
    color: #fff;
}

.category-badge.youth { background: #2f6ec7; }
.category-badge.service { background: var(--success); }
.category-badge.general { background: #68768a; }
.category-badge.event { background: var(--danger); }
.category-badge.testimony { background: var(--accent); }

.share-btn {
    border: 0;
    border-radius: 10px;
    padding: 6px 10px;
    background: #edf5fb;
    color: var(--primary-strong);
    cursor: pointer;
    font-weight: 700;
}

.share-btn:hover {
    background: #dceef9;
}

.announcement-card.shared-focus {
    box-shadow: 0 0 0 3px rgba(11, 123, 181, 0.34), var(--shadow-md);
    transform: translateY(-3px);
}

.no-announcements-message,
.no-pending-submissions {
    text-align: center;
    padding: 26px;
    border-radius: var(--radius-md);
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.78);
    border: 1px dashed #c0d5e5;
}

/* Testimonies */
.thanksgiving-section {
    background: linear-gradient(145deg, #f1f7fd 0%, #e3edf7 100%);
}

.testimony-wall-container {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.testimony-card {
    background: var(--surface-strong);
    border: 1px solid rgba(189, 209, 227, 0.6);
    border-radius: var(--radius-md);
    padding: 22px 20px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

.testimony-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.testimony-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #dceaf6;
}

.testimony-card p {
    margin: 14px 0 12px;
    color: #2f4358;
    font-size: 0.96rem;
    flex-grow: 1;
}

.testimony-author {
    color: #5f7183;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
}

.testimony-author strong {
    color: #1d3247;
}

.micro-interaction-btn {
    margin-top: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    background: #ffe5e5;
    color: #be3434;
    transition: transform var(--transition), background var(--transition);
}

.micro-interaction-btn:hover {
    transform: scale(1.1);
    background: #ffd4d4;
}

/* Connect */
.connect-section {
    position: relative;
    background:
        radial-gradient(circle at 12% 20%, rgba(255, 188, 126, 0.2) 0%, transparent 35%),
        linear-gradient(145deg, #082941 0%, #0b3a5d 60%, #14507a 100%);
}

.connect-content {
    position: relative;
    z-index: 1;
}

.connect-grid {
    margin-top: 26px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.connect-card {
    padding: 20px;
    border-radius: var(--radius-md);
    color: #e7f3ff;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(202, 229, 255, 0.22);
    backdrop-filter: blur(5px);
}

.connect-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.connect-card h3 {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.connect-card p {
    color: #d4e7f8;
    margin-bottom: 0;
}

/* Footer */
.main-footer {
    padding: 24px 0 30px;
    background: #081c2c;
    color: #d3e5f4;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.footer-logo img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
}

.footer-links {
    display: inline-flex;
    gap: 10px;
}

.footer-links a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #e0effc;
    border: 1px solid rgba(222, 241, 255, 0.22);
}

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.footer-copyright {
    width: 100%;
    margin: 0;
    font-size: 0.82rem;
    color: #9fb5c8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1002;
    padding: 20px;
    background: rgba(8, 24, 38, 0.54);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    margin: 2vh auto;
    width: min(620px, 100%);
    max-height: 96vh;
    overflow-y: auto;
    padding: 26px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(194, 214, 232, 0.6);
    background: #f8fbff;
    box-shadow: var(--shadow-md);
}

.close-btn {
    position: absolute;
    right: 14px;
    top: 8px;
    font-size: 1.85rem;
    line-height: 1;
    color: #698298;
    cursor: pointer;
}

.close-btn:hover {
    color: #2f4f67;
}

.modal-header p {
    color: var(--text-soft);
    margin: 8px 0 18px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #2a445d;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    border: 1px solid #c3d8e8;
    border-radius: var(--radius-sm);
    padding: 12px 13px;
    font: inherit;
    color: var(--text-main);
    background: #fff;
}

.form-group textarea {
    resize: vertical;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: 3px solid var(--ring);
    border-color: #8fbedc;
}

/* Toast Notifications - Explicitly at the TOP */
.ui-toast-wrap {
    position: fixed !important;
    top: 20px !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    pointer-events: none !important;
    width: min(94%, 480px) !important;
}

.ui-toast {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 16px 24px !important;
    border-radius: 20px !important;
    color: #fff !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;
    background: #2f6ec7 !important;
    backdrop-filter: blur(12px) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    opacity: 0 !important;
    transform: translateY(-30px) scale(0.9) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    pointer-events: auto !important;
}

.ui-toast.active {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

.ui-toast.success { background: linear-gradient(135deg, #1f9d6d, #2ecc71) !important; }
.ui-toast.warning { background: linear-gradient(135deg, #d08a22, #f39c12) !important; }
.ui-toast.error { background: linear-gradient(135deg, #d04545, #e74c3c) !important; }
.ui-toast.info { background: linear-gradient(135deg, #2f6ec7, #3498db) !important; }

.toast-icon {
    font-size: 1.6rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.toast-content {
    flex-grow: 1 !important;
    line-height: 1.4 !important;
}

.submission-feedback-banner {
    display: none; /* Redundant now that showNotice is better */
}

/* Scroll animation hooks */
.slide-up-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 520ms ease, transform 520ms ease;
}

.slide-up-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1080px) {
    .navbar {
        flex-wrap: wrap;
    }

    .nav-links {
        order: 10;
        width: 100%;
        justify-content: center;
        padding-top: 8px;
    }
}

@media (max-width: 768px) {
    .announcement-feed {
        grid-template-columns: 1fr;
    }

    .announcement-feed.many-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .announcement-image {
        height: 190px;
    }

    .navbar {
        position: relative;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    .logo {
        width: auto;
        display: flex;
        justify-content: flex-start;
        order: 1;
    }

    .logo-text {
        font-size: 0.95rem;
    }

    .mobile-menu-toggle {
        display: grid;
        order: 2;
        margin-left: auto;
    }

    .nav-links,
    .header-actions,
    .admin-toggle-btn {
        display: none;
        width: 100%;
        margin-left: 0;
    }

    .nav-links {
        order: 3;
    }

    .header-actions {
        order: 4;
    }

    .admin-toggle-btn {
        order: 5;
    }

    .navbar.mobile-open .nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 10px;
        padding: 12px;
        border-radius: var(--radius-md);
        border: 1px solid rgba(173, 204, 228, 0.9);
        background: rgba(252, 254, 255, 0.92);
    }

    .navbar.mobile-open .nav-links li a {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        border-radius: 10px;
        background: #eef6fc;
    }

    .navbar.mobile-open .header-actions {
        display: flex;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        margin-top: 10px;
        gap: 10px;
        padding: 0 4px;
    }

    .navbar.mobile-open .admin-toggle-btn {
        display: inline-flex;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .hero {
        min-height: 78vh;
    }

    .hero-content {
        padding: 76px 0 96px;
    }

    .current-date {
        margin-top: -60px;
    }

    section {
        padding: 68px 0;
    }
}
