/**
 * NEMESYS — Luxury Glassmorphism & Cyber Modern Design System
 * Theme inspired by high-tech network monitoring dashboards.
 */

:root {
  --glass-bg: rgba(18, 24, 46, 0.65);
  --glass-bg-subtle: rgba(18, 24, 46, 0.45);
  --glass-bg-heavy: rgba(14, 19, 38, 0.85);
  --glass-border: rgba(255, 255, 255, 0.11);
  --glass-border-highlight: rgba(255, 255, 255, 0.24);
  --glass-blur: blur(24px) saturate(190%);
  --glass-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.55), 0 0 35px rgba(105, 108, 255, 0.12);
  --glass-glow-accent: 0 0 25px rgba(3, 195, 236, 0.25);
  --color-primary-gradient: linear-gradient(135deg, #696cff 0%, #4f52e6 50%, #03c3ec 100%);
}

/* Base Body Background */
body {
  background: radial-gradient(circle at 50% 10%, #151c33 0%, #0a0e1a 60%, #05070d 100%) fixed !important;
  color: #e2e8f0 !important;
  min-height: 100vh;
}

/* Layout Wrappers Translucent */
.layout-wrapper,
.layout-container,
.layout-page,
.content-wrapper {
  background: transparent !important;
}

/* Cards Glassmorphism */
.card {
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  border: 1px solid var(--glass-border) !important;
  border-top: 1px solid var(--glass-border-highlight) !important;
  border-radius: 20px !important;
  box-shadow: var(--glass-shadow) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 25px 55px -10px rgba(0, 0, 0, 0.7), 0 0 35px rgba(105, 108, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

.card-header,
.card-footer {
  background: transparent !important;
  border-color: var(--glass-border) !important;
}

/* Top Navbar Glass */
#layout-navbar {
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  border: 1px solid var(--glass-border) !important;
  border-top: 1px solid var(--glass-border-highlight) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(105, 108, 255, 0.12) !important;
  margin-top: 0.75rem !important;
}

/* Sidebar Menu Glass */
#layout-menu {
  background: rgba(12, 16, 32, 0.85) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  border-right: 1px solid var(--glass-border) !important;
  box-shadow: 5px 0 35px rgba(0, 0, 0, 0.45) !important;
}

#layout-menu .app-brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#layout-menu .menu-item {
  margin: 0.15rem 0.5rem;
}

#layout-menu .menu-item .menu-link {
  border-radius: 12px !important;
  color: #94a3b8 !important;
  transition: all 0.25s ease !important;
}

#layout-menu .menu-item:not(.active) .menu-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  transform: translateX(4px);
}

#layout-menu .menu-item.active > .menu-link {
  background: var(--color-primary-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(105, 108, 255, 0.45), 0 0 10px rgba(3, 195, 236, 0.3) !important;
  font-weight: 600 !important;
}

#layout-menu .menu-item.active > .menu-link i {
  color: #ffffff !important;
}

/* Tables Styling */
.table {
  --bs-table-bg: transparent !important;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
  color: #e2e8f0 !important;
}

.table thead th,
.table-light {
  background: rgba(255, 255, 255, 0.05) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
}

.table-hover tbody tr {
  transition: background 0.2s ease, transform 0.2s ease;
}

.table-hover tbody tr:hover {
  background: rgba(105, 108, 255, 0.08) !important;
}

/* Modals Glass & Layering */
.modal-backdrop {
  z-index: 1050 !important;
  background-color: rgba(5, 7, 13, 0.75) !important;
}

.modal-backdrop.show {
  opacity: 1 !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.modal {
  z-index: 1060 !important;
}

.modal-dialog {
  z-index: 1065 !important;
  position: relative !important;
}

.modal-content {
  background: rgba(16, 22, 44, 0.95) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 24px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(105, 108, 255, 0.2) !important;
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Ensure containers holding open modals don't clip or trap them behind backdrops */
.card:has(.modal.show),
.card:has(.modal.fade.show),
.table-responsive:has(.modal.show),
.table-responsive:has(.modal.fade.show),
.list-group:has(.modal.show),
.list-group:has(.modal.fade.show),
tr:has(.modal.show),
td:has(.modal.show) {
  overflow: visible !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  position: relative !important;
  z-index: 1060 !important;
}

body.modal-open .cms-root,
body.modal-open .layout-wrapper {
  overflow: visible !important;
}

/* Dropdowns Glass */
.dropdown-menu {
  background: rgba(18, 24, 46, 0.94) !important;
  backdrop-filter: blur(20px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 16px !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(105, 108, 255, 0.15) !important;
  padding: 0.5rem !important;
}

.dropdown-item {
  border-radius: 10px !important;
  color: #cbd5e1 !important;
  transition: all 0.2s ease !important;
  padding: 0.5rem 1rem !important;
}

.dropdown-item:hover {
  background: rgba(105, 108, 255, 0.18) !important;
  color: #ffffff !important;
  transform: translateX(3px);
}

.dropdown-divider {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Form Controls Glass */
.form-control,
.form-select,
.input-group-text {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #f1f5f9 !important;
  border-radius: 12px !important;
  backdrop-filter: blur(10px) !important;
  transition: all 0.25s ease !important;
}

.form-control:focus,
.form-select:focus {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: #696cff !important;
  box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.25), 0 0 15px rgba(105, 108, 255, 0.2) !important;
  color: #ffffff !important;
}

.form-control::placeholder {
  color: rgba(148, 163, 184, 0.5) !important;
}

/* Buttons */
.btn-primary {
  background: var(--color-primary-gradient) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(105, 108, 255, 0.4) !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  transition: all 0.25s ease !important;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(105, 108, 255, 0.6), 0 0 20px rgba(3, 195, 236, 0.3) !important;
}

.btn-outline-primary {
  border-color: rgba(105, 108, 255, 0.5) !important;
  color: #a5b4fc !important;
  border-radius: 12px !important;
  transition: all 0.2s ease !important;
}

.btn-outline-primary:hover {
  background: rgba(105, 108, 255, 0.15) !important;
  border-color: #696cff !important;
  box-shadow: 0 0 15px rgba(105, 108, 255, 0.3) !important;
}

.btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #94a3b8 !important;
  border-radius: 12px !important;
}

.btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f1f5f9 !important;
}

/* Badges Neon */
.badge.bg-label-primary {
  background-color: rgba(105, 108, 255, 0.15) !important;
  color: #8c90ff !important;
  border: 1px solid rgba(105, 108, 255, 0.25) !important;
}

.badge.bg-label-success {
  background-color: rgba(113, 221, 55, 0.15) !important;
  color: #71dd37 !important;
  border: 1px solid rgba(113, 221, 55, 0.25) !important;
}

.badge.bg-label-danger {
  background-color: rgba(255, 62, 29, 0.15) !important;
  color: #ff3e1d !important;
  border: 1px solid rgba(255, 62, 29, 0.25) !important;
}

.badge.bg-label-warning {
  background-color: rgba(255, 171, 0, 0.15) !important;
  color: #ffab00 !important;
  border: 1px solid rgba(255, 171, 0, 0.25) !important;
}

.badge.bg-label-info {
  background-color: rgba(3, 195, 236, 0.15) !important;
  color: #03c3ec !important;
  border: 1px solid rgba(3, 195, 236, 0.25) !important;
}

/* Footer */
.content-footer {
  background: transparent !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Neon Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 14, 26, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(105, 108, 255, 0.35);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(105, 108, 255, 0.6);
}
