@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/*
 * "onco" theme — Lumo restyled with Material Design 3 tokens. Vaadin 25 dropped the built-in
 * Material theme, so we map MD3 colours, shape and typography onto Lumo's CSS custom properties.
 */
html {
  /* MD3 system colour tokens */
  --md-sys-color-primary: #5B6BFF;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-surface: #F8F9FF;
  --md-sys-color-surface-container: #ECEEFF;
  --md-sys-color-surface-container-high: #E2E4F5;
  --md-sys-color-on-surface: #1A1C2E;
  --md-sys-color-outline: #C5C7DE;

  /* MD3 primary (light scheme) */
  --lumo-primary-color: #6750a4;
  --lumo-primary-color-50pct: rgba(103, 80, 164, 0.5);
  --lumo-primary-color-10pct: rgba(103, 80, 164, 0.12);
  --lumo-primary-text-color: #6750a4;
  --lumo-primary-contrast-color: #ffffff;

  --lumo-error-color: #b3261e;
  --lumo-success-color: #146c2e;

  /* Surfaces / background */
  --lumo-base-color: #fffbfe;
  --lumo-shade-5pct: rgba(29, 27, 32, 0.05);
  --lumo-shade-10pct: rgba(29, 27, 32, 0.08);
  --lumo-body-text-color: #1d1b20;
  --lumo-secondary-text-color: #49454f;

  /* MD3 shape — generous rounding */
  --lumo-border-radius-s: 8px;
  --lumo-border-radius-m: 12px;
  --lumo-border-radius-l: 16px;

  /* Typography */
  --lumo-font-family: 'Roboto', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Softer Material-like elevation */
  --lumo-box-shadow-s: 0 1px 2px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  --lumo-box-shadow-m: 0 2px 6px rgba(0, 0, 0, 0.14), 0 1px 2px rgba(0, 0, 0, 0.10);
}

/* App bar / drawer Material accent */
[slot='navbar'] {
  background: var(--lumo-primary-color);
  color: var(--lumo-primary-contrast-color);
}

vaadin-app-layout::part(navbar) {
  background: var(--lumo-primary-color);
  color: var(--lumo-primary-contrast-color);
  box-shadow: var(--lumo-box-shadow-s);
}

vaadin-button,
a {
  cursor: pointer;
}

vaadin-button[theme~='primary'] {
  border-radius: 20px;
}

vaadin-grid {
  --lumo-border-radius-m: 8px;
}

/* MD3 grid rows — no alternating row colour, subtle hover */
vaadin-grid::part(even-row-cell),
vaadin-grid::part(odd-row-cell) {
  background: transparent;
}
vaadin-grid::part(row):hover > td,
vaadin-grid::part(row):hover vaadin-grid-cell-content {
  background: var(--md-sys-color-surface-container-high);
}

/* Actions column — keep a solid white background, even on hover / when frozen */
vaadin-grid::part(actions-cell) {
  background: #ffffff !important;
}

/* Onboarding wizard — fixed header/footer bars are a single line tall; on narrow
   viewports the extra copy wraps and spills out of the fixed-height bar, so trim it. */
@media (max-width: 480px) {
  .hc-onboarding-header,
  .hc-onboarding-footer {
    padding: 0 var(--lumo-space-m) !important;
  }

  .hc-signin-prompt,
  .hc-copyright-suffix {
    display: none;
  }
}

/* Dashboard — the 240px navigation rail is always in the layout flow and eats
   most of the screen on a phone. Below the breakpoint it becomes an off-canvas
   drawer toggled by the hamburger button, with a backdrop to dismiss it. */
.app-hamburger {
  display: none;
}

.app-sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .app-hamburger {
    display: flex !important;
  }

  .app-username {
    display: none;
  }

  .app-sidebar {
    position: fixed;
    top: 64px;
    bottom: 0;
    left: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .app-sidebar-backdrop.open {
    display: block;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 150;
  }

  /* Profile page — the fixed 280px side column doesn't fit next to the main
     column on a phone; stack them instead. */
  .profile-body {
    flex-direction: column !important;
  }

  .profile-side {
    width: 100% !important;
  }
}

/* "Find other doctors" home card — subtle lift on hover to hint it's clickable. */
.find-doctors-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  transform: translateY(-1px);
}

/* Doctor search — Apple Spotlight-style modal: frameless, anchored near the top of the
   viewport instead of Vaadin's default vertical centering, with a soft scale/fade-in. */
vaadin-dialog-overlay[theme~='spotlight'] {
  align-items: flex-start;
}

vaadin-dialog-overlay[theme~='spotlight']::part(overlay) {
  margin-top: 12vh;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: spotlight-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

vaadin-dialog-overlay[theme~='spotlight']::part(content) {
  padding: 0;
}

vaadin-dialog-overlay[theme~='spotlight']::part(backdrop) {
  background: rgba(20, 20, 30, 0.45);
  backdrop-filter: blur(2px);
}

@keyframes spotlight-in {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Borderless, larger search bar inside the spotlight dialog. */
vaadin-text-field[theme~='spotlight-input']::part(input-field) {
  border: none;
  box-shadow: none;
  background: transparent;
  font-size: 1.15rem;
  padding-left: 0;
}

div[theme~='spotlight-result'] {
  width: 100%;
  transition: background .12s ease;
}

div[theme~='spotlight-result']:hover {
  background: var(--md-sys-color-surface-container-high);
}
