/* =====================================================
   FAIR Data Station – Global Theme (Vaadin 25)
   ===================================================== */

/* Lumo compact preset — reduces component sizes to web-standard proportions */
:root,
:host {
  --lumo-size-xl: 3rem;
  --lumo-size-l: 2.5rem;
  --lumo-size-m: 2rem;
  --lumo-size-s: 1.75rem;
  --lumo-size-xs: 1.5rem;
  --lumo-font-size: 1rem;
  --lumo-font-size-xxxl: 1.75rem;
  --lumo-font-size-xxl: 1.375rem;
  --lumo-font-size-xl: 1.125rem;
  --lumo-font-size-l: 1rem;
  --lumo-font-size-m: 0.875rem;
  --lumo-font-size-s: 0.8125rem;
  --lumo-font-size-xs: 0.75rem;
  --lumo-font-size-xxs: 0.6875rem;
  --lumo-line-height-m: 1.4;
  --lumo-line-height-s: 1.2;
  --lumo-line-height-xs: 1.1;
  --lumo-space-xl: 1.875rem;
  --lumo-space-l: 1.25rem;
  --lumo-space-m: 0.625rem;
  --lumo-space-s: 0.3125rem;
  --lumo-space-xs: 0.1875rem;
}

html {
  /* Brand colours */
  --lumo-primary-color: #2563eb;
  --lumo-primary-color-50pct: rgba(37, 99, 235, 0.5);
  --lumo-primary-color-10pct: rgba(37, 99, 235, 0.1);
  --lumo-primary-text-color: #1e293b;
  --lumo-primary-contrast-color: #ffffff;

  /* Drawer */
  --vaadin-app-layout-drawer-width: 220px;
  --fairds-sidebar-bg: #0f172a;
  --fairds-sidebar-text: rgba(255, 255, 255, 0.7);
  --fairds-sidebar-text-hover: #ffffff;
  --fairds-sidebar-accent: #3b82f6;
}

/* ---- Header ---- */
#header {
  height: 60px;
  padding: 0 1rem;
  background: var(--lumo-base-color);
  border-bottom: 1px solid var(--lumo-contrast-10pct);
}

#header h1 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--lumo-header-text-color);
  margin: 0;
}

/* ---- Drawer content ---- */
.drawer-layout {
  background: var(--fairds-sidebar-bg);
  height: 100%;
}

#logo {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#logo img {
  height: 36px;
  max-width: 160px;
  object-fit: contain;
}

/* ---- Menu tabs (drawer only) ---- */
.drawer-layout vaadin-tab {
  color: var(--fairds-sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: 6px;
  margin: 1px 8px;
  box-sizing: border-box;
  transition: background 0.15s ease, color 0.15s ease;
}

.drawer-layout vaadin-tab:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: var(--fairds-sidebar-text-hover) !important;
}

.drawer-layout vaadin-tab[selected] {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

.drawer-layout vaadin-tab a,
.drawer-layout vaadin-tab a:link,
.drawer-layout vaadin-tab a:visited {
  color: inherit !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
}

/* ---- Drawer footer ---- */
.drawer-footer {
  color: rgba(255, 255, 255, 0.85) !important;
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  font-size: 0.75rem;
  padding: 8px 16px;
}

.drawer-footer a,
.drawer-footer a:link,
.drawer-footer a:visited {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* ---- Links (content area) ---- */
a:link {
  color: var(--lumo-primary-color);
  text-decoration: none;
}

a:visited {
  color: var(--lumo-primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Dark mode link overrides */
html[theme~="dark"] a:link,
html[theme~="dark"] a:visited {
  color: #93c5fd;
}

/* Username and avatar in top bar sit on the dark navbar background in both modes */
a.header-username:link,
a.header-username:visited,
a.header-username:hover {
  color: #ffffff !important;
  text-decoration: none;
}

a.header-username:hover {
  opacity: 0.8;
}

img.header-avatar {
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

/* ---- Theme toggle button ---- */
.theme-toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  transition: background 0.2s ease !important;
}

.theme-toggle:hover {
  background: var(--lumo-contrast-10pct) !important;
}

/* ---- Memory footer (bottom-right) ---- */
.bottom-right-footer {
  position: fixed !important;
  bottom: 8px !important;
  right: 8px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  padding: 2px 8px !important;
  font-size: 0.75rem !important;
  color: #64748b !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  z-index: 1000 !important;
  pointer-events: none !important;
}

html[theme~="dark"] .bottom-right-footer {
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

/* ---- Misc utilities ---- */
.aligncenter {
  text-align: center;
}

.centered-content {
  margin: 0 auto;
  max-width: 250px;
}

/* ---- Accordion borders ---- */
.accordion-investigation-studies {
  border: 2px solid #424242 !important;
}

.accordion-observation-assays {
  border: 2px solid #424242 !important;
}
