/*
 * Nocisense Theme Override for Dusty Admin Template
 * Brand Colors: Teal (#4BBFBF), Navy (#2C5F8A), Dark (#1E2E3B)
 */

:root {
  /* ── Nocisense Brand ── */
  --nc-primary: #2C5F8A;
  --nc-primary-rgb: 44, 95, 138;
  --nc-teal: #4BBFBF;
  --nc-teal-rgb: 75, 191, 191;
  --nc-teal-dark: #339999;
  --nc-dark: #1E2E3B;
  --nc-dark-rgb: 30, 46, 59;
  --nc-light: #F1F5F9;
  --nc-sidebar-bg: #1E2E3B;
  --nc-sidebar-text: #c8d8e4;

  /* ── Override Bootstrap / Dusty ── */
  --bs-primary: var(--nc-teal);
  --bs-primary-rgb: var(--nc-teal-rgb);
}

/* ═══════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════ */
.app-sidebar-menu,
[data-menu-color="dark"] .app-sidebar-menu {
  background: var(--nc-sidebar-bg) !important;
}

[data-menu-color="dark"] #sidebar-menu > ul > li > a,
[data-menu-color="dark"] .nav-second-level > li > a {
  color: var(--nc-sidebar-text) !important;
}

[data-menu-color="dark"] #sidebar-menu > ul > li > a:hover,
[data-menu-color="dark"] #sidebar-menu > ul > li > a:focus,
[data-menu-color="dark"] .nav-second-level > li > a:hover {
  color: var(--nc-teal) !important;
}

[data-menu-color="dark"] #sidebar-menu > ul > li > a.active,
[data-menu-color="dark"] .nav-second-level > li > a.active {
  color: #fff !important;
  background: rgba(75, 191, 191, 0.15);
  border-left: 3px solid var(--nc-teal);
}

[data-menu-color="dark"] .menu-title {
  color: rgba(200, 216, 228, 0.45) !important;
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Logo area */
.logo-box {
  background: var(--nc-sidebar-bg) !important;
  border-bottom: 1px solid rgba(75, 191, 191, 0.12);
}

.logo-text-lg {
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  vertical-align: middle;
  letter-spacing: -0.3px;
}

/* Sidebar icon colors */
[data-menu-color="dark"] .nav-icon iconify-icon {
  color: rgba(75, 191, 191, 0.7);
  font-size: 20px;
}

[data-menu-color="dark"] #sidebar-menu > ul > li > a:hover .nav-icon iconify-icon {
  color: var(--nc-teal);
}

/* ═══════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════ */
.topbar-custom {
  border-bottom: 1px solid #e3e6f0;
}

/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */
.btn-primary {
  background-color: var(--nc-teal) !important;
  border-color: var(--nc-teal) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--nc-teal-dark) !important;
  border-color: var(--nc-teal-dark) !important;
}

.btn-outline-primary {
  color: var(--nc-teal) !important;
  border-color: var(--nc-teal) !important;
}

.btn-outline-primary:hover {
  background-color: var(--nc-teal) !important;
  color: #fff !important;
}

.bg-primary {
  background-color: var(--nc-teal) !important;
}

.text-primary {
  color: var(--nc-teal) !important;
}

.bg-primary-subtle {
  background-color: rgba(75, 191, 191, 0.12) !important;
}

/* ═══════════════════════════════════════════════════
   CARDS & WIDGETS
   ═══════════════════════════════════════════════════ */
.card {
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* KPI stat cards */
.nc-stat-card {
  position: relative;
  overflow: hidden;
}

.nc-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: rgba(75, 191, 191, 0.08);
  border-radius: 0 0 0 80px;
}

.nc-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.nc-stat-icon.teal { background: rgba(75, 191, 191, 0.12); color: var(--nc-teal); }
.nc-stat-icon.navy { background: rgba(44, 95, 138, 0.12); color: var(--nc-primary); }
.nc-stat-icon.success { background: rgba(34, 197, 94, 0.12); color: #22C55E; }
.nc-stat-icon.warning { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.nc-stat-icon.danger { background: rgba(239, 68, 68, 0.12); color: #EF4444; }

/* ═══════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════ */
.badge.bg-success-subtle {
  background-color: rgba(34, 197, 94, 0.12) !important;
  color: #22C55E !important;
}

.badge.bg-warning-subtle {
  background-color: rgba(245, 158, 11, 0.12) !important;
  color: #F59E0B !important;
}

.badge.bg-danger-subtle {
  background-color: rgba(239, 68, 68, 0.12) !important;
  color: #EF4444 !important;
}

.badge.bg-info-subtle {
  background-color: rgba(75, 191, 191, 0.12) !important;
  color: var(--nc-teal) !important;
}

/* ═══════════════════════════════════════════════════
   PAGE TITLE
   ═══════════════════════════════════════════════════ */
.page-title-box .page-title {
  font-weight: 600;
  color: var(--nc-dark);
}

.breadcrumb-item a {
  color: var(--nc-teal);
}

/* ═══════════════════════════════════════════════════
   TABLES (DataTables)
   ═══════════════════════════════════════════════════ */
.table > thead {
  background-color: var(--nc-light);
}

.table > thead > tr > th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
}

/* ═══════════════════════════════════════════════════
   NOCISENSE UTILITIES
   ═══════════════════════════════════════════════════ */
.nc-gradient-teal {
  background: linear-gradient(135deg, var(--nc-teal), var(--nc-teal-dark));
}

.nc-gradient-navy {
  background: linear-gradient(135deg, var(--nc-primary), #1a3a57);
}

.nc-gradient-dark {
  background: linear-gradient(135deg, #0f1923, #1a2d3d);
}

/* Signal quality indicators */
.signal-good { color: #22C55E; }
.signal-fair { color: #F59E0B; }
.signal-noisy { color: #EF4444; }

/* Loading spinner */
.nc-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(75, 191, 191, 0.2);
  border-top-color: var(--nc-teal);
  border-radius: 50%;
  animation: nc-spin 0.8s linear infinite;
}

@keyframes nc-spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid #e3e6f0;
  background: #fff;
}

/* ═══════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════ */
[data-bs-theme="dark"] .card {
  background-color: #1a2332;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .topbar-custom {
  background: #151e28;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .footer {
  background: #151e28;
  border-top-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .table > thead {
  background-color: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .table > thead > tr > th {
  color: #94a3b8;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .nc-stat-card::after {
  background: rgba(75, 191, 191, 0.05);
}

[data-bs-theme="dark"] .content-page {
  background: #111922;
}

[data-bs-theme="dark"] .breadcrumb-item.active {
  color: #94a3b8;
}

/* ═══════════════════════════════════════════════════
   TRANSITIONS
   ═══════════════════════════════════════════════════ */
.card {
  transition: box-shadow 0.2s ease;
}

.btn {
  transition: all 0.15s ease;
}

.nc-stat-icon {
  transition: transform 0.2s ease;
}

.nc-stat-card:hover .nc-stat-icon {
  transform: scale(1.08);
}

/* ═══════════════════════════════════════════════════
   DATATABLES STYLING
   ═══════════════════════════════════════════════════ */
.dataTables_wrapper .dataTables_filter input {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_length select {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 0.25rem 2rem 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--nc-teal) !important;
  border-color: var(--nc-teal) !important;
  color: #fff !important;
  border-radius: 6px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: rgba(75, 191, 191, 0.1) !important;
  border-color: transparent !important;
  color: var(--nc-teal) !important;
}

/* ═══════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════ */
.btn-login {
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  border-radius: 8px;
  font-size: 0.95rem;
}

.auth-alert {
  border-radius: 8px;
  font-size: 0.85rem;
  animation: nc-shake 0.3s ease-in-out;
}

@keyframes nc-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* ═══════════════════════════════════════════════════
   PAINBRAIN — ICONIC TOPBAR BUTTON
   ═══════════════════════════════════════════════════ */
.nc-painbrain-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #fff !important;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
  box-shadow: 0 2px 10px rgba(99,102,241,0.25);
}
.nc-painbrain-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  color: #fff !important;
}
.nc-pb-icon { font-size: 18px; filter: drop-shadow(0 0 4px rgba(255,255,255,0.3)); }
.nc-pb-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: rgba(99,102,241,0.2);
  animation: nc-pb-pulse 2.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes nc-pb-pulse {
  0%,100% { opacity: 0; transform: translate(-50%,-50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%,-50%) scale(1.15); }
}

/* ═══════════════════════════════════════════════════
   PAINBRAIN — FLOATING AI WIDGET (every page)
   ═══════════════════════════════════════════════════ */
.nc-pb-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.nc-pb-float-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
  transition: all 0.25s;
  text-decoration: none;
  border: none;
}
.nc-pb-float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(99,102,241,0.45);
  color: #fff;
}
.nc-pb-float-tip {
  background: #1E2E3B;
  color: #e2e8f0;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s;
  pointer-events: none;
}
.nc-pb-float:hover .nc-pb-float-tip {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════
   PAINBRAIN — INLINE AI INSIGHT CARDS
   ═══════════════════════════════════════════════════ */
.nc-ai-card {
  border-radius: 14px;
  border: 1px solid rgba(99,102,241,0.15);
  background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.02));
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.nc-ai-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #6366F1, #8B5CF6);
  border-radius: 3px 0 0 3px;
}
.nc-ai-card .nc-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 6px;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR LOGO — color only, don't override layout
   Template expects: height:70px; position:fixed;
   top:0; width:260px; padding:0 20px
   ═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  .nc-pb-float { bottom: 16px; right: 16px; }
  .nc-pb-float-btn { width: 44px; height: 44px; font-size: 20px; }
}

@media (max-width: 575.98px) {
  .nc-stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}
