/* ========================================================
   Design Tokens
   ======================================================== */
:root {
    /* Dynamic — overridden by SiteSettings JS interop */
    --color-primary: #1a365d;
    --color-secondary: #475569;

    /* Static design tokens */
    --color-accent: #3b82f6;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);

    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
}

/* ========================================================
   Typography
   ======================================================== */
html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    color: var(--color-text);
    background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--color-text);
}

h1:focus {
    outline: none;
}

/* ========================================================
   Icons (Bootstrap Icons alignment)
   ======================================================== */
.bi {
    vertical-align: -0.125em;
    line-height: 1;
}

h1 .bi, h2 .bi, h3 .bi, h4 .bi, h5 .bi, h6 .bi {
    vertical-align: -0.1em;
}

.btn .bi {
    vertical-align: -0.15em;
    font-size: 1em;
}

.btn-sm .bi {
    font-size: 0.875em;
}

.badge .bi {
    vertical-align: -0.1em;
    font-size: 0.9em;
}

/* ========================================================
   Links
   ======================================================== */
a, .btn-link {
    color: var(--color-accent);
    transition: color var(--transition-fast);
}

a:hover, .btn-link:hover {
    color: var(--color-primary);
}

/* ========================================================
   Buttons
   ======================================================== */
.btn {
    border-radius: var(--radius-md);
    padding: 0.438rem 1rem;
    font-weight: 500;
    transition: color var(--transition-base), background-color var(--transition-base),
                border-color var(--transition-base), box-shadow var(--transition-base);
    border: 1px solid transparent;
}

.btn-primary {
    color: #fff;
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.35);
}

.btn-primary:active {
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
}

.btn-outline-primary {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-outline-primary:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.btn-success {
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.3);
}
.btn-success:hover { box-shadow: 0 4px 6px rgba(5, 150, 105, 0.25); }
.btn-success:active { box-shadow: 0 1px 2px rgba(5, 150, 105, 0.3); }

.btn-outline-success:hover { box-shadow: 0 4px 6px rgba(5, 150, 105, 0.15); }

.btn-warning {
    box-shadow: 0 1px 2px rgba(217, 119, 6, 0.3);
}
.btn-warning:hover { box-shadow: 0 4px 6px rgba(217, 119, 6, 0.25); }
.btn-warning:active { box-shadow: 0 1px 2px rgba(217, 119, 6, 0.3); }

.btn-outline-warning:hover { box-shadow: 0 4px 6px rgba(217, 119, 6, 0.15); }

.btn-danger {
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.3);
}
.btn-danger:hover { box-shadow: 0 4px 6px rgba(220, 38, 38, 0.25); }
.btn-danger:active { box-shadow: 0 1px 2px rgba(220, 38, 38, 0.3); }

.btn-outline-danger:hover { box-shadow: 0 4px 6px rgba(220, 38, 38, 0.15); }

.btn-info {
    box-shadow: 0 1px 2px rgba(8, 145, 178, 0.3);
}
.btn-info:hover { box-shadow: 0 4px 6px rgba(8, 145, 178, 0.25); }
.btn-info:active { box-shadow: 0 1px 2px rgba(8, 145, 178, 0.3); }

.btn-outline-info:hover { box-shadow: 0 4px 6px rgba(8, 145, 178, 0.15); }

.btn-secondary {
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { box-shadow: var(--shadow-md); }
.btn-secondary:active { box-shadow: var(--shadow-sm); }

.btn-outline-secondary:hover { box-shadow: var(--shadow-md); }

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.55rem 1.35rem;
    font-size: 1.05rem;
}

/* ========================================================
   Focus Rings
   ======================================================== */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ========================================================
   Cards
   ======================================================== */
.card {
    position: relative;
    z-index: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

a > .card:hover,
.card:has(.card-footer a):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    z-index: 1;
}

.card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    padding: 0.75rem 1.125rem;
}

.card-body {
    padding: 1.125rem;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid var(--color-border);
    padding: 0.75rem 1.125rem;
}

.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning,
.card.bg-danger {
    border: none;
}

/* ========================================================
   Tables
   ======================================================== */
.table {
    --bs-table-hover-bg: rgba(59, 130, 246, 0.04);
    border-color: var(--color-border);
}

.table > thead {
    background-color: #f1f5f9;
}

.table > thead th {
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.table > tbody > tr > td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table-responsive {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.card .table-responsive,
.card-body .table-responsive {
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.table-responsive > .table {
    margin-bottom: 0;
}

.table-responsive > .table > :not(caption) > * > * {
    border-inline: none;
}

.table-responsive > .table > tbody > tr:last-child > * {
    border-bottom: none;
}

.table-light {
    --bs-table-bg: #f1f5f9;
}

/* ========================================================
   Forms
   ======================================================== */
.form-control, .form-select {
    border-radius: var(--radius-md);
    border-color: var(--color-border);
    padding: 0.438rem 0.8rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    color: var(--color-text);
}

.form-control-sm, .form-select-sm {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.form-control-lg, .form-select-lg {
    padding: 0.5rem 1rem;
}

/* Preserve flat edges inside input-groups */
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-text {
    border-color: var(--color-border);
    background-color: #f8fafc;
    color: var(--color-text-muted);
    border-radius: var(--radius-md);
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

/* ========================================================
   Alerts
   ======================================================== */
.alert {
    border-radius: var(--radius-md);
    border: 1px solid;
    border-left-width: 4px;
    padding: 0.875rem 1rem;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
    border-left-color: #dc2626;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
    border-left-color: #059669;
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
    border-left-color: #d97706;
}

.alert-info {
    background-color: #ecfeff;
    color: #155e75;
    border-color: #a5f3fc;
    border-left-color: #0891b2;
}

/* ========================================================
   Badges
   ======================================================== */
.badge {
    border-radius: 50rem;
    padding: 0.35em 0.75em;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
}

/* ========================================================
   Modals
   ======================================================== */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
}

/* ========================================================
   Nav Tabs & Pagination
   ======================================================== */
.nav-tabs .nav-link {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: var(--color-text-muted);
    font-weight: 500;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.nav-tabs .nav-link.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    font-weight: 600;
}

.nav-tabs .nav-link:hover:not(.active) {
    color: var(--color-text);
}

.pagination .page-link {
    border-radius: var(--radius-sm);
    margin: 0 2px;
    color: var(--color-accent);
    border-color: var(--color-border);
    transition: all var(--transition-fast);
}

.pagination .page-item.active .page-link {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

/* ========================================================
   Progress Bars & Spinners
   ======================================================== */
.progress {
    border-radius: 50rem;
    background-color: #e2e8f0;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

.spinner-border {
    color: var(--color-accent);
}

/* ========================================================
   List Groups
   ======================================================== */
.list-group-item {
    border-color: var(--color-border);
    transition: background-color var(--transition-fast);
}

.list-group-item-action:hover {
    background-color: rgba(59, 130, 246, 0.04);
}

/* ========================================================
   Accordion
   ======================================================== */
.accordion-button:not(.collapsed) {
    color: var(--color-accent);
    background-color: rgba(59, 130, 246, 0.05);
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ========================================================
   Breadcrumbs
   ======================================================== */
.breadcrumb {
    font-size: 0.8125rem;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--color-accent);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--color-text-muted);
}

/* ========================================================
   Dropdowns
   ======================================================== */
.dropdown-menu {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
    background-color: rgba(59, 130, 246, 0.06);
}

/* ========================================================
   Notification Bell Dropdown
   ======================================================== */
.notification-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
}

.notification-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    width: 360px;
    max-height: 420px;
    overflow-y: auto;
    z-index: 1050;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

/* ========================================================
   Content & Animation
   ======================================================== */
.content {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   Validation
   ======================================================== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #059669;
}

.invalid {
    outline: 1px solid #dc2626;
}

.validation-message {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.375rem;
    line-height: 1.4;
}

.form-check-label {
    font-weight: 400;
    color: var(--color-text);
}

.form-check-input {
    border-color: var(--color-border);
}

.form-check-input:checked {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.form-switch .form-check-input:checked {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

/* ========================================================
   Loading Screen
   ======================================================== */
.loading-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--color-bg);
    color: var(--color-primary);
}

.loading-screen h2 {
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* ========================================================
   Footer
   ======================================================== */
#site-footer {
    background-color: #f8fafc;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

/* ========================================================
   Hero Section (Index page)
   ======================================================== */
.hero-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e0ecff 50%, #f0f7ff 100%);
    border-radius: var(--radius-lg);
    margin: -1.5rem -1.5rem 2rem -1.5rem;
    padding: 3.5rem 2rem;
}

@media (min-width: 641px) {
    .hero-section {
        margin: -1.5rem -2rem 2rem -2rem;
    }
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.hero-tagline {
    font-size: 1.125rem;
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: 1rem;
}

.hero-welcome {
    font-size: 1rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* ========================================================
   Blazor Error UI
   ======================================================== */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* ========================================================
   Video Conferencing Room (preserved)
   ======================================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 8px;
    height: 100%;
    align-content: center;
}

.video-participant {
    position: relative;
    background: #16213e;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
    min-height: 200px;
}

.video-participant video,
.video-participant audio {
    display: block;
}

.video-participant .participant-name {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    z-index: 1;
}

.video-local {
    border: 2px solid #0d6efd;
}

.meeting-room {
    margin: -1.1rem;
}

/* ========================================================
   Public Landing Page Sections
   ======================================================== */

/* Section utilities */
.public-section {
    padding: 5rem 0;
}

.public-section-sm {
    padding: 3rem 0;
}

/* Landing Hero */
.landing-hero {
    background: linear-gradient(135deg, #0f2340 0%, var(--color-primary) 60%, #1e3a5f 100%);
    color: white;
    padding: 6rem 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.landing-hero h1 {
    font-size: clamp(2.25rem, 5vw, 4.5rem);
    font-weight: 800;
    color: white;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.landing-hero .hero-lead {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    max-width: 580px;
}

/* Stats Bar */
.stats-bar {
    background: var(--color-accent);
    padding: 2rem 0;
}

.stat-item {
    text-align: center;
    color: white;
    padding: 0.75rem 1rem;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.9;
}

/* How It Works Steps */
.step-card {
    border-top: 4px solid var(--color-accent) !important;
    text-align: center;
    padding: 1.5rem;
    height: 100%;
}

.step-number {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

/* Who We Serve / Serve cards */
.serve-card {
    text-align: center;
    padding: 2rem 1.5rem;
    height: 100%;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.serve-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl) !important;
}

.serve-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--color-accent);
    display: block;
}

/* Funding Tracker */
.funding-tracker {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--color-border);
}

.funding-progress {
    height: 28px;
    border-radius: 50rem;
}

/* Dual CTA panels */
.cta-panel {
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    height: 100%;
}

/* Page hero (inner public pages — not the home landing hero) */
.page-hero {
    background: linear-gradient(135deg, #0f2340 0%, var(--color-primary) 100%);
    color: white;
    padding: 4rem 0;
}

.page-hero h1 {
    color: white;
    font-size: clamp(1.75rem, 3vw, 2.75rem);
    font-weight: 700;
}

.page-hero p {
    color: rgba(255, 255, 255, 0.8);
}

/* FAQ Accordion (Blazor-driven, no BS JS) */
.public-accordion .accordion-item {
    border: 1px solid var(--color-border);
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

.public-accordion .accordion-button {
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text);
    transition: background-color 0.15s ease;
}

.public-accordion .accordion-button:hover {
    background-color: rgba(59, 130, 246, 0.04);
}

.public-accordion .accordion-button.open {
    color: var(--color-accent);
    background-color: rgba(59, 130, 246, 0.05);
}

.public-accordion .accordion-body {
    padding: 0 1.25rem 1rem 1.25rem;
}

/* Testimonial cards */
.testimonial-card {
    border-left: 4px solid var(--color-accent);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 100%;
}

.testimonial-quote {
    font-size: 1rem;
    font-style: italic;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Donation tier cards */
.donation-tier-card {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    height: 100%;
}

.donation-tier-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-lg);
}

.donation-tier-card.featured {
    border-color: var(--color-accent);
    background: rgba(59, 130, 246, 0.03);
}

.donation-tier-card.selected {
    border-color: var(--color-accent);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: var(--shadow-lg);
}

.donation-amount {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--color-primary);
}

.donation-period {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 400;
}
