/* 
 * Nexus News AI Automation — Premium Floating Glass Design System
 * Dynamic Light & Dark Mode Overrides
 * Slate-Navy Edition (Reference Design)
 */

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

/* Color variables for Dark Mode - Slate Navy */
body.dark-theme {
  --nexus-bg: #0b0f17; /* Slate-Navy background */
  --nexus-card-bg: rgba(22, 28, 42, 0.65); /* Slate-900 with opacity */
  --nexus-card-border: rgba(255, 255, 255, 0.04); /* Very thin light border */
  --nexus-border: rgba(255, 255, 255, 0.04);
  --nexus-text-main: #f1f5f9; /* Slate-100 */
  --nexus-text-muted: #94a3b8; /* Slate-400 */
  --nexus-sidebar-bg: #131924; /* Solid Dark Slate-Navy from reference */
  --nexus-header-bg: rgba(19, 25, 36, 0.85);
  --nexus-shadow: 0 12px 36px -10px rgba(0, 0, 0, 0.8);
  --nexus-hover-glow: rgba(99, 102, 241, 0.03);
  --nexus-primary: #3b82f6; /* Modern Blue */
  --nexus-secondary: #10b981; /* Emerald */
  --nexus-accent: #ef4444; /* Red / Live */
  --grad-primary: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --grad-accent: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  --grad-mesh: radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.06) 0px, transparent 50%),
               radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  --sidebar-active-bg: #1e293b; /* Rounded gray block active */
  --nexus-input-bg: rgba(255, 255, 255, 0.02);
  --nexus-input-border: rgba(255, 255, 255, 0.08);
  --nexus-input-focus-bg: rgba(255, 255, 255, 0.04);
}

/* Color variables for Light Mode */
body.light-theme {
  --nexus-bg: #f8fafc;
  --nexus-card-bg: rgba(255, 255, 255, 0.7);
  --nexus-card-border: rgba(15, 23, 42, 0.06);
  --nexus-text-main: #0f172a;
  --nexus-text-muted: #64748b;
  --nexus-border: rgba(15, 23, 42, 0.08);
  --nexus-sidebar-bg: rgba(255, 255, 255, 0.85);
  --nexus-header-bg: rgba(255, 255, 255, 0.75);
  --nexus-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.06);
  --nexus-hover-glow: rgba(59, 130, 246, 0.08);
  --nexus-primary: #3b82f6; /* Blue */
  --nexus-secondary: #0d9488; /* Teal */
  --nexus-accent: #ef4444; /* Red */
  --grad-primary: linear-gradient(135deg, #3b82f6 0%, #0d9488 100%);
  --grad-accent: linear-gradient(135deg, #ef4444 0%, #3b82f6 100%);
  --grad-mesh: radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
               radial-gradient(at 100% 100%, rgba(13, 148, 136, 0.08) 0px, transparent 50%);
  --sidebar-active-bg: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, rgba(13, 148, 136, 0.03) 100%);
  --nexus-input-bg: #ffffff;
  --nexus-input-border: rgba(15, 23, 42, 0.15);
  --nexus-input-focus-bg: #ffffff;
}

/* Global Font & Body Settings */
body.nexus-dark {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  background-color: var(--nexus-bg) !important;
  background-image: var(--grad-mesh) !important;
  background-attachment: fixed !important;
  color: var(--nexus-text-main) !important;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--nexus-card-border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--nexus-primary);
}

/* ==========================================================================
   FLOATING LAYOUT ARCHITECTURE (Desktops)
   ========================================================================== */

@media (min-width: 992px) {
  body.nexus-dark .app-sidebar {
    position: fixed !important;
    top: 15px !important;
    left: 15px !important;
    bottom: 15px !important;
    height: calc(100vh - 30px) !important;
    width: 240px !important;
    border-radius: 20px !important;
    background: var(--nexus-sidebar-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--nexus-card-border) !important;
    box-shadow: var(--nexus-shadow) !important;
    margin: 0 !important;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1025;
  }

  body.nexus-dark.sidenav-toggled .app-sidebar {
    left: -270px !important;
  }

  body.nexus-dark .main-header.side-header {
    position: fixed !important;
    top: 15px !important;
    left: 270px !important;
    right: 15px !important;
    width: calc(100% - 285px) !important;
    height: 60px !important;
    border-radius: 16px !important;
    background: var(--nexus-header-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--nexus-card-border) !important;
    box-shadow: var(--nexus-shadow) !important;
    margin: 0 !important;
    padding: 0 20px !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1020;
    display: flex !important;
    align-items: center;
  }

  body.nexus-dark.sidenav-toggled .main-header.side-header {
    left: 15px !important;
    width: calc(100% - 30px) !important;
  }

  body.nexus-dark .main-content.app-content {
    margin-left: 270px !important;
    padding-top: 95px !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  body.nexus-dark.sidenav-toggled .main-content.app-content {
    margin-left: 15px !important;
  }
}

/* Responsive adjustment for Mobile viewports */
@media (max-width: 991.98px) {
  body.nexus-dark .main-header.side-header {
    background: var(--nexus-header-bg) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border-bottom: 1px solid var(--nexus-card-border) !important;
  }
  body.nexus-dark .main-content.app-content {
    padding-top: 75px !important;
  }
}

/* ==========================================================================
   UI COMPONENTS & CARD REDESIGN
   ========================================================================== */

body.nexus-dark .card {
  background: var(--nexus-card-bg) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid var(--nexus-card-border) !important;
  border-radius: 12px !important;
  box-shadow: var(--nexus-shadow) !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  margin-bottom: 24px !important;
  color: var(--nexus-text-main) !important;
}

body.nexus-dark .card:hover {
  border-color: rgba(255, 255, 255, 0.08) !important;
  transform: translateY(-1px);
}

body.nexus-dark .card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--nexus-card-border) !important;
  padding: 16px 20px !important;
}

body.nexus-dark .card-title {
  color: var(--nexus-text-main) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  letter-spacing: -0.2px;
}

body.nexus-dark .card-body {
  color: var(--nexus-text-main) !important;
}
body.nexus-dark .card-body span:not([class*="text-"]):not([class*="badge"]):not([class*="status-"]),
body.nexus-dark .card-body p:not([class*="text-"]):not([class*="card-sub-title"]),
body.nexus-dark .card-body td:not([class*="text-"]),
body.nexus-dark .card-body div:not([class*="text-"]):not([class*="status-"]):not([class*="progress"]) {
  color: var(--nexus-text-main) !important;
}

/* Headers */
body.nexus-dark .main-header-center h4.description-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  letter-spacing: -0.5px;
}

body.nexus-dark .main-sidebar-header {
  background: transparent !important;
  border-bottom: 1px solid var(--nexus-card-border) !important;
  height: 64px;
}

/* Sidebar lists */
body.nexus-dark .side-menu__item {
  border-radius: 8px !important;
  margin: 3px 12px !important;
  padding: 10px 14px !important;
  color: var(--nexus-text-muted) !important;
  transition: all 0.2s ease !important;
  font-size: 13px !important;
}

body.nexus-dark .side-menu__item:hover {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--nexus-text-main) !important;
}

body.nexus-dark .side-menu__item.active,
body.nexus-dark .slide.is-expanded > .side-menu__item {
  background: var(--sidebar-active-bg) !important;
  border-left: 3px solid var(--nexus-primary) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

body.nexus-dark .side-menu__item.active .side-menu__icon,
body.nexus-dark .slide.is-expanded > .side-menu__item .side-menu__icon {
  fill: var(--nexus-primary) !important;
  color: var(--nexus-primary) !important;
}

body.nexus-dark .slide-menu {
  background: rgba(0, 0, 0, 0.15) !important;
  margin: 0 12px !important;
  border-radius: 6px !important;
}

/* Forms & inputs */
body.nexus-dark .form-control,
body.nexus-dark .form-select,
body.nexus-dark select {
  background: var(--nexus-input-bg) !important;
  border: 1px solid var(--nexus-input-border) !important;
  border-radius: 8px !important;
  color: var(--nexus-text-main) !important;
  padding: 8px 12px !important;
}

body.nexus-dark .form-control:focus,
body.nexus-dark .form-select:focus {
  background: var(--nexus-input-focus-bg) !important;
  border-color: var(--nexus-primary) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}

body.nexus-dark label {
  color: var(--nexus-text-main) !important;
  font-weight: 500;
}

body.nexus-dark .text-muted {
  color: var(--nexus-text-muted) !important;
}

/* Modals */
body.nexus-dark .modal-content {
  background: var(--nexus-sidebar-bg) !important;
  backdrop-filter: blur(25px) !important;
  -webkit-backdrop-filter: blur(25px) !important;
  border: 1px solid var(--nexus-card-border) !important;
  border-radius: 16px !important;
  box-shadow: var(--nexus-shadow) !important;
}

/* Table overrides */
body.nexus-dark .table {
  color: var(--nexus-text-main) !important;
  border-collapse: separate !important;
  border-spacing: 0 4px !important;
}
body.nexus-dark .table th {
  color: var(--nexus-text-muted) !important;
  border-bottom: 1px solid var(--nexus-card-border) !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  padding: 12px !important;
}
body.nexus-dark .table td {
  background: rgba(255, 255, 255, 0.01) !important;
  border-top: 1px solid var(--nexus-card-border) !important;
  border-bottom: 1px solid var(--nexus-card-border) !important;
  padding: 12px !important;
}
body.nexus-dark .table tr:hover td {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* Clean row highlights matching reference design */
body.nexus-dark .table tr.row-breaking td {
  background: rgba(239, 68, 68, 0.08) !important;
  border-top: 1px solid rgba(239, 68, 68, 0.2) !important;
  border-bottom: 1px solid rgba(239, 68, 68, 0.2) !important;
}
body.nexus-dark .table tr.row-breaking td:first-child {
  border-left: 3px solid #ef4444 !important;
}

body.nexus-dark .table tr.row-green td {
  background: rgba(16, 185, 129, 0.08) !important;
  border-top: 1px solid rgba(16, 185, 129, 0.2) !important;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2) !important;
}
body.nexus-dark .table tr.row-green td:first-child {
  border-left: 3px solid #10b981 !important;
}

/* Buttons */
body.nexus-dark .btn-primary,
body.nexus-dark .btn-primary-light {
  background: var(--grad-primary) !important;
  border: none !important;
  border-radius: 8px !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2) !important;
  transition: all 0.25s ease !important;
}
body.nexus-dark .btn-primary:hover,
body.nexus-dark .btn-primary-light:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3) !important;
}

body.nexus-dark .btn-secondary,
body.nexus-dark .btn-secondary-light {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--nexus-card-border) !important;
  border-radius: 8px !important;
  color: var(--nexus-text-main) !important;
}
body.nexus-dark .btn-secondary:hover,
body.nexus-dark .btn-secondary-light:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Active breadcrumbs */
body.nexus-dark .breadcrumb-header .main-content-title {
  color: var(--nexus-text-main) !important;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Custom CSS Monogram */
.nexus-logo-monogram {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nexus-logo-symbol {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}
.nexus-logo-text-large {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  color: var(--nexus-text-main) !important;
}

.avatar-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #ffffff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.avatar-initials-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #ffffff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ==========================================================================
   ENHANCED DASHBOARD SPECIFICS
   ========================================================================== */
.nexus-welcome-hero {
  padding: 24px 30px !important;
  border-radius: 16px !important;
  margin-bottom: 24px !important;
  background: rgba(22, 28, 42, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

body.light-theme .nexus-welcome-hero {
  background: rgba(255, 255, 255, 0.75) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.nexus-hero-title {
  font-size: 2rem !important;
  font-weight: 800 !important;
  margin-bottom: 10px !important;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nexus-hero-subtitle {
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
  margin-bottom: 12px !important;
}

body.nexus-dark .nexus-hero-subtitle {
  color: #94a3b8 !important; /* Slate-400 for high visibility */
}

body.light-theme .nexus-hero-subtitle {
  color: #475569 !important; /* Slate-600 for high visibility */
}

.nexus-hero-container {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 30px;
  align-items: center;
}
@media (max-width: 991px) {
  .nexus-hero-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
.nexus-hero-image-wrap {
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--nexus-card-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 0 !important;
}
.nexus-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nexus-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.nexus-stat-card {
  background: var(--nexus-card-bg) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--nexus-card-border) !important;
  border-radius: 14px !important;
  padding: 20px !important;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
  box-shadow: var(--nexus-shadow);
}
.nexus-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.08) !important;
}
.nexus-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--grad-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  color: #fff;
}
.nexus-stat-icon.accent {
  background: var(--grad-accent);
}
.nexus-stat-info {
  display: flex;
  flex-direction: column;
}
.nexus-stat-number {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--nexus-text-main);
  line-height: 1.2;
}
.nexus-stat-label {
  font-size: 0.8rem;
  color: var(--nexus-text-muted);
  font-weight: 500;
}
.nexus-shortcuts-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--nexus-text-main);
  margin-bottom: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.nexus-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}
.nexus-shortcut-item {
  background: var(--nexus-card-bg) !important;
  border: 1px solid var(--nexus-card-border) !important;
  border-radius: 12px;
  padding: 18px 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--nexus-shadow);
}
.nexus-shortcut-item:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  transform: translateY(-3px);
}
.nexus-shortcut-icon {
  font-size: 22px;
  color: var(--nexus-primary);
  margin-bottom: 10px;
}
.nexus-shortcut-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--nexus-text-main);
}

/* Chat FAB Pulse */
body.nexus-dark .chat-button {
  background: var(--grad-primary) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 4px 30px rgba(59, 130, 246, 0.2);
  }
  100% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
}

/* Tabs overriding */
body.nexus-dark .nav-tabs {
  border-bottom: 1px solid var(--nexus-card-border) !important;
}

body.nexus-dark .nav-tabs .nav-link {
  color: var(--nexus-text-muted) !important;
  border: none !important;
  padding: 10px 20px !important;
  transition: all 0.3s ease !important;
}

body.nexus-dark .nav-tabs .nav-link.active {
  background: transparent !important;
  color: var(--nexus-primary) !important;
  border-bottom: 3px solid var(--nexus-primary) !important;
}

/* ==========================================================================
   HIGH-CONTRAST LIGHT MODE BADGES (WCAG ACCESSIBILITY COMPLIANT)
   ========================================================================== */
body.light-theme .badge.bg-success, 
body.light-theme .badge-success,
body.light-theme .badge.bg-success-light {
  background: #d1fae5 !important;
  color: #065f46 !important;
  border: 1px solid rgba(6, 95, 70, 0.15) !important;
}
body.light-theme .badge.bg-warning, 
body.light-theme .badge-warning,
body.light-theme .badge.bg-warning-light {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid rgba(146, 64, 14, 0.15) !important;
}
body.light-theme .badge.bg-danger, 
body.light-theme .badge-danger,
body.light-theme .badge.bg-danger-light {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid rgba(153, 27, 27, 0.15) !important;
}
body.light-theme .badge.bg-info, 
body.light-theme .badge-info,
body.light-theme .badge.bg-info-light {
  background: #e0f2fe !important;
  color: #075985 !important;
  border: 1px solid rgba(7, 89, 133, 0.15) !important;
}
body.light-theme .badge.bg-primary, 
body.light-theme .badge-primary,
body.light-theme .badge.bg-primary-light {
  background: #ede9fe !important;
  color: #5b21b6 !important;
  border: 1px solid rgba(91, 33, 182, 0.15) !important;
}
body.light-theme .badge.bg-secondary, 
body.light-theme .badge-secondary,
body.light-theme .badge.bg-secondary-light {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid rgba(51, 65, 85, 0.15) !important;
}

/* ==========================================================================
   DARK MODE COMPATIBLE BADGES
   ========================================================================== */
body.dark-theme .badge.bg-success, 
body.dark-theme .badge-success,
body.dark-theme .badge.bg-success-light {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(52, 211, 153, 0.2) !important;
}
body.dark-theme .badge.bg-warning, 
body.dark-theme .badge-warning,
body.dark-theme .badge.bg-warning-light {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(251, 191, 36, 0.2) !important;
}
body.dark-theme .badge.bg-danger, 
body.dark-theme .badge-danger,
body.dark-theme .badge.bg-danger-light {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(248, 113, 113, 0.2) !important;
}
body.dark-theme .badge.bg-info, 
body.dark-theme .badge-info,
body.dark-theme .badge.bg-info-light {
  background: rgba(14, 165, 233, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
}
body.dark-theme .badge.bg-primary, 
body.dark-theme .badge-primary,
body.dark-theme .badge.bg-primary-light {
  background: rgba(139, 92, 246, 0.15) !important;
  color: #a78bfa !important;
  border: 1px solid rgba(167, 139, 250, 0.2) !important;
}
body.dark-theme .badge.bg-secondary, 
body.dark-theme .badge-secondary,
body.dark-theme .badge.bg-secondary-light {
  background: rgba(161, 161, 170, 0.15) !important;
  color: #d4d4d8 !important;
  border: 1px solid rgba(212, 212, 216, 0.2) !important;
}

/* ==========================================================================
   TELEMETRY & LOG WIDGET STYLING
   ========================================================================== */
.nexus-telemetry-item {
  margin-bottom: 12px;
}
.nexus-telemetry-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}
.nexus-telemetry-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}
body.light-theme .nexus-telemetry-bar-bg {
  background: rgba(15, 23, 42, 0.05);
}
.nexus-telemetry-bar-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 3px;
}
.status-pill {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.status-pill.success {
  background: #10b981;
}
.status-pill.warning {
  background: #f59e0b;
}
.status-pill.danger {
  background: #ef4444;
}

/* ==========================================================================
   PREMIUM SAAS CARD OVERRIDES FOR LIST ITEMS (.alert-outline-success)
   ========================================================================== */
body.nexus-dark .alert-outline-success,
body.nexus-dark .alert.alert-outline-success {
  background: #161c2a !important; /* Solid Slate-900 card background */
  color: #f1f5f9 !important; /* High contrast Slate-100 text */
  border: 1px solid rgba(255, 255, 255, 0.06) !important; /* Clear card border */
  border-radius: 12px !important;
  padding: 16px 20px !important;
  padding-right: 50px !important; /* Spacing for the close button */
  margin-bottom: 15px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
  min-height: 56px !important;
  transition: all 0.25s ease !important;
}

body.light-theme .alert-outline-success,
body.light-theme .alert.alert-outline-success {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05) !important;
}

body.transparent-theme .alert-outline-success,
body.transparent-theme .alert.alert-outline-success {
  background: rgba(0, 0, 0, 0.6) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

body.nexus-dark .alert-outline-success:hover,
body.nexus-dark .alert.alert-outline-success:hover {
  border-color: rgba(255, 255, 255, 0.1) !important;
  transform: translateY(-1px);
}

body.light-theme .alert-outline-success:hover,
body.light-theme .alert.alert-outline-success:hover {
  border-color: rgba(15, 23, 42, 0.15) !important;
}

body.nexus-dark .alert-outline-success .btn-close,
body.nexus-dark .alert.alert-outline-success .btn-close {
  position: absolute !important;
  top: 50% !important;
  right: 15px !important;
  transform: translateY(-50%) !important;
  background: transparent !important;
  border: none !important;
  opacity: 0.65 !important;
  transition: opacity 0.2s ease, color 0.2s ease !important;
  color: var(--nexus-text-main) !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  font-size: 20px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

body.nexus-dark .alert-outline-success .btn-close:hover,
body.nexus-dark .alert.alert-outline-success .btn-close:hover {
  opacity: 1 !important;
  color: var(--nexus-accent) !important;
}

/* Fix dynamic delete/edit action buttons inside list cards */
body.nexus-dark .alert-outline-success button.btn-sm,
body.nexus-dark .alert.alert-outline-success button.btn-sm {
  margin-top: 0 !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
}

/* ==========================================================================
   PURE CSS PREMIUM ANIMATIONS (ROBUST & STABLE)
   ========================================================================== */
@keyframes nexusFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nexusScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animations for layout containers & cards */
body.nexus-dark .card,
body.light-theme .card,
body.transparent-theme .card,
.nexus-welcome-hero {
  animation: nexusFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Stats metrics widget animations */
.nexus-stat-card {
  opacity: 0;
  animation: nexusScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.nexus-stats-grid > div:nth-child(1) .nexus-stat-card { animation-delay: 0.04s; }
.nexus-stats-grid > div:nth-child(2) .nexus-stat-card { animation-delay: 0.08s; }
.nexus-stats-grid > div:nth-child(3) .nexus-stat-card { animation-delay: 0.12s; }
.nexus-stats-grid > div:nth-child(4) .nexus-stat-card { animation-delay: 0.16s; }

/* Shortcuts console item animations */
.nexus-shortcut-item {
  opacity: 0;
  animation: nexusFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.nexus-shortcuts-grid > div:nth-child(1) { animation-delay: 0.02s; }
.nexus-shortcuts-grid > div:nth-child(2) { animation-delay: 0.04s; }
.nexus-shortcuts-grid > div:nth-child(3) { animation-delay: 0.06s; }
.nexus-shortcuts-grid > div:nth-child(4) { animation-delay: 0.08s; }
.nexus-shortcuts-grid > div:nth-child(5) { animation-delay: 0.10s; }
.nexus-shortcuts-grid > div:nth-child(6) { animation-delay: 0.12s; }
.nexus-shortcuts-grid > div:nth-child(7) { animation-delay: 0.14s; }
.nexus-shortcuts-grid > div:nth-child(8) { animation-delay: 0.16s; }

/* Sidebar lists animations */
.side-menu > li {
  opacity: 0;
  animation: nexusFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.side-menu > li:nth-child(1) { animation-delay: 0.02s; }
.side-menu > li:nth-child(2) { animation-delay: 0.04s; }
.side-menu > li:nth-child(3) { animation-delay: 0.06s; }
.side-menu > li:nth-child(4) { animation-delay: 0.08s; }
.side-menu > li:nth-child(5) { animation-delay: 0.10s; }
.side-menu > li:nth-child(6) { animation-delay: 0.12s; }
.side-menu > li:nth-child(7) { animation-delay: 0.14s; }
.side-menu > li:nth-child(8) { animation-delay: 0.16s; }
.side-menu > li:nth-child(9) { animation-delay: 0.18s; }
.side-menu > li:nth-child(10) { animation-delay: 0.20s; }

/* ==========================================================================
   PREMIUM LOADER (SMOOTH & STABLE)
   ========================================================================== */
#global-loader {
  position: fixed;
  z-index: 99999 !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  text-align: center;
  background-color: #f8fafc !important;
}

body.nexus-dark #global-loader,
body.dark-theme #global-loader,
.dark-theme #global-loader {
  background-color: #0b0f17 !important;
  background-image: radial-gradient(circle at center, rgba(59, 130, 246, 0.08) 0%, rgba(11, 15, 23, 0) 70%) !important;
}

body.transparent-theme #global-loader,
.transparent-theme #global-loader {
  background-color: rgba(11, 15, 23, 0.95) !important;
  backdrop-filter: blur(20px);
}

.nrcs-loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transform: translateY(-20px);
}

.nrcs-loader-spinner {
  position: relative;
  width: 80px;
  height: 80px;
}

.nrcs-loader-spinner::before,
.nrcs-loader-spinner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 3.5px solid transparent;
}

.nrcs-loader-spinner::before {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-top-color: #3b82f6; /* Nexus Blue */
  border-right-color: rgba(59, 130, 246, 0.15);
  animation: nrcsSpin 1.4s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

.nrcs-loader-spinner::after {
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border-bottom-color: #10b981; /* Emerald */
  border-left-color: rgba(16, 185, 129, 0.15);
  animation: nrcsSpinReverse 1.1s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

.nrcs-loader-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #3b82f6;
  box-shadow: 0 0 12px #3b82f6;
  animation: nrcsDotPulse 1.4s ease-in-out infinite;
}

.nrcs-loader-text {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: nrcsPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  margin-top: 12px;
}

body.light-theme .nrcs-loader-text,
.light-theme .nrcs-loader-text {
  background: linear-gradient(135deg, #0b0f17 0%, #64748b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
