/* Futuristic / neon glass theme — loaded when html.theme-futuristic */

html.theme-futuristic {
  scroll-behavior: smooth;
  /* Tamsūs sisteminiai valdikliai: <select> sąrašas, data picker ir pan. */
  color-scheme: dark;
  /* Bootstrap 5 formų numatytieji „šviesūs“ kintamieji — kitaip select gali likti baltas */
  --bs-body-bg: #050a14;
  --bs-body-color: #e8edff;
  --bs-secondary-bg: #0c1628;
  --bs-tertiary-bg: #122038;
  --bs-border-color: rgba(255, 255, 255, 0.18);
}

html.theme-futuristic body {
  margin: 0;
  min-height: 100vh;
  color: #e8edff;
  background:
    radial-gradient(1000px 420px at 8% -8%, rgba(0, 255, 188, 0.14), transparent 58%),
    radial-gradient(1100px 480px at 102% 0%, rgba(79, 140, 255, 0.2), transparent 60%),
    linear-gradient(180deg, #040810 0%, #081225 55%, #050a14 100%);
}

.fx-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.fx-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 30%, black 32%, transparent 78%);
  animation: fx-grid-drift 22s linear infinite;
}

@keyframes fx-grid-drift {
  0% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(-12px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.9; }
}

.fx-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(52px);
  opacity: 0.45;
  animation: fx-float 9s ease-in-out infinite;
}

.fx-orb-1 {
  width: 420px;
  height: 420px;
  left: -120px;
  top: 18%;
  background: rgba(54, 232, 166, 0.38);
}

.fx-orb-2 {
  width: 460px;
  height: 460px;
  right: -140px;
  top: 8%;
  background: rgba(79, 140, 255, 0.4);
  animation-delay: 1.4s;
}

.fx-orb-3 {
  width: 320px;
  height: 320px;
  left: 40%;
  bottom: -80px;
  background: rgba(168, 85, 247, 0.28);
  animation-delay: 2.1s;
}

@keyframes fx-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-28px) scale(1.03); }
}

.fx-shimmer {
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(
    110deg,
    transparent 40%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 60%
  );
  animation: fx-shimmer 7s ease-in-out infinite;
}

@keyframes fx-shimmer {
  0%, 100% { transform: translateX(-12%); opacity: 0.35; }
  50% { transform: translateX(12%); opacity: 0.55; }
}

.page-root {
  position: relative;
  z-index: 1;
}

html.theme-futuristic .nav {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 12, 24, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

html.theme-futuristic .nav a {
  color: #e8edff;
}

html.theme-futuristic .nav a:hover {
  border-color: rgba(84, 209, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

html.theme-futuristic .btn-secondary {
  border-color: rgba(255, 255, 255, 0.18);
  color: #e8edff;
  background: rgba(255, 255, 255, 0.06);
}

html.theme-futuristic .btn-primary {
  border: 0;
  background: linear-gradient(90deg, #45d1a7, #4f8cff);
  color: #fff;
  box-shadow: 0 10px 30px rgba(79, 140, 255, 0.28);
}

html.theme-futuristic .btn-primary:hover {
  filter: brightness(1.08);
}

html.theme-futuristic .card.glass,
html.theme-futuristic .glass {
  background: linear-gradient(180deg, rgba(16, 30, 56, 0.82), rgba(8, 16, 30, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}

html.theme-futuristic .chip {
  border: 1px solid rgba(84, 209, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  color: #e8edff;
}

html.theme-futuristic .text-soft,
html.theme-futuristic .soft-muted {
  color: rgba(232, 237, 255, 0.72) !important;
}

html.theme-futuristic h1,
html.theme-futuristic h2,
html.theme-futuristic h3,
html.theme-futuristic h4,
html.theme-futuristic h5,
html.theme-futuristic label,
html.theme-futuristic .form-label {
  color: #f1f5ff !important;
}

html.theme-futuristic .form-control,
html.theme-futuristic .form-select {
  background: rgba(12, 22, 42, 0.92) !important;
  color: #e8edff !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
}

html.theme-futuristic .form-control:focus,
html.theme-futuristic .form-select:focus {
  border-color: rgba(84, 209, 255, 0.85) !important;
  box-shadow: 0 0 0 3px rgba(84, 209, 255, 0.2) !important;
  background: rgba(12, 22, 42, 0.98) !important;
  color: #e8edff !important;
}

/* <select> išskleidžiamas sąrašas: dalis naršyklių ignoruoja color-scheme — option fonas + tekstas */
html.theme-futuristic select.form-select {
  color-scheme: dark;
}

html.theme-futuristic select.form-select option,
html.theme-futuristic select.form-select optgroup {
  background-color: #0c1628;
  color: #e8edff;
}

html.theme-futuristic select.form-select option:checked,
html.theme-futuristic select.form-select option:focus {
  background-color: #1e4976;
  color: #ffffff;
}

html.theme-futuristic input[type="date"] {
  color-scheme: dark;
}

/* --- Custom <select> (futuristic-select.js): tamsus sąrašas, ne OS balta dėžė --- */
html.theme-futuristic .fx-dd {
  position: relative;
  width: 100%;
}

html.theme-futuristic .fx-dd > select.fx-dd-native.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html.theme-futuristic .fx-dd-trigger {
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: calc(1.5em + 0.75rem + 2px);
  background: rgba(12, 22, 42, 0.95) !important;
  color: #e8edff !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  cursor: pointer;
}

html.theme-futuristic .fx-dd-trigger:hover {
  border-color: rgba(84, 209, 255, 0.45) !important;
}

html.theme-futuristic .fx-dd-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.theme-futuristic .fx-dd-caret {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(232, 237, 255, 0.75);
  transition: transform 0.15s ease;
}

html.theme-futuristic .fx-dd-trigger.fx-dd-trigger--menu-up .fx-dd-caret {
  transform: rotate(180deg);
}

/* Atidarius menų pakeliame visą kortelę — kitaip vėlesni DOM broliai (KPI ir pan.) uždengia sąrašą */
html.theme-futuristic .card.fx-dd-elevated,
html.theme-futuristic .glass.fx-dd-elevated {
  position: relative;
  z-index: 9000;
}

html.theme-futuristic .card.glass:has(.fx-dd-menu.is-open) {
  position: relative;
  z-index: 9000;
}

html.theme-futuristic .glass:has(.fx-dd-menu.is-open) {
  position: relative;
  z-index: 9000;
}

html.theme-futuristic .fx-dd-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  bottom: auto;
  z-index: 9100;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: #0c1628;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  max-height: min(320px, 50vh);
  overflow-y: auto;
}

/* Kai apačioje mažai vietos — kaip natūralus <select>: sąrašas atsiveria į viršų */
html.theme-futuristic .fx-dd-menu.fx-dd-menu--up {
  top: auto;
  bottom: calc(100% + 4px);
}

html.theme-futuristic .fx-dd-item {
  padding: 0.55rem 1rem;
  color: #e8edff;
  cursor: pointer;
  font-size: 0.95rem;
}

html.theme-futuristic .fx-dd-item:hover {
  background: rgba(79, 140, 255, 0.28);
  color: #fff;
}

html.theme-futuristic .fx-dd-item.is-selected {
  background: rgba(84, 209, 255, 0.12);
}

html.theme-futuristic .table {
  --bs-table-bg: transparent;
  --bs-table-color: #e8edff;
  /* BS5 hover state keičia tekstą į tamsų — laikome tą pačią šviesią kaip ir be hover */
  --bs-table-hover-color: #e8edff;
  --bs-table-border-color: rgba(255, 255, 255, 0.1);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
}

html.theme-futuristic .table a {
  color: #a5b4fc !important;
}

html.theme-futuristic .time-alert {
  color: #ff8a8a !important;
}

html.theme-futuristic .kpi-number {
  color: #f8fafc;
}

html.theme-futuristic .muted-2 {
  color: rgba(232, 237, 255, 0.68) !important;
}

html.theme-futuristic .table-dark {
  --bs-table-color: #e8edff;
  --bs-table-hover-color: #e8edff;
  --bs-table-bg: transparent;
  --bs-table-border-color: rgba(255, 255, 255, 0.1);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.04);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
}

html.theme-futuristic .glass h5 {
  color: #f1f5ff !important;
}

/*
 * Bootstrap 5 lentelės hover / stripe naudoja inset box-shadow su --bs-table-accent-bg.
 * Ant „glass“ kortelių (backdrop-filter) tai kartais piešia sluoksnį virš teksto.
 * Čia išjungiame inset šešėlį ir naudojame paprastą fono spalvą — tekstas visada viršuje.
 */
html.theme-futuristic .table > :not(caption) > * > * {
  box-shadow: none !important;
}

html.theme-futuristic .table tbody tr > *,
html.theme-futuristic .table thead tr > * {
  position: relative;
  z-index: 0;
}

html.theme-futuristic .table-hover > tbody > tr:hover > * {
  --bs-table-accent-bg: transparent !important;
  background-color: rgba(255, 255, 255, 0.09) !important;
  color: #e8edff !important;
}

/* Išlaikyti „slopintą“ tekstą ir akcentus kaip prieš hover */
html.theme-futuristic .table-hover > tbody > tr:hover > .text-soft,
html.theme-futuristic .table-hover > tbody > tr:hover > th.text-soft {
  color: rgba(232, 237, 255, 0.72) !important;
}

html.theme-futuristic .table-hover > tbody > tr:hover a {
  color: #a5b4fc !important;
}

html.theme-futuristic .table-hover > tbody > tr:hover .time-alert {
  color: #ff8a8a !important;
}

html.theme-futuristic .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: transparent !important;
  background-color: rgba(255, 255, 255, 0.04);
}

html.theme-futuristic .table-striped > tbody > tr:nth-of-type(even) > * {
  --bs-table-accent-bg: transparent !important;
  background-color: transparent;
}

html.theme-futuristic .table-striped.table-hover > tbody > tr:hover > * {
  background-color: rgba(255, 255, 255, 0.11) !important;
}

html.theme-futuristic .table-dark > :not(caption) > * > * {
  box-shadow: none !important;
}

html.theme-futuristic .table-dark.table-hover > tbody > tr:hover > * {
  --bs-table-accent-bg: transparent !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

html.theme-futuristic table tr:hover td {
  /* global styles.css taisyklė — perrašome tiksliu fonu be overlap */
  background-color: rgba(255, 255, 255, 0.09) !important;
  color: #e8edff !important;
}

/* App shell — futuristinė tamsi paletė (bendras išdėstymas: /assets/app-shell.css) */
html.theme-futuristic .fx-sidebar {
  background: linear-gradient(180deg, rgba(10, 22, 48, 0.96), rgba(5, 10, 22, 0.99));
  border-right: 1px solid rgba(84, 209, 255, 0.16);
  box-shadow: 8px 0 48px rgba(0, 0, 0, 0.4);
}

html.theme-futuristic .fx-sidebar-brand {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.theme-futuristic .fx-sidebar-logo-fallback {
  color: #54d1ff;
}

html.theme-futuristic .fx-nav-item {
  color: rgba(232, 237, 255, 0.82);
}

html.theme-futuristic .fx-nav-item:hover {
  background: rgba(84, 209, 255, 0.08);
  color: #e8edff;
  border-color: rgba(84, 209, 255, 0.14);
}

html.theme-futuristic .fx-nav-item.is-active {
  background: rgba(84, 209, 255, 0.15);
  border-color: rgba(84, 209, 255, 0.38);
  color: #fff;
  box-shadow: 0 0 28px rgba(84, 209, 255, 0.12);
}

html.theme-futuristic .fx-sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}

html.theme-futuristic .fx-sidebar-collapse-btn {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
}

html.theme-futuristic .fx-sidebar-collapse-btn:hover {
  color: #e8edff;
  border-color: rgba(84, 209, 255, 0.25);
  background: rgba(84, 209, 255, 0.06);
}

html.theme-futuristic .fx-topbar {
  border-bottom-color: rgba(255, 255, 255, 0.1);
  background: rgba(5, 10, 20, 0.65);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

html.theme-futuristic .fx-user-avatar {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
}

html.theme-futuristic .fx-user-greet {
  color: rgba(148, 163, 184, 0.95);
}

html.theme-futuristic .fx-user-name {
  color: #f1f5ff;
}

html.theme-futuristic .fx-topbar-icon-btn {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #e8edff;
}

html.theme-futuristic .fx-topbar-icon-btn:hover {
  background: rgba(84, 209, 255, 0.1);
  border-color: rgba(84, 209, 255, 0.28);
  color: #e8edff;
}

html.theme-futuristic .fx-user-avatar--night {
  box-shadow: 0 0 22px rgba(99, 102, 241, 0.22);
}

@media (max-width: 767.98px) {
  html.theme-futuristic .fx-sidebar {
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.45);
  }

  html.theme-futuristic .fx-mobile-sidebar-overlay {
    background: rgba(2, 6, 16, 0.62);
    backdrop-filter: blur(5px);
  }
}
