/*
 * CoachCentral base styles. Notion-inspired warm-neutral palette; see
 * CoachCentralTheme.cs for the canonical token values. This file harmonizes
 * the Bootstrap CSS (still loaded for form controls and the .btn family)
 * with the MudBlazor theme so the two don't fight each other visually.
 */

:root {
    --cc-bg: #F7F6F3;
    --cc-surface: #FFFFFF;
    --cc-surface-2: #F1F1EF;
    --cc-border: #E9E9E7;
    --cc-border-strong: #D9D8D5;
    --cc-text: #37352F;
    --cc-text-muted: #787774;
    --cc-text-faint: #B5B3AE;
    --cc-accent: #2383E2;
    --cc-accent-soft: #E7F2FC;
    /* On-brand text color (computed for the default --cc-accent;
       the BrandedSurface wrapper overrides on public surfaces with
       a luminance-correct value for the chosen brand color). */
    --cc-accent-on: #FFFFFF;
    --cc-accent-tint: #E7F2FC;
    /* Default button radius — public surfaces can override via the
       BrandedSurface wrapper based on Tenant.ButtonStyle. */
    --cc-button-radius: 0.5rem;
    /* Brand: warm rust / terracotta. Used sparingly — wordmark, hero callouts,
       and small accents. Distinct enough from --cc-warning that they don't
       confuse each other in context. */
    --cc-brand: #D97757;
    --cc-brand-soft: #F7E5DC;
    --cc-success: #448361;
    --cc-warning: #C67B5C;
    --cc-error: #B4524A;
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--cc-text);
    background-color: var(--cc-bg);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

h1 { font-size: 2rem;     line-height: 1.25; }
h2 { font-size: 1.625rem; line-height: 1.3; }
h3 { font-size: 1.35rem;  line-height: 1.35; }
h4 { font-size: 1.175rem; line-height: 1.4; }

a, .btn-link {
    color: var(--cc-accent);
    text-decoration: none;
}

a:hover, .btn-link:hover {
    text-decoration: underline;
}

/* Bootstrap button overrides — warm palette, soft borders, no harsh
   gradient. We aim for "subtle but tactile." */
.btn {
    font-weight: 500;
    border-radius: 6px;
    padding: 0.4rem 0.85rem;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-primary {
    color: #fff;
    background-color: var(--cc-accent);
    border-color: var(--cc-accent);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #1A6FC1;
    border-color: #1A6FC1;
    color: #fff;
}

.btn-outline-primary {
    color: var(--cc-accent);
    border-color: var(--cc-border-strong);
    background-color: var(--cc-surface);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--cc-accent-soft);
    border-color: var(--cc-accent);
    color: var(--cc-accent);
}

.btn-outline-secondary {
    color: var(--cc-text);
    border-color: var(--cc-border-strong);
    background-color: var(--cc-surface);
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: var(--cc-surface-2);
    border-color: var(--cc-border-strong);
    color: var(--cc-text);
}

.btn-outline-danger {
    color: var(--cc-error);
    border-color: var(--cc-border-strong);
    background-color: var(--cc-surface);
}

.btn-outline-danger:hover, .btn-outline-danger:focus {
    background-color: #FBEEEC;
    border-color: var(--cc-error);
    color: var(--cc-error);
}

.btn-link {
    text-decoration: none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.18);
    outline: none;
}

/* Form controls — Notion's input style is flat and quiet, no heavy chrome. */
.form-control, .form-select {
    background-color: var(--cc-surface);
    border-color: var(--cc-border-strong);
    color: var(--cc-text);
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--cc-accent);
    background-color: var(--cc-surface);
    color: var(--cc-text);
}

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

.form-label {
    color: var(--cc-text);
    font-weight: 500;
    margin-bottom: 0.35rem;
}

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

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

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

/* MudBlazor Outlined papers default to a darker rgba border. Soften to our
   token so cards don't feel walled-off from the page. */
.mud-paper-outlined {
    border-color: var(--cc-border) !important;
}

.mud-table thead th {
    color: var(--cc-text-muted);
    font-weight: 500;
    background-color: var(--cc-surface);
    border-bottom: 1px solid var(--cc-border) !important;
}

.mud-table-cell {
    border-bottom-color: var(--cc-border) !important;
}

.mud-table-row:hover {
    background-color: var(--cc-bg) !important;
}

/* MudAlert: tone the backgrounds down so they're informational rather than
   shouty. Material's defaults are saturated; we want Notion-like callouts. */
.mud-alert-filled-success { background-color: #E8F1EC !important; color: var(--cc-success) !important; }
.mud-alert-filled-warning { background-color: #F7EBE3 !important; color: var(--cc-warning) !important; }
.mud-alert-filled-error   { background-color: #F7E5E2 !important; color: var(--cc-error) !important; }
.mud-alert-filled-info    { background-color: var(--cc-accent-soft) !important; color: var(--cc-accent) !important; }

.mud-alert-filled-success .mud-alert-icon,
.mud-alert-filled-warning .mud-alert-icon,
.mud-alert-filled-error .mud-alert-icon,
.mud-alert-filled-info .mud-alert-icon {
    color: inherit !important;
}

.content {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--cc-success);
}

.invalid {
    outline: 1px solid var(--cc-error);
}

.validation-message {
    color: var(--cc-error);
}

.blazor-error-boundary {
    background-color: var(--cc-error);
    color: #fff;
    padding: 1rem 1rem 1rem 3.7rem;
}

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

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

/* Booking slot button. Plain anchor that looks like a button — used in
   both the public booking flow and the client portal slot picker so the
   two surfaces stay visually consistent. Stacks a small "coach: X" line
   under the primary time when the visitor's TZ differs from the coach's. */
.bk-slot-btn {
    display: inline-flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 0.3rem 0.8rem; min-width: 5rem;
    border: 1px solid var(--cc-accent); border-radius: 4px;
    color: var(--cc-accent); background: transparent;
    font-size: 0.9rem; font-weight: 500; line-height: 1.2;
    text-decoration: none; cursor: pointer;
    font-variant-numeric: tabular-nums;
}
.bk-slot-btn:hover { background: var(--cc-accent-soft); }
.bk-slot-time { font-weight: 600; }
.bk-slot-coach-time {
    font-size: 0.7rem; font-weight: 400;
    opacity: 0.6; margin-top: 0.15rem;
    white-space: nowrap;
}

/* Subtle, warm scrollbars to match the canvas. */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--cc-border); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: var(--cc-border-strong); }

/* Course-authored content (Lesson.ContentHtml + Course.DescriptionHtml).
   Apply `.course-content` to any container that renders the
   sanitizer-cleaned TipTap output — the editor + the client player
   stay visually consistent. See docs/COURSES.md. */
.course-content :where(h2, h3) { margin-top: 1.25rem; }
.course-content img { max-width: 100%; height: auto; }
.course-content hr {
    border: 0; border-top: 2px solid var(--cc-border);
    margin: 1.5rem 0;
}
.course-content mark {
    background-color: #fff3a3;
    padding: 0.05rem 0.1rem;
    border-radius: 2px;
}
/* Task lists — pointer-events: none on the checkbox label so the
   v3 player renders them as static markers. v2 will wire interactive
   completion via a separate rendering path. */
.course-content ul[data-type="taskList"] {
    list-style: none; padding-left: 0;
}
.course-content ul[data-type="taskList"] li {
    display: flex; align-items: flex-start; gap: 0.5rem;
}
.course-content ul[data-type="taskList"] li > label {
    flex-shrink: 0; margin-top: 0.3rem; pointer-events: none;
}
.course-content ul[data-type="taskList"] li > div { flex-grow: 1; }
.course-content ul[data-type="taskList"] li > div > p { margin: 0; }
/* Tables — match the editor styling. */
.course-content table {
    border-collapse: collapse; margin: 0.75rem 0;
    width: 100%; table-layout: fixed;
}
.course-content table td, .course-content table th {
    border: 1px solid var(--cc-border);
    padding: 0.4rem 0.5rem; vertical-align: top;
}
.course-content table th {
    background: var(--cc-bg);
    font-weight: 600;
}
