/* ═══════════════════════════════════════════════════════════════
   Sri Ayyappa Temple — Design System
   Inspired by classic Kerala/Tamil temple vazhipadu portals
   (ref: online.jalahalliayyappatemple.com) — elevated & modern
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Brand — forest green + gold (premium temple catalog) */
    --temple-red: var(--forest-700);
    --temple-red-dark: var(--forest-900);
    --temple-red-deep: var(--forest-950);
    --temple-maroon: var(--forest-800);
    --temple-maroon-dark: var(--forest-900);
    --temple-maroon-deep: var(--forest-950);
    --temple-burgundy: var(--forest-800);
    --temple-burgundy-soft: var(--forest-600);

    --temple-gold: var(--temple-gold-accent);
    --temple-gold-bright: var(--temple-gold-warm);
    --temple-gold-light: #FEF3C7;
    --temple-gold-pale: #FFFBEB;
    --temple-gold-dark: #92400E;

    --temple-saffron: var(--brand-600);
    --temple-saffron-soft: var(--brand-300);

    --temple-cream: var(--brand-50);
    --temple-cream-dark: var(--brand-100);
    --temple-ivory: #FFFFFF;
    --temple-parchment: var(--brand-100);
    --temple-surface: #FFFFFF;
    --temple-text: var(--neutral-900);
    --temple-text-soft: var(--neutral-700);
    --temple-muted: var(--neutral-500);
    --temple-border: var(--neutral-200);
    --temple-border-light: var(--neutral-200);
    --temple-border-input: var(--neutral-300);
    --temple-border-gold: rgba(191, 186, 95, 0.35);
    --temple-border-red: rgba(138, 134, 57, 0.15);

    --font-sans: 'Inter', 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-display: 'Manrope', 'Inter', system-ui, sans-serif;

    --temple-radius-sm: 8px;
    --temple-radius: 12px;
    --temple-radius-lg: 16px;
    --temple-radius-xl: 20px;

    --temple-shadow-sm: 0 1px 3px rgba(41, 37, 36, 0.05);
    --temple-shadow: 0 4px 16px rgba(41, 37, 36, 0.07);
    --temple-shadow-lg: 0 12px 32px rgba(41, 37, 36, 0.09);
    --temple-shadow-gold: 0 4px 12px rgba(191, 186, 95, 0.25);
    --temple-focus-ring: 0 0 0 3px var(--color-primary-ring);

    --temple-gradient-red: linear-gradient(135deg, var(--forest-900) 0%, var(--forest-700) 55%, var(--forest-600) 100%);
    --temple-gradient-maroon: var(--temple-gradient-red);
    --temple-gradient-gold: linear-gradient(180deg, #FEF3C7 0%, var(--temple-gold-warm) 50%, var(--temple-gold-accent) 100%);
    --temple-gradient-gold-hover: linear-gradient(180deg, #FFFBEB 0%, #FDE68A 50%, var(--temple-gold-warm) 100%);
    --temple-page-bg: var(--temple-cream-page);
    --temple-gradient-page: linear-gradient(180deg, var(--temple-cream-page) 0%, #fff 40%, var(--forest-50) 100%);
    --temple-gradient-nav: linear-gradient(180deg, #FFFFFF 0%, var(--forest-50) 100%);
    --temple-gradient-header: linear-gradient(135deg, var(--forest-900) 0%, var(--forest-800) 45%, var(--forest-700) 100%);
    --temple-header-ornament: linear-gradient(90deg, transparent, var(--temple-gold-warm), var(--temple-gold-accent), var(--temple-gold-warm), transparent);

    --auth-maroon: var(--temple-red);
    --auth-maroon-dark: var(--temple-red-dark);
    --auth-saffron: var(--temple-saffron);
    --auth-cream: var(--temple-cream);
    --auth-text: var(--temple-text);
    --auth-muted: var(--temple-muted);
    --auth-border: var(--temple-border);
    --auth-font: var(--font-sans);
}

/* ── Page shell ── */
.temple-page-banner {
    background: var(--temple-gradient-header);
    color: #F5F5F0;
    padding: 1.25rem 1.5rem;
    border-radius: var(--temple-radius-xl);
    margin-bottom: 1rem;
    box-shadow: 0 8px 32px rgba(11, 45, 28, 0.22);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(232, 163, 23, 0.2);
}

.temple-page-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 70% at 95% 10%, rgba(232, 163, 23, 0.14), transparent 55%),
        radial-gradient(ellipse 45% 55% at 5% 95%, rgba(255, 255, 255, 0.04), transparent 50%);
    pointer-events: none;
}

.temple-page-banner::after {
    content: '';
    display: block;
    height: 3px;
    margin-top: 1rem;
    border-radius: 999px;
    background: var(--temple-header-ornament);
    opacity: 0.85;
}

.temple-page-banner-inner {
    position: relative;
    z-index: 1;
}

.temple-page-banner h1,
.temple-page-banner .banner-title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    margin: 0 0 0.35rem;
    letter-spacing: 0.02em;
    color: #FFFBEB;
}

.temple-page-banner .banner-sub {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 251, 235, 0.82);
}

.temple-page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    border-bottom: none;
    position: relative;
}

.temple-page-header::after {
    display: none;
}

.temple-page-header h3,
.temple-page-header .page-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--temple-red-dark);
    margin: 0;
    font-size: 1.4rem;
}

.temple-gold-rule {
    height: 4px;
    border: none;
    border-radius: 0;
    background: var(--temple-gradient-gold);
}

/* ── Vazhipadu / Puja offering cards (reference site style) ── */
.temple-offering-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    .temple-offering-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.25rem;
    }
}

.temple-offering-card {
    background: var(--temple-surface);
    border: none;
    border-radius: 20px;
    padding: 20px;
    text-align: left;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 100%;
}

.temple-offering-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.temple-offering-card.festival {
    border-top-color: var(--temple-saffron);
    background: linear-gradient(180deg, #FFFBEB 0%, #fff 40%);
}

.temple-offering-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--temple-red-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.temple-offering-meta {
    font-size: 0.8rem;
    color: var(--temple-muted);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.temple-offering-meta i {
    color: var(--temple-gold-dark);
    margin-right: 0.2rem;
}

.temple-offering-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--temple-red);
    margin-bottom: 1rem;
    line-height: 1;
}

.temple-offering-price small {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--temple-muted);
}

.temple-btn-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 7.5rem;
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--temple-gradient-red);
    border: none;
    border-radius: var(--temple-radius);
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--temple-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: auto;
}

.temple-btn-select:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--temple-shadow);
}

.temple-btn-select.btn-secondary-style {
    background: #fff;
    color: var(--temple-red-dark);
    border: 1.5px solid var(--temple-border-light);
    box-shadow: var(--temple-shadow-sm);
    min-width: auto;
    width: auto;
    min-height: 44px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.temple-btn-select.btn-secondary-style:hover {
    background: var(--temple-parchment);
    color: var(--temple-red-dark);
    border-color: var(--temple-border);
}

.temple-offering-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}

/* ── Dashboard stat cards (white page) ── */
.temple-stat-card {
    border: none !important;
    border-radius: var(--temple-radius) !important;
    overflow: hidden;
    box-shadow: var(--temple-shadow) !important;
}

.temple-stat-card .card-body {
    padding: 1.25rem 1.5rem;
}

.temple-stat-card .kpi-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.temple-stat-card .stat-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.92;
    margin-bottom: 0.35rem;
}

.temple-stat-card .stat-value {
    font-family: 'Inter', 'Poppins', var(--font-sans);
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.temple-stat-card .stat-trend {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 0.5rem;
}

.temple-stat-card.stat-revenue {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
    color: #fff;
}

.temple-stat-card.stat-puja {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    color: #fff;
}

.temple-stat-card.stat-donation {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    color: #fff;
}

.temple-stat-card.stat-count {
    background: #fff !important;
    color: var(--temple-text);
    border: none !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

.temple-stat-card.stat-count .stat-value {
    color: var(--temple-red);
}

.temple-toolbar {
    background: #fff;
    border: none;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.temple-footer {
    text-align: center;
    padding: 1rem 1.5rem;
    margin-top: auto;
    font-size: 0.8rem;
}

.theme-ayyappa .temple-footer {
    background: linear-gradient(180deg, var(--forest-900) 0%, var(--forest-950) 100%);
    color: rgba(255, 251, 235, 0.75);
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--forest-600), var(--temple-gold-warm), var(--forest-600)) 1;
}

.theme-ayyappa .temple-footer p {
    color: rgba(255, 251, 235, 0.85);
}

.theme-ayyappa .temple-footer .footer-tagline {
    color: var(--temple-gold-warm);
}

/* ── Bootstrap overrides — professional form & UI ── */
.card {
    border: 1px solid var(--temple-border-light) !important;
    border-radius: var(--temple-radius-xl) !important;
    box-shadow: var(--temple-shadow-sm) !important;
    background: var(--temple-surface) !important;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--temple-shadow) !important;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--temple-border-light) !important;
    font-weight: 600;
    color: var(--temple-text);
    font-size: 1rem;
    padding: 1rem 1.25rem !important;
}

.card-body {
    padding: 1.25rem !important;
}

.card-title {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--temple-red-dark);
    font-size: 1.0625rem;
}

.form-control,
.form-select,
textarea.form-control {
    border: 1.5px solid var(--temple-border-input) !important;
    border-radius: var(--temple-radius) !important;
    background-color: var(--temple-surface) !important;
    color: var(--temple-text) !important;
    min-height: 48px;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    box-shadow: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder {
    color: #A8A29E;
    opacity: 1;
}

.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
    border-color: #A8A29E !important;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: var(--temple-red) !important;
    box-shadow: var(--temple-focus-ring) !important;
    outline: none;
}

.form-control:disabled,
.form-select:disabled {
    background-color: var(--temple-cream-dark) !important;
    color: var(--temple-muted) !important;
    cursor: not-allowed;
}

.form-select {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748B' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 14px 10px !important;
    appearance: none;
}

.form-control-lg,
.form-select-lg {
    min-height: 52px;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--temple-radius) !important;
}

.form-label {
    font-weight: 600;
    color: var(--temple-text-soft);
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

.input-group .form-control {
    border-radius: var(--temple-radius) !important;
}

.btn-primary {
    background: var(--temple-gradient-red) !important;
    border: none !important;
    border-radius: var(--temple-radius) !important;
    font-weight: 600;
    font-size: 0.9375rem;
    min-height: 48px;
    padding: 0.5rem 1.25rem;
    box-shadow: var(--temple-shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus {
    background: var(--temple-gradient-red) !important;
    transform: translateY(-1px);
    box-shadow: var(--temple-shadow);
}

.btn-secondary {
    background: var(--temple-surface) !important;
    border: 1.5px solid var(--temple-border) !important;
    color: var(--temple-text-soft) !important;
    border-radius: var(--temple-radius) !important;
    font-weight: 600;
    min-height: 48px;
}

.btn-outline-primary {
    color: var(--temple-red) !important;
    border: 1.5px solid var(--temple-red) !important;
    border-radius: var(--temple-radius) !important;
    font-weight: 600;
    min-height: 44px;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background: var(--temple-parchment) !important;
    border-color: var(--temple-red-dark) !important;
    color: var(--temple-red-dark) !important;
}

.table thead th,
.table-light th {
    background: var(--temple-parchment) !important;
    color: var(--temple-red-dark);
    font-weight: 700;
    border-bottom: 2px solid var(--temple-gold) !important;
}

.alert {
    border-radius: var(--temple-radius-sm);
    border: none;
}

.alert-info {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    color: #1E40AF;
    border-left: 4px solid #3B82F6;
}

.badge.bg-primary,
.badge.bg-warning {
    font-weight: 600;
}

.badge.bg-primary {
    background: var(--temple-red) !important;
}

.spinner-border {
    color: var(--temple-red);
}

.modal-content {
    border: none;
    border-radius: var(--temple-radius-lg);
    border-top: 4px solid var(--temple-gold);
    box-shadow: var(--temple-shadow-lg);
}

.modal-header {
    background: var(--temple-parchment);
    border-bottom: 1px solid var(--temple-border);
}

.modal-title {
    font-family: var(--font-display);
    color: var(--temple-red-dark);
    font-weight: 700;
}

/* Mobile nav fallback (global — works in MAUI WebView when viewport is misreported) */
@media (max-width: 991.98px) {
    .temple-topnav-toggler {
        display: flex !important;
    }

    .temple-topnav-panel {
        display: none !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        flex-direction: column !important;
        overflow-x: hidden !important;
    }

    .temple-topnav-bar .temple-nav-checkbox:checked ~ .temple-topnav-panel {
        display: flex !important;
    }

    .temple-topnav-links {
        flex-direction: column !important;
        width: 100% !important;
    }

    .temple-topnav-links a.temple-nav-link {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .temple-nav-dropdown {
        width: 100% !important;
    }
}
