/* Modern Chapelstreet Global Missions Design System */

/* CSS Custom Properties - Modern Color Palette */
:root {
    /* Primary Brand Colors */
    --cs-primary: #1a365d;
    --cs-primary-light: #2d5a87;
    --cs-primary-dark: #0f2537;
    --cs-secondary: #3182ce;
    --cs-accent: #4299e1;
    --cs-accent-light: #63b3ed;
    /* Modern Neutral Palette */
    --cs-gray-50: #f8fafc;
    --cs-gray-100: #f1f5f9;
    --cs-gray-200: #e2e8f0;
    --cs-gray-300: #cbd5e1;
    --cs-gray-400: #94a3b8;
    --cs-gray-500: #64748b;
    --cs-gray-600: #475569;
    --cs-gray-700: #334155;
    --cs-gray-800: #1e293b;
    --cs-gray-900: #0f172a;
    /* Semantic Colors */
    --cs-success: #10b981;
    --cs-warning: #f59e0b;
    --cs-danger: #ef4444;
    --cs-info: var(--cs-accent);
    /* Modern Gradients */
    --gradient-primary: linear-gradient(135deg, var(--cs-primary) 0%, var(--cs-secondary) 100%);
    --gradient-hero: linear-gradient(135deg, rgba(26, 54, 93, 0.95) 0%, rgba(49, 130, 206, 0.85) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Sora', var(--font-sans);
    /* Modern Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    /* Modern Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    /* Modern Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    /* Animations */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- incremental refinements for readability & contrast --- */
:root {
    --btn-text-dark: #0f172a;
    --btn-surface: #ffffff;
    --outline-border: rgba(255,255,255,0.65);
    --outline-border-dark: var(--cs-primary);
    --focus-ring: 0 0 0 3px rgba(49,130,206,0.35);
}

/* Modern Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--cs-gray-800);
    background: var(--cs-gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove fieldset/legend default box (caused the �box around heading�) */
fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-inline-size: 0;
}

legend {
    padding: 0;
    margin: 0;
    font: inherit;
    display: block;
}

/* Additional reset for common problematic elements */
button {
    border: none;
    background: none;
    font: inherit;
    cursor: pointer;
}

input, select, textarea {
    font: inherit;
    border: none;
    outline: none;
    background: transparent;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Ensure Font Awesome icons render properly */
i.fa, i.fab, i.fas, i.far, i.fal, i.fad, i.fat {
    display: inline-block;
    vertical-align: middle;
}

/* Fix any box model issues */
.container, .card, .btn, .form-control {
    box-sizing: border-box;
}

/* Modern Layout */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

    .page::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        background: radial-gradient(circle at 20% 80%, rgba(63, 179, 237, 0.1) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(26, 54, 93, 0.1) 0%, transparent 50%);
        z-index: -1;
        pointer-events: none;
    }

/* Modern Header with Glassmorphism */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
}

.navbar {
    padding: 0;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
}

.nav-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    color: var(--cs-primary);
    transition: all var(--transition-normal);
}

    .nav-brand:hover {
        text-decoration: none;
        color: var(--cs-secondary);
        transform: translateY(-1px);
    }

.nav-brand-text {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-brand-subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.8;
    margin-top: -2px;
    color: var(--cs-gray-600);
}

.nav-menu {
    display: flex;
    gap: var(--space-2);
}

.nav-link, .nav-link:visited {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    position: relative;
    color: inherit;
}

    .nav-link::before {
        content: '';
        position: absolute;
        inset: 0;
        background: var(--gradient-primary);
        border-radius: var(--radius-lg);
        opacity: 0;
        transition: opacity var(--transition-normal);
        z-index: -1;
    }

    .nav-link:hover,
    .nav-link[aria-current="page"] {
        color: white;
        text-decoration: none;
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

        .nav-link:hover::before {
            opacity: 1;
        }

/* Modern Main Content */
.main-content {
    flex: 1;
    position: relative;
}

/* Modern Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Modern Sections */
.section {
    padding: var(--space-16) 0;
}

    .section:first-child {
        padding-top: var(--space-24);
    }

/* Modern Cards with Glassmorphism */
.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

    .card[data-surface="dark"],
    .card.dark-surface {
        background: linear-gradient(135deg, rgba(26,54,93,0.9), rgba(49,130,206,0.85));
        color: #f1f5f9;
    }

        .card[data-surface="dark"] h1,
        .card[data-surface="dark"] h2,
        .card[data-surface="dark"] h3,
        .card[data-surface="dark"] h4,
        .card[data-surface="dark"] h5,
        .card[data-surface="dark"] h6,
        .card.dark-surface h1,
        .card.dark-surface h2,
        .card.dark-surface h3 {
            color: #fff;
        }

    .card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    }

    .card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-2xl);
        border-color: rgba(255, 255, 255, 0.3);
    }

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: var(--space-6);
    margin-bottom: var(--space-6);
}

/* Modern Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    margin-bottom: var(--space-4);
    line-height: 1.3;
    font-weight: 600;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    -webkit-background-clip: text;
    /* -webkit-text-fill-color: transparent;  Uncomment if you want gradient-filled headings */
    background-clip: text;
    line-height: 1.1;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
}

p {
    line-height: 1.7;
    color: var(--cs-gray-600);
    margin-bottom: var(--space-4);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--cs-gray-500);
}

/* Modern Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    border: none;
    border-radius: var(--radius-xl);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

    .btn:focus-visible {
        outline: none;
        box-shadow: var(--focus-ring);
    }

    .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }

    .btn:hover::before {
        left: 100%;
    }

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

    .btn-primary:focus-visible {
        box-shadow: 0 0 0 3px rgba(26,54,93,0.4);
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-xl);
        color: #fff;
        text-decoration: none;
    }

.btn-secondary {
    background: var(--cs-gray-200);
    color: var(--cs-gray-800);
    border: 1px solid var(--cs-gray-300);
    box-shadow: var(--shadow-sm);
}

    .btn-secondary:hover {
        background: var(--cs-gray-300);
    }

    .btn-secondary:focus-visible {
        box-shadow: var(--focus-ring);
    }

/* Bootstrap-compatible outline buttons */
.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--cs-secondary);
    color: var(--cs-secondary);
    box-shadow: var(--shadow-sm);
}

    .btn-outline-primary:hover {
        background: var(--cs-secondary);
        border-color: var(--cs-secondary);
        color: #ffffff !important;
        text-decoration: none;
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .btn-outline-primary:focus-visible {
        box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.25);
    }

.btn-outline-danger {
    background: transparent;
    border: 2px solid var(--cs-danger);
    color: var(--cs-danger);
    box-shadow: var(--shadow-sm);
}

    .btn-outline-danger:hover {
        background: var(--cs-danger);
        border-color: var(--cs-danger);
        color: #ffffff !important;
        text-decoration: none;
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .btn-outline-danger:focus-visible {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
    }

.btn-success {
    background: linear-gradient(135deg, var(--cs-success) 0%, #059669 100%);
    color: #ffffff;
    box-shadow: var(--shadow-lg);
}

    .btn-success:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-xl);
        color: #ffffff;
        text-decoration: none;
    }

    .btn-success:focus-visible {
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    }

/* Outline (light on dark) */
.btn-outline {
    background: transparent;
    border: 2px solid var(--outline-border-dark);
    color: var(--cs-primary);
}

    .btn-outline:hover {
        background: var(--cs-primary);
        color: #fff;
    }

.card[data-surface="dark"] .btn-outline,
.dark-surface .btn-outline {
    border-color: var(--outline-border);
    color: #fff;
}

    .card[data-surface="dark"] .btn-outline:hover,
    .dark-surface .btn-outline:hover {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }

/* White CTA on gradients */
.btn-invert {
    background: #fff;
    color: var(--btn-text-dark);
}

    .btn-invert:hover {
        filter: brightness(.92);
    }

/* Ensure contrast on hero buttons forcing white border */
.hero .btn-outline {
    border-color: #fff;
    color: #fff;
}

    .hero .btn-outline:hover {
        background: rgba(255,255,255,0.15);
    }

/* Icon alignment inside buttons */
.btn i.fa, .btn i.fab, .btn i.fas, .btn i.far, .btn i.fal, .btn i.fad, .btn i.fat {
    font-size: inherit;
}

/* Modern Forms */
.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    color: var(--cs-gray-700);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: var(--space-4);
    border: 1.5px solid var(--cs-gray-300);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all var(--transition-normal);
    background: #ffffff;
    border-color: var(--cs-gray-300);
    backdrop-filter: blur(10px);
}

    .form-control:focus {
        outline: none;
        border-color: var(--cs-primary);
    }

    .form-control::placeholder {
        color: var(--cs-gray-400);
    }

/* Modern Grid System */
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.col-md-4 {
    grid-column: span 1;
}

.col-md-6 {
    grid-column: span 1;
}

.col-md-8 {
    grid-column: span 2;
}

/* Modern Footer */
.footer {
    background: var(--cs-gray-900);
    color: var(--cs-gray-300);
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

    .footer::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--cs-gray-700), transparent);
    }

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-16) var(--space-6) var(--space-8);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-section h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: var(--space-4);
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: var(--space-2);
}

.footer-section a {
    color: var(--cs-gray-400);
    text-decoration: none;
    transition: color var(--transition-normal);
}

    .footer-section a:hover {
        color: var(--cs-accent-light);
    }

.footer-bottom {
    border-top: 1px solid var(--cs-gray-800);
    padding-top: var(--space-6);
    text-align: center;
    color: var(--cs-gray-500);
}

/* Modern Hero Section */
.hero {
    padding: var(--space-24) 0;
    background: var(--gradient-hero);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

    .hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'%3E%3Cpath d='m0 40 40-40h-40z'/%3E%3C/g%3E%3C/svg%3E");
        z-index: 0;
    }

    .hero > * {
        position: relative;
        z-index: 1;
    }

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* Modern Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: var(--space-4);
        padding: var(--space-4);
    }

    .nav-menu {
        gap: var(--space-3);
        flex-wrap: wrap;
        justify-content: center;
    }

    .container {
        padding: 0 var(--space-4);
    }

    .section {
        padding: var(--space-12) 0;
    }

        .section:first-child {
            padding-top: var(--space-16);
        }

    .card {
        padding: var(--space-6);
    }

    .row {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .col-md-4,
    .col-md-6,
    .col-md-8 {
        grid-column: span 1;
    }
}

/* Input group */
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--cs-gray-300);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition-normal);
}

    .input-group:focus-within {
        border-color: var(--cs-primary);
    }

.icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--cs-primary);
    background: rgba(49, 130, 206, 0.1);
}

.select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid var(--cs-gray-300);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

    .select:focus {
        outline: none;
        border-color: var(--cs-primary);
        box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
        background: white;
    }

/* Validation */
.valid.modified:not([type=checkbox]) {
    border-color: var(--cs-success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.invalid {
    border-color: var(--cs-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.validation-message {
    color: var(--cs-danger);
    font-size: 0.875rem;
    margin-top: var(--space-1);
    font-weight: 500;
}

/* Blazor error styles */
.blazor-error-boundary {
    background: var(--cs-danger);
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-16);
    color: white;
    border-radius: var(--radius-lg);
    margin: var(--space-4);
    box-shadow: var(--shadow-lg);
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* Modern Error UI */
#blazor-error-ui {
    background: var(--cs-danger);
    bottom: 0;
    box-shadow: var(--shadow-2xl);
    display: none;
    left: 0;
    padding: var(--space-4) var(--space-6);
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: var(--space-4);
        top: var(--space-4);
        padding: var(--space-2);
        border-radius: var(--radius-sm);
        transition: background-color var(--transition-fast);
    }

        #blazor-error-ui .dismiss:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

/* --- Page Title Fix: Remove unintended box around main heading --- */
.section-header h1 {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: none; /* keep text standard (gradient optional above) */
    display: inline-block; /* ensure no full-width border artifacts */
    padding: 0; /* reset any padding that might show a border from parent */
}

/* If a global focus style is applied via :focus-visible accidentally to headings, neutralize it */
h1:focus, h1:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Ensure container around heading does not supply a border intended for inputs */
.section-header {
    border: none !important;
}

