/* ════════════════════════════════════════════════════════
   Briarcliff STEM Academy — APPLE-INSPIRED LIGHT THEME
   ════════════════════════════════════════════════════════ */

:root {
    --bg:              #f5f5f7;
    --bg-white:        #ffffff;
    --surface:         #ffffff;
    --surface-2:       #f5f5f7;

    --text:            #1d1d1f;
    --text-secondary:  #6e6e73;
    --text-tertiary:   #aeaeb2;

    --accent:          #0071e3;
    --accent-hover:    #0064c8;
    --accent-light:    rgba(0, 113, 227, 0.10);

    --border:          rgba(0, 0, 0, 0.08);
    --border-strong:   rgba(0, 0, 0, 0.15);

    --shadow-sm:       0 1px 3px rgba(0,0,0,0.07);
    --shadow:          0 2px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg:       0 8px 32px rgba(0,0,0,0.09), 0 2px 8px rgba(0,0,0,0.05);

    --radius-sm:       6px;
    --radius:          10px;
    --radius-lg:       14px;

    --font-body:       'Roboto', sans-serif;
    --font-heading:    'Montserrat', sans-serif;
    --font-mono:       'JetBrains Mono', monospace;

    --nav-height:      104px;
}

/* ── Reset / Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    min-height: 100%;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text);
    margin-top: 0;
    line-height: 1.2;
    border: none;
    outline: none;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.15s;
}

a:hover { opacity: 0.75; }

/* ── Main Layout Navbar ───────────────────────────────── */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    height: var(--nav-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}

.main-nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.main-nav-toggle-input { display: none; }

.main-nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.main-nav-hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

.main-nav-toggle-input:checked ~ .main-nav-hamburger span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.main-nav-toggle-input:checked ~ .main-nav-hamburger span:nth-child(2) {
    opacity: 0;
}
.main-nav-toggle-input:checked ~ .main-nav-hamburger span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.main-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.main-nav-link {
    font-family: var(--font-body);
    font-size: 1.68rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.8rem 1.7rem;
    border-radius: 980px;
    transition: color 0.15s, background 0.15s;
}

.main-nav-link:hover {
    color: var(--text);
    background: rgba(0,0,0,0.04);
    opacity: 1;
}

.main-nav-link.active {
    color: var(--text);
    background: rgba(0,0,0,0.06);
    font-weight: 500;
}

/* ── Main Content ─────────────────────────────────────── */
.main-content {
    background: var(--bg);
    min-height: calc(100vh - var(--nav-height));
}

.content {
    padding: 2rem 2.5rem;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-family: var(--font-body);
    font-weight: 500;
    border-radius: 980px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: white;
    box-shadow: none;
}

.btn:focus, .btn:active:focus {
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.28);
}

/* ── Forms ────────────────────────────────────────────── */
input[type="email"],
input[type="password"],
input[type="text"],
textarea,
select {
    background: var(--bg) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18) !important;
    outline: none;
    background: var(--bg-white) !important;
}

input::placeholder { color: var(--text-tertiary) !important; }

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ── Validation ───────────────────────────────────────── */
.valid.modified:not([type=checkbox]) { outline: 1px solid #34c759; }
.invalid { outline: 1px solid #ff3b30; }
.validation-message { color: #ff3b30; font-size: 0.8rem; margin-top: 0.25rem; }

/* ── Blazor Error UI ──────────────────────────────────── */
#blazor-error-ui {
    display: none;
    background: white;
    border-top: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.blazor-error-boundary {
    background: #fff5f5;
    border: 1px solid rgba(255,59,48,0.2);
    color: var(--text);
    padding: 1rem;
    border-radius: var(--radius);
}

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

/* ── List Group ───────────────────────────────────────── */
.list-group-item {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
    transition: background 0.12s;
}

.list-group-item:hover { background: var(--bg) !important; }
.list-group-item-action:focus { background: var(--bg) !important; outline: none; }

/* ── Misc Bootstrap overrides ─────────────────────────── */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--text-tertiary);
    text-align: end;
}

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

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

/* ── Mobile / Responsive ──────────────────────────────── */
@media (max-width: 640px) {
    .main-nav {
        padding: 0 1.25rem;
    }

    .main-nav-hamburger {
        display: flex;
    }

    .main-nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.5rem 1.5rem;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        gap: 0.4rem;
    }

    .main-nav-toggle-input:checked ~ .main-nav-links {
        display: flex;
    }

    .main-nav-link {
        text-align: center;
        border-radius: 12px;
        font-size: 1.1rem;
        padding: 0.75rem;
    }

    .content {
        padding: 1.25rem 1rem;
    }
}
