/* Force MudAppBar background to primary color */
.custom-appbar-bg {
  background-color: var(--primary) !important;
}
/* Tailwind entry */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Font faces from site.css (company branding) */
@font-face {
  font-family: "DIN Next LT Pro";
  src: url("/fonts/din-next-lt-pro-regular.eot");
  src: url("/fonts/din-next-lt-pro-regular.woff2") format("woff2"),
       url("/fonts/din-next-lt-pro-regular.woff")  format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DIN Next LT Pro";
  src: url("/fonts/din-next-lt-pro-regular.woff2") format("woff2"),
       url("/fonts/din-next-lt-pro-regular.woff")  format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DIN Next LT Pro";
  src: url("/fonts/din-next-lt-pro-regular.woff2") format("woff2"),
       url("/fonts/din-next-lt-pro-regular.woff")  format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DIN Next LT Pro";
  src: url("/fonts/din-next-lt-pro-regular.woff2") format("woff2"),
       url("/fonts/din-next-lt-pro-regular.woff")  format("woff");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DIN Next LT Pro";
  src: url("/fonts/din-next-lt-pro-regular.woff2") format("woff2"),
       url("/fonts/din-next-lt-pro-regular.woff")  format("woff");

  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

/* Tailwind and theme variables (prioritize site.css values) */
@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: "DIN Next LT Pro", ui-sans-serif, system-ui, sans-serif;
  --font-mono: var(--font-geist-mono);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

:root {
  /* Neutrals / Layout */
  --radius: 0.625rem;
  --background: #FAFCFD;
  --foreground: #153344;
  --border: #E6E6E6;
  --input: #E6E6E6;
  --ring: #0A4260;

  /* Surfaces */
  --card: #FAFCFD;
  --card-foreground: #153344;
  --popover: #FAFCFD;
  --popover-foreground: #153344;

  /* Brand */
  --primary: #0A4260;
  --primary-foreground: #FAFCFD;

  --secondary: #99D0CF;
  --secondary-foreground: #011414;

  /* Supporting */
  --muted: #F2F2F2;
  --muted-foreground: #4D4D4D;

  --accent: #D2E8F2;
  --accent-foreground: #0A4260;

  /* Status */
  --destructive: #E3493C;

  /* Charts (optional) */
  --chart-1: #53BD11;
  --chart-2: #FBC727;
  --chart-3: #E3493C;
  --chart-4: #0A4260;
  --chart-5: #99D0CF;

  /* Sidebar */
  --sidebar: #FFFFFF;
  --sidebar-foreground: #153344;
  --sidebar-primary: #0A4260;
  --sidebar-primary-foreground: #FAFDFD;
  --sidebar-accent: #D2E8F2;
  --sidebar-accent-foreground: #153344;
  --sidebar-border: #F2F2F2;
  --sidebar-ring: #0A4260;

  /* Helpful ramps */
  --primary-light: #D2E8F2;
  --primary-dark:  #0C354A;
  --secondary-light: #D9EFEF;
  --secondary-dark:  #60D9DC;

  /* Type sizes */
  --dbi-size-page-header: 25px;
  --dbi-size-card-header: 25px;
  --dbi-size-popup-header: 20px;
  --dbi-size-small-header: 16px;

  --dbi-size-body1: 14px;
  --dbi-size-body2: 12px;
  --dbi-size-link: 14px;
  --dbi-size-label: 14px;
  --dbi-size-micro: 8px;

  /* Line-heights */
  --dbi-lh-page-header: 30px;
  --dbi-lh-card-header: 24px;
  --dbi-lh-popup-header: 24px;
  --dbi-lh-small-header: 20px;

  --dbi-lh-body1: 16px;
  --dbi-lh-body2: 14px;
  --dbi-lh-link: 24px;
  --dbi-lh-label: 24px;
  --dbi-lh-micro: 14px;

  /* Tracking */
  --dbi-track-0: 0em;
  --dbi-track-10pct: 0.1em; /* CardHeader */
}

.dark {
  --background: #1A1A1A;           /* Grey 900 */
  --foreground: #FAFDFD;
  --card: #0C354A;
  --card-foreground: #FAFDFD;
  --popover: #0C354A;
  --popover-foreground: #FAFDFD;

  --border: #2B2B2B;
  --input:  #2B2B2B;
  --ring:   #99D0CF;

  --primary: #99D0CF;
  --primary-foreground: #011414;

  --secondary: #D2E8F2;
  --secondary-foreground: #153344;

  --muted: #262626;
  --muted-foreground: #E6E6E6;

  --accent: #153344;
  --accent-foreground: #FAFDFD;

  --destructive: #951515;

  --sidebar: #0C354A;
  --sidebar-foreground: #FAFDFD;
  --sidebar-primary: #99D0CF;
  --sidebar-primary-foreground: #011414;
  --sidebar-accent: #153344;
  --sidebar-accent-foreground: #FAFDFD;
  --sidebar-border: #2B2B2B;
  --sidebar-ring: #99D0CF;
}

@layer base {
  * {
    border-color: var(--border);
    outline-color: color-mix(in oklch, var(--ring), transparent 50%);
  }
  body {
    background-color: var(--background);
    color: var(--foreground);
  }
}

/* Typography utility classes from site.css */
.ty-page-header{
  font-family: "DIN Next LT Pro", ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
  font-size: var(--dbi-size-page-header);
  line-height: var(--dbi-lh-page-header);
  letter-spacing: var(--dbi-track-0);
}

.ty-card-header{
  font-family: "DIN Next LT Pro", ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  font-size: var(--dbi-size-card-header);
  line-height: var(--dbi-lh-card-header);
  letter-spacing: var(--dbi-track-10pct);
  text-transform: uppercase;
}

.ty-popup-header{
  font-family: "DIN Next LT Pro", ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
  font-size: var(--dbi-size-popup-header);
  line-height: var(--dbi-lh-popup-header);
  letter-spacing: var(--dbi-track-0);
}

.ty-small-header{
  font-weight: 400;
  font-size: var(--dbi-size-small-header);
  line-height: var(--dbi-lh-small-header);
}

.ty-body1{
  font-weight: 400;
  font-size: var(--dbi-size-body1);
  line-height: var(--dbi-lh-body1);
}

.ty-body2{
  font-weight: 400;
  font-size: var(--dbi-size-body2);
  line-height: var(--dbi-lh-body2);
}

.ty-body1-bold{
  font-weight: 700;
  font-size: var(--dbi-size-body1);
  line-height: var(--dbi-lh-body1);
}

.ty-body1-italic{
  font-style: italic;
  font-weight: 400;
  font-size: var(--dbi-size-body1);
  line-height: var(--dbi-lh-body1);
}

.ty-body2-bold{
  font-weight: 700;
  font-size: var(--dbi-size-body2);
  line-height: 24px;
}

.ty-body2-italic{
  font-style: italic;
  font-weight: 400;
  font-size: var(--dbi-size-body2);
  line-height: 24px;
}

.ty-link{
  font-weight: 400;
  font-size: var(--dbi-size-link);
  line-height: var(--dbi-lh-link);
  text-decoration: none;
}
.ty-link:hover{ text-decoration: underline; }

.ty-label{
  font-weight: 400;
  font-size: var(--dbi-size-label);
  line-height: var(--dbi-lh-label);
}

.ty-micro{
  font-weight: 400;
  font-size: var(--dbi-size-micro);
  line-height: var(--dbi-lh-micro);
}

.ty-uppercase { text-transform: uppercase; }
.ty-capitalize { text-transform: capitalize; }
.ty-tight { letter-spacing: -0.01em; }
.ty-wide  { letter-spacing: 0.02em; }

.btn-round { border-radius: 9999px !important; }
.btn-square { border-radius: var(--radius-lg) !important; }
.btn-tonal {
  background-color: var(--primary-light) !important;
  color: var(--foreground) !important;
  border-color: transparent !important;
}
.btn-tonal:hover { filter: brightness(0.97); }

.mud-button, .mud-menu { font-family: "DIN Next LT Pro", ui-sans-serif, system-ui, sans-serif; }

/* =========================================================
   DBI UI — MudBlazor Chat Composer + Controls (Overrides)
   ========================================================= */

/* ---- Buttons -------------------------------------------------- */

/* Base button look */
.mud-button-root {
  font-family: var(--font-sans);
  border-radius: 1.5rem !important; /* more rounded corners for all buttons */
  min-height: 40px;                /* comfortable hit area */
  padding-inline: 14px;
}

/* Primary (Filled) — default for the Send button */
.mud-button-filled-primary {
  background-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
  border-color: transparent !important;
}
.mud-button-filled-primary:hover { filter: brightness(0.97); }
.mud-button-filled-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Outlined + Text variants */
.mud-button-outlined {
  background: transparent !important;
  color: var(--primary) !important;
  border: 1px solid var(--border) !important;
}
.mud-button-outlined:hover {
  background: color-mix(in oklch, var(--primary), transparent 92%);
  border-color: color-mix(in oklch, var(--primary), var(--border) 65%);
}

.mud-button-text {
  background: transparent !important;
  color: var(--primary) !important;
  border-color: transparent !important;
}
.mud-button-text:hover {
  background: color-mix(in oklch, var(--primary), transparent 94%);
}

/* Size → radius mapping */
.mud-button-root.mud-button-sm { border-radius: 8px; }
.mud-button-root.mud-button-md { border-radius: 10px; }
.mud-button-root.mud-button-lg { border-radius: 12px; }

/* Accessible focus rings */
.mud-button-root:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Label + icon spacing */
.mud-button-root .mud-button-label { display: inline-flex; align-items: center; gap: .25rem; }
.mud-icon-root.mud-icon-size-medium { width: 24px; height: 24px; }

/* ---- Inputs (Chat text field) -------------------------------- */

.fa-chat-input,
.mud-input-control {
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--input);
  border-radius: 1.5rem !important; /* more rounded corners for chat input and all inputs */
}

.fa-chat-input:focus-within,
.mud-input-control:focus-within {
  border-color: color-mix(in oklch, var(--ring), white 60%);
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

/* Placeholder color parity */
.mud-input-root input::placeholder,
.mud-input-root textarea::placeholder {
  color: var(--muted-foreground);
  opacity: 1;
}

/* ---- Composer container (Paper) ------------------------------- */

.fa-chat-composer.mud-paper {
  background: var(--card);
  color: var(--card-foreground);
  border-radius: 1.5rem !important;     /* more rounded for chat composer */
  border: 0.5px solid var(--border);    /* subtle divider */
  position: sticky;                     /* from DOM */
  bottom: 0;
  z-index: 1;
  margin-bottom: 8px;
}

.fa-chat-composer.mud-paper:hover {
  background: var(--accent);
}

/* Layout tweaks for the stack row */
.fa-chat-composer .fa-chat-composer-stack {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* matches gap-2 */
}

/* Ensure the Send button doesn’t shrink */
.fa-chat-composer .fa-chat-send-btn { flex: 0 0 auto; }

/* ---- Overlays (dialogs, menus) -------------------------------- */

.mud-overlay {
  background: rgba(230, 230, 230, 0.8);
  backdrop-filter: blur(2px);
}

/* ---- Dividers / borders --------------------------------------- */

.mud-divider,
hr { border-color: var(--border); }

/* ---- Typography application to Mud components ----------------- */

.mud-button,
.mud-menu,
.mud-typography,
.mud-input-root,
.mud-paper {
  font-family: "DIN Next LT Pro", ui-sans-serif, system-ui, sans-serif;
}

/* Stronger selectors for MudAlert (covers border & inner message) */
.mud-alert.mud-alert-filled-info,
.mud-alert.mud-alert-filled-default {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--accent-foreground) !important;
}
.mud-alert.mud-alert-filled-info .mud-alert-message,
.mud-alert.mud-alert-filled-default .mud-alert-message {
  color: var(--accent-foreground) !important;
}
.mud-alert.mud-alert-filled-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
}
.mud-alert.mud-alert-filled-primary .mud-alert-message {
  color: var(--primary-foreground) !important;
}

/* Targeted brand alert style used in FeedbackDialog header */
.brand-alert {
  background-color: var(--accent) !important;
  color: var(--accent-foreground) !important;
  border-color: var(--accent) !important;
}
.brand-alert .mud-alert-message,
.brand-alert .mud-alert-icon { color: var(--accent-foreground) !important; }

/* Disable hover/focus highlight only for the feedback fields */
.no-hover .mud-input-root:hover,
.no-hover .mud-input-root:focus-within {
    box-shadow: none !important;
    outline: none !important;
}

.no-hover .mud-input-outlined:hover .mud-notched-outline,
.no-hover .mud-input-outlined.mud-input-focused .mud-notched-outline {
    border-color: var(--mud-palette-lines-default) !important;
    box-shadow: none !important;
}
/* ---- Consistent rounding for MudAlert and its inner parts ---- */
.mud-alert,
.mud-alert-message {
  border-radius: var(--radius-lg) !important;
}
/* Removes the hover/focus box highlight for feedback inputs only */
.feedback-input .mud-input-root:hover,
.feedback-input .mud-input-root:focus-within {
    box-shadow: none !important;
    outline: none !important;
}

/* Removes the outer gray square/outline (outlined variant) */
.feedback-input .mud-input-outlined:hover .mud-notched-outline,
.feedback-input .mud-input-outlined.mud-input-focused .mud-notched-outline {
    border-color: var(--mud-palette-lines-default) !important;
    box-shadow: none !important;
}

/* Optional: keep border static and subtle */
.feedback-input .mud-input-outlined .mud-notched-outline {
    border-color: var(--mud-palette-lines-default);
}
/* Kill the global input wrapper border/outline just for these two fields */
.feedback-input.mud-input-control,
.feedback-input.mud-input-control:hover,
.feedback-input.mud-input-control:focus-within {
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

/* Keep the outlined variant from adding its own hover/focus ring */
.feedback-input .mud-input-outlined:hover .mud-notched-outline,
.feedback-input .mud-input-outlined.mud-input-focused .mud-notched-outline {
  border-color: var(--mud-palette-lines-default) !important;
  box-shadow: none !important;
}
.fa-chat-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* Optional but helps prevent the page (body) from scrolling instead */
  overflow: hidden;
}

.fa-scroll {
  flex: 1 1 auto;
  /* THIS is the key line */
  min-height: 0;           /* allow the flex child to actually shrink and scroll */
  overflow: auto;
}

/* DBI-logo overlay: skjules på smalle skærme, hvor det ellers ligger oven på
   send-knappen (z-index 1000) og blokerer tryk. Overlappet opstår teknisk op
   til ~1264px viewport-bredde (centreret 960px-indhold + 152px logo-zone).
   Rent dekorativt branding-element. */
@media (max-width: 1280px) {
  .dbi-logo-overlay { display: none !important; }
}
