﻿:root {
    --background: 0 0% 98%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 231 65% 38%;
    --primary-foreground: 0 0% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 231 65% 38%;
    --radius: 0.75rem;
}

.dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 231 65% 55%;
    --primary-foreground: 0 0% 98%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 231 65% 55%;
}

* {
    border-color: hsl(var(--border));
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: antialiased;
}

/* FocusOnNavigate programmatically focuses h1 after navigation — hide the browser outline */
h1:focus-visible,
h2:focus-visible,
h3:focus-visible {
    outline: none;
}

/* ── BlazorBlueprint destructive color overrides ───────────────────── */
/* BB's compiled CSS references var(--destructive) directly as a color.
   The inline <style> provides raw HSL components (e.g. "0 84.2% 60.2%")
   for Tailwind CDN's hsl() wrapper. Raw components alone are not valid
   CSS colors, so we re-declare every BB selector with an hsl() wrap.   */
.text-destructive {
    color: hsl(var(--destructive));
}
.text-destructive-foreground {
    color: hsl(var(--destructive-foreground));
}
.border-destructive {
    border-color: hsl(var(--destructive));
}
.bg-destructive {
    background-color: hsl(var(--destructive));
}
/* BB form-field: red text when peer input is invalid */
.peer-aria-\[invalid\=true\]\:text-destructive:is(:where(.peer)[aria-invalid=true]~*) {
    color: hsl(var(--destructive));
    font-size: 0.75rem;
    line-height: 1rem;
}
/* BB form-field: red border on invalid inputs */
.aria-\[invalid\=true\]\:border-destructive[aria-invalid=true] {
    border-color: hsl(var(--destructive));
}
/* BB input-group: red border when child control is invalid */
.has-\[\[data-slot\=input-group-control\]\[aria-invalid\=true\]\]\:border-destructive:has([data-slot=input-group-control][aria-invalid=true]) {
    border-color: hsl(var(--destructive));
}
/* BB data-invalid text */
.data-\[invalid\=true\]\:text-destructive[data-invalid=true] {
    color: hsl(var(--destructive));
}
/* BB popover (dropdowns, command menus, etc.) */
.bg-popover {
    background-color: hsl(var(--popover));
}
.text-popover-foreground {
    color: hsl(var(--popover-foreground));
}
.focus-within\:bg-popover:focus-within {
    background-color: hsl(var(--popover));
}

/* ── Shared input base style ────────────────────────── */
.input-base {
    display: flex;
    height: 2.5rem;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid hsl(var(--input));
    background-color: hsl(var(--background));
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}
.input-base::placeholder {
    color: hsl(var(--muted-foreground));
}
.input-base:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

/* ── Form error states (custom validation) ─────────── */
.input-error {
    border-color: hsl(var(--destructive)) !important;
}
.input-error:focus-visible,
.input-error:focus {
    --tw-ring-color: hsl(var(--destructive)) !important;
    border-color: hsl(var(--destructive)) !important;
}
.field-error,
.validation-message {
    color: hsl(var(--destructive));
    font-size: 0.75rem;
    line-height: 1rem;
    margin-top: 0.375rem;
}

/* Rich text content from BbRichTextEditor (sanitized HTML) */
.rich-text-content { overflow-wrap: break-word; }
.rich-text-content p { margin-bottom: 1rem; }
.rich-text-content p:last-child { margin-bottom: 0; }
.rich-text-content ul, .rich-text-content ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.rich-text-content ul { list-style-type: disc; }
.rich-text-content ol { list-style-type: decimal; }
.rich-text-content strong, .rich-text-content b { font-weight: 600; }
.rich-text-content blockquote {
    border-left: 3px solid hsl(var(--border));
    padding-left: 1rem;
    margin-bottom: 1rem;
    font-style: italic;
}
.rich-text-content h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }
.rich-text-content h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.rich-text-content h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }

/* ── Mobile-collapsible sections (listing profile) ─────── */
/* Toggle button visible only on mobile */
.mobile-collapse-toggle {
    display: flex;
}
.mobile-collapse-toggle .collapse-chevron {
    transition: transform 0.2s;
}
/* Content hidden on mobile by default */
.mobile-collapse-content {
    display: none;
}
/* When checkbox is checked, show content + rotate chevron */
.mobile-collapse-state:checked ~ .mobile-collapse-toggle .collapse-chevron {
    transform: rotate(180deg);
}
.mobile-collapse-state:checked ~ .mobile-collapse-content {
    display: block;
}
@media (min-width: 768px) {
    .mobile-collapse-toggle {
        pointer-events: none;
    }
    .mobile-collapse-toggle .collapse-chevron {
        display: none;
    }
    .mobile-collapse-content {
        display: block;
    }
}
