/* ═══════════════════════════════════════════════════════════════
   Cultivate Homeschool Community — Global Styles
   Colors derived from the brand logo badge and website navigation
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties (from logo badge + nav bar) ── */
:root {
    /* Logo badge colors (top → bottom) */
    --cultivate-peach: #E4B5A0;
    --cultivate-peach-light: #F0D5C8;
    --cultivate-copper: #C08B6A;
    --cultivate-copper-dark: #A06F50;
    --cultivate-teal: #57A199;
    --cultivate-teal-dark: #3D7A73;
    --cultivate-teal-light: #7DBDB7;

    /* Primary = teal, Secondary = copper */
    --cultivate-primary: var(--cultivate-teal);
    --cultivate-primary-dark: var(--cultivate-teal-dark);
    --cultivate-secondary: var(--cultivate-copper);

    /* Navigation / dark */
    --cultivate-dark: #17252A;
    --cultivate-dark-light: #1E3038;

    /* Neutrals */
    --cultivate-light-bg: #F5FAFD;
    --cultivate-warm-bg: #FBF8F6;
    --cultivate-body-text: #46707F;
    --cultivate-heading-text: #17252A;
    --cultivate-card-border: #E0E1E1;
    --cultivate-radius: 5px;
    --cultivate-transition: 0.3s ease;
}

/* ── Base ── */
html, body {
    font-family: 'Open Sans', Helvetica, Arial, sans-serif;
    color: var(--cultivate-body-text);
    background-color: var(--cultivate-light-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--cultivate-heading-text);
}

h1, h2, h3 {
    font-weight: 300;
}

h4, h5, h6 {
    font-weight: 600;
}

a {
    color: var(--cultivate-primary);
    text-decoration: none;
    transition: color var(--cultivate-transition);
}

a:hover {
    color: var(--cultivate-primary-dark);
}

/* ── Blazor Error Boundaries ── */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #4CAF50;
}

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

.validation-message {
    color: #D84315;
    font-size: 0.8rem;
    margin-top: 2px;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiI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gNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--cultivate-radius);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── MudBlazor Component Overrides ── */

/* Cards — soft shadow and hover lift */
.mud-card {
    border: 1px solid var(--cultivate-card-border);
    transition: box-shadow var(--cultivate-transition), transform var(--cultivate-transition);
}

.mud-card:hover {
    box-shadow: 0 10px 20px 2px rgba(87, 161, 153, 0.12) !important;
    transform: translateY(-1px);
}

/* Paper elevation softening */
.mud-paper {
    border-radius: var(--cultivate-radius);
}

/* AppBar text styling */
.mud-appbar .mud-typography {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Navigation — active link with teal highlight */
.mud-nav-item .mud-nav-link.active {
    border-left: 3px solid var(--cultivate-teal);
    background-color: rgba(87, 161, 153, 0.08);
}

.mud-nav-item .mud-nav-link:hover {
    background-color: rgba(87, 161, 153, 0.05);
}

/* Buttons — rounded to 5px */
.mud-button-root {
    border-radius: var(--cultivate-radius) !important;
    transition: all var(--cultivate-transition);
}

/* Chip styling */
.mud-chip {
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Table styling */
.mud-table .mud-table-head .mud-table-cell {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cultivate-body-text);
}

/* Input fields — subtle teal-tinted border */
.mud-input-outlined .mud-input-outlined-border {
    border-color: rgba(87, 161, 153, 0.25) !important;
    border-radius: 8px;
    transition: border-color var(--cultivate-transition);
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: rgba(87, 161, 153, 0.45) !important;
}

.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: var(--cultivate-teal) !important;
}

/* Links in tables */
.mud-table .mud-link {
    font-weight: 500;
}

/* Timeline dots */
.mud-timeline .mud-timeline-item-dot {
    border-radius: 50%;
}

/* Progress bar smoothing */
.mud-progress-linear {
    border-radius: 4px;
}

/* ── Registration-Specific Styles ── */

/* Registration hero section — dark navy with peach accent */
.registration-hero {
    background: linear-gradient(135deg, var(--cultivate-dark) 0%, var(--cultivate-dark-light) 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    margin: -24px -24px 24px -24px;
}

.registration-hero h1,
.registration-hero h2,
.registration-hero h3 {
    color: white;
}

.registration-hero .lead {
    font-size: 1.25rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Registration card styling */
.registration-card {
    border-radius: var(--cultivate-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px 2px rgba(0, 0, 0, 0.1);
}

/* ── Utility Classes ── */
.text-cultivate-teal { color: var(--cultivate-teal) !important; }
.text-cultivate-copper { color: var(--cultivate-copper) !important; }
.text-cultivate-peach { color: var(--cultivate-peach) !important; }
.text-cultivate-dark { color: var(--cultivate-dark) !important; }
.bg-cultivate-light { background-color: var(--cultivate-light-bg) !important; }
.bg-cultivate-warm { background-color: var(--cultivate-warm-bg) !important; }
.bg-cultivate-dark { background-color: var(--cultivate-dark) !important; }
.bg-cultivate-peach { background-color: var(--cultivate-peach-light) !important; }
.bg-cultivate-teal { background-color: var(--cultivate-teal) !important; }

/* Accent underline for section headings — teal */
.section-heading {
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--cultivate-teal);
    border-radius: 2px;
}

.section-heading.centered::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Copper accent line variant */
.accent-line-copper::after {
    background: var(--cultivate-copper);
}

/* ── Mobile / Responsive Overrides ── */

/*
 * Data tables: allow horizontal scroll on narrow screens instead of squishing columns.
 * MudBlazor wraps tables in .mud-table-container; this makes the container scrollable
 * while the table itself keeps its natural width.
 */
.mud-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* MudDataGrid uses a different root element */
.mud-data-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 599.98px) {
    /*
     * Registration hero: the hero uses negative margins (-24px) to bleed edge-to-edge
     * inside the MudContainer's pa-6 padding. On mobile the container uses pa-2 (8px),
     * so reduce the bleed to match.
     */
    .registration-hero {
        margin: -8px -8px 16px -8px;
        padding: 2rem 1.25rem;
    }

    /*
     * Disable the translateY hover-lift animation on touch screens.
     * On mobile a "hover" state can persist after a tap, making cards
     * appear stuck in the lifted position.
     */
    .mud-card:hover {
        transform: none;
        box-shadow: none !important;
    }
}

/* Scrollbar styling — teal tinted */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--cultivate-light-bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(87, 161, 153, 0.25);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(87, 161, 153, 0.45);
}
