/*
  theme-modern.css
  Visual refresh layered on top of css/style.css.
  Purely presentational: colors, shadows, radii, and motion only.
  Do not add selectors that change layout structure or JS-driven behavior.
*/

:root {
  --sv-primary: #0084ff;
  --sv-primary-dark: #0868c9;
  --sv-primary-darker: #1072ce;
  --sv-primary-light: #e5f2ff;
  --sv-accent: #2cddbe;
  --sv-danger: #fa625e;
  --sv-ink: #262734;
  --sv-ink-soft: #868aa8;
  --sv-surface: #ffffff;
  --sv-surface-muted: #f3f8fa;
  --sv-border: #e1eaea;

  --sv-radius-sm: 8px;
  --sv-radius: 14px;
  --sv-radius-lg: 20px;

  --sv-shadow-sm: 0 2px 8px rgba(38, 39, 52, 0.06);
  --sv-shadow-md: 0 10px 30px rgba(16, 42, 67, 0.10);
  --sv-shadow-lg: 0 20px 45px rgba(16, 42, 67, 0.16);
  --sv-shadow-primary: 0 10px 24px rgba(0, 132, 255, 0.28);

  --sv-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --sv-speed-fast: 0.18s;
  --sv-speed: 0.3s;
  --sv-speed-slow: 0.55s;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(134, 138, 168, 0.35);
  border-radius: 100px;
  transition: background var(--sv-speed) var(--sv-ease);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 132, 255, 0.55);
}

/* ---------- Page entrance ---------- */
@keyframes svFadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes svFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page-subheader {
  animation: svFadeInUp var(--sv-speed-slow) var(--sv-ease) both;
}
.page-content {
  animation: svFadeInUp var(--sv-speed-slow) var(--sv-ease) both;
  animation-delay: .05s;
}

/* ---------- Global interactive motion ---------- */
a, .btn, .nav-link, .dropdown-item, .list-item, .nav-thumbnail,
.form-control, .form-select, .card, .metisMenu li, input, textarea, select {
  transition: color var(--sv-speed-fast) var(--sv-ease),
              background-color var(--sv-speed-fast) var(--sv-ease),
              border-color var(--sv-speed-fast) var(--sv-ease),
              box-shadow var(--sv-speed-fast) var(--sv-ease),
              transform var(--sv-speed-fast) var(--sv-ease);
}

/* ---------- Sidebar ---------- */
.darkNav {
  background: linear-gradient(180deg, #262734 0%, #20212c 100%);
}

.sidenav .app-logo {
  transition: background-color var(--sv-speed) var(--sv-ease);
}

.metisMenu li:not(.nav-title) > a {
  border-radius: var(--sv-radius-sm);
  margin: 0 8px;
  position: relative;
}

.metisMenu li:not(.nav-title):hover > a,
.metisMenu li:not(.nav-title):hover > .nav-thumbnail {
  transform: translateX(3px);
}

.metisMenu li:not(.nav-title) .nav-thumbnail {
  transition: background-color var(--sv-speed) var(--sv-ease),
              transform var(--sv-speed-fast) var(--sv-ease),
              box-shadow var(--sv-speed) var(--sv-ease);
}

.darkNav .metisMenu > li.active > .nav-thumbnail,
.whiteNav .metisMenu li.active > .nav-thumbnail {
  box-shadow: var(--sv-shadow-primary);
}

.darkNav .metisMenu > li.active,
.whiteNav .metisMenu > li.active {
  position: relative;
}

/* ---------- Header ---------- */
header.page-header {
  box-shadow: var(--sv-shadow-sm);
}

.dropdown-menu {
  animation: svDropdownIn var(--sv-speed-fast) var(--sv-ease) both;
  box-shadow: var(--sv-shadow-lg) !important;
  border: 1px solid var(--sv-border);
}
@keyframes svDropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-states.states-online {
  position: relative;
}
.user-states.states-online::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #48d17a;
  border: 2px solid #262734;
  box-shadow: 0 0 0 rgba(72, 209, 122, 0.6);
  animation: svPulseDot 2.2s var(--sv-ease) infinite;
}
@keyframes svPulseDot {
  0% { box-shadow: 0 0 0 0 rgba(72, 209, 122, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(72, 209, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(72, 209, 122, 0); }
}

/* ---------- Cards / portlets / table panels ---------- */
.card,
.bg-white.rounded,
.bg-white.shadow-sm,
.portlet {
  border-radius: var(--sv-radius) !important;
}

.card,
.bg-white.rounded.shadow-sm {
  box-shadow: var(--sv-shadow-sm) !important;
}

.card:hover,
.bg-white.rounded.shadow-sm:hover {
  box-shadow: var(--sv-shadow-md) !important;
}

.table-responsive {
  border-radius: var(--sv-radius);
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: var(--sv-radius-sm);
}

.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--sv-primary) 0%, var(--sv-primary-darker) 100%);
  border-color: var(--sv-primary-darker);
}
.btn-primary:hover {
  box-shadow: var(--sv-shadow-primary);
}

/* ---------- Tables ---------- */
table.dataTable tbody tr,
.table tbody tr {
  transition: background-color var(--sv-speed-fast) var(--sv-ease);
}
table.dataTable tbody tr:hover,
.table tbody tr:hover {
  background-color: var(--sv-surface-muted);
}

tbody tr {
  animation: svFadeIn var(--sv-speed) var(--sv-ease) both;
}

/* ---------- Theme switch (dark mode toggle) ---------- */
.theme-switch-item {
  cursor: default;
}
.theme-switch-item .form-check-input {
  cursor: pointer;
  width: 2.25em;
}
.form-check-input:checked {
  background-color: var(--sv-primary) !important;
  border-color: var(--sv-primary-darker) !important;
}
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.2) !important;
}

/* ---------- Forms ---------- */
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.15) !important;
  border-color: var(--sv-primary) !important;
}

/* ---------- Loader ---------- */
#loader-wrapper {
  background: rgba(20, 22, 34, 0.72);
  backdrop-filter: blur(2px);
}
.lds-ripple div {
  border-color: var(--sv-primary) transparent transparent transparent;
  border-top-color: #fff;
}

/* ---------- Public / login pages ---------- */
body.sysHome,
body.accounts-page,
.bg-parallax.accounts-page {
  position: relative;
}

.accounts-page {
  background: radial-gradient(circle at 20% 20%, rgba(0, 132, 255, 0.18), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(44, 221, 190, 0.16), transparent 40%),
              linear-gradient(160deg, #101223 0%, #1b1e2e 55%, #10233a 100%);
  min-height: 100vh;
}

.accounts-page .col-lg-4,
.accounts-page .col-md-6 {
  animation: svFadeInUp var(--sv-speed-slow) var(--sv-ease) both;
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--sv-radius-lg);
  box-shadow: var(--sv-shadow-lg);
  padding: 2rem 2.25rem 1.5rem;
}

.accounts-page .sysimg {
  animation: svFadeIn var(--sv-speed-slow) var(--sv-ease) both;
}
