/* ==========================================================================
   WED2C Assistant - Custom Dashboard Styles
   ========================================================================== */

/* Root Design Tokens */
:root {
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  --surface-card: #ffffff;
  --surface-ground: #f8fafc;
  --border-subtle: #e2e8f0;
  --text-main: #0f172a;
  --text-muted-custom: #64748b;
  --radius-lg: 12px;
  --shadow-sm-custom: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md-custom: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

body {
  background-color: var(--surface-ground);
  color: var(--text-main);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* Modern Ambient Lighting + Micro Grid Blueprint Overlay */
  background-image: 
      /* Top-Left Soft Primary Ambient Glow */
      radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
      /* Top-Right Soft Indigo Ambient Glow */
      radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
      /* Subtle Technical Blueprint Grid (SVG Pattern) */
      url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h32v32H0z' fill='none'/%3E%3Cpath d='M32 0v32H0V0h32zM1 1v30h30V1H1z' fill='%2364748b' fill-opacity='0.035'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

/* Glassmorphism Polish for Main Cards & Containers */


/* Elevate Stat Cards with a Top Accent Border */
.col-md-3 .border.rounded-3 {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.col-md-3 .border.rounded-3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #3b82f6);
    opacity: 0.8;
}

.col-md-3 .border.rounded-3:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.06) !important;
}

/* Enhanced Sticky Glass Navbar */
.navbar.fixed-top {
    background: rgba(15, 23, 42, 0.92) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}



/* --- Card Elevate & Polish --- */
.card {
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm-custom);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover-effect:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover) !important;
}

/* --- Metric & Stat Cards Upgrade --- */
.border.rounded-3.bg-light,
.border.rounded-3.p-3 {
  border-color: var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  background-color: #ffffff !important;
  box-shadow: var(--shadow-sm-custom);
}

/* --- Custom Badge Aesthetics --- */
.badge {
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4em 0.75em;
  border-radius: 6px;
}

.badge.bg-primary-subtle {
  background-color: #e0e7ff !important;
  color: #4338ca !important;
}

.badge.bg-success-subtle {
  background-color: #dcfce7 !important;
  color: #15803d !important;
}

.badge.bg-warning-subtle {
  background-color: #fef9c3 !important;
  color: #a16207 !important;
}

/* --- Gradient Primary Button --- */
.btn-primary {
  background: var(--primary-gradient);
  border: none;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
  transition: all 0.2s ease;
}

.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

/* --- Form Input Refinement --- */
.form-control, .form-select {
  border-color: #cbd5e1;
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.925rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* --- Table Enhancements --- */
.table {
  border-color: var(--border-subtle);
}

.table thead th {
  background-color: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-subtle);
}

.table tbody td {
  padding: 0.9rem 1rem;
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: #f8fafc;
}

/* --- HTMX Request & Smooth Overlay --- */
.htmx-indicator { 
  display: none !important; 
}

.htmx-request .htmx-indicator, 
.htmx-request.htmx-indicator { 
  display: inline-block !important; 
}

.htmx-request .htmx-none { 
  display: none !important; 
}

#table-container.htmx-request { 
  pointer-events: none; 
  opacity: 0.55; 
  transition: opacity 0.25s ease-in-out; 
  position: relative; 
}

.table-overlay { 
  display: none; 
  position: absolute; 
  inset: 0; 
  z-index: 1000; 
  align-items: center; 
  justify-content: center; 
  background: rgba(255, 255, 255, 0.75); 
  backdrop-filter: blur(2px);
  border-radius: var(--radius-lg);
}

#table-container.htmx-request .table-overlay { 
  display: flex; 
}



/* --- Code & Tech Blocks --- */
code {
  color: #4338ca;
  background-color: #f1f5f9;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}