/* ==========================================================================
   GETVITRUX — DASHBOARD DESIGN SYSTEM v1
   ========================================================================== */

/* ─── BASE VARIABLES (LIGHT MODE DEFAULT) ─── */
.dashboard-theme {
  --bg-body: #F5F7FB;
  --bg-surface: #FFFFFF;
  --bg-card-glass: #FFFFFF;
  --bg-secondary: #FFFFFF;
  --bg-sidebar: #0C1327;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --border-color: rgba(15, 23, 42, .06);
  --shadow-standard: 0 12px 30px rgba(15, 23, 42, .08);
  --shadow-elevated: 0 20px 45px rgba(15, 23, 42, .12);
  --shadow-hover: 0 30px 60px rgba(15, 23, 42, .15);
  
  --color-primary: #6D4CFF;
  --color-primary-hover: #8A63FF;
  --color-success: #00D28A;
  --color-warning: #FFB84C;
  --color-danger: #FF5A76;
  --color-info: #4DA3FF;
  
  /* Blur & FX */
  --card-blur: blur(0px); /* Light mode usually doesn't need heavy blur if solid bg */
  --radius-sm: 10px;
  --radius-btn: 14px;
  --radius-card: 20px;
  --radius-pill: 999px;

  /* Typography */
  --fw-title: 700;
}

/* ─── DARK MODE VARIABLES ─── */
html.dark body.dashboard-theme {
  --bg-body: #0A0F1F;
  --bg-surface: #11182D;
  --bg-card-glass: rgba(17, 24, 45, .78);
  --bg-secondary: #18213D;
  --bg-sidebar: #0C1327;
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, .65);
  --border-color: rgba(255, 255, 255, .06);
  --shadow-standard: 0 12px 30px rgba(0, 0, 0, .18);
  --shadow-elevated: 0 20px 45px rgba(0, 0, 0, .28);
  --shadow-hover: 0 30px 60px rgba(0, 0, 0, .35);
  
  --card-blur: blur(18px);
}

/* ─── GLOBAL BACKGROUND EFFECTS ─── */
body.dashboard-theme {
  background-color: var(--bg-body);
  color: var(--text-primary);
  transition: all 0.25s ease;
  min-height: 100vh;
}

html.dark body.dashboard-theme {
  background-image: 
    radial-gradient(circle at top left, rgba(109,76,255,.12), transparent 40%),
    radial-gradient(circle at bottom right, rgba(0,210,138,.06), transparent 35%);
  background-color: #0A0F1F;
  background-attachment: fixed;
}

/* ─── CARDS ─── */
.dashboard-theme .dashboard-card {
  background: var(--bg-card-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-standard);
  transition: all 0.25s ease;
}

html.dark body.dashboard-theme .dashboard-card {
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
}

.dashboard-theme .dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ─── BUTTONS ─── */
.dashboard-theme .dashboard-btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  border-radius: var(--radius-btn);
  box-shadow: 0 4px 14px rgba(109, 76, 255, .15);
  color: #fff;
  border: none;
  font-weight: 600;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem; /* Equivalent to px-6 py-3 */
}

.dashboard-theme .dashboard-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(109, 76, 255, .25);
}

/* ─── SIDEBAR ─── */
.dashboard-theme .dashboard-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255,255,255,.06);
  transition: transform 300ms ease;
  color: rgba(255,255,255,0.65);
}

.dashboard-theme .dashboard-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  color: rgba(255,255,255,0.65);
  transition: all 0.25s ease;
  border: 1px solid transparent;
  position: relative;
}

.dashboard-theme .dashboard-sidebar-item:hover:not(.active) {
  background: rgba(255,255,255,.04);
  color: #fff;
}

/* Active item */
.dashboard-theme .dashboard-sidebar-item.active {
  background: rgba(109, 76, 255, .14);
  border: 1px solid rgba(109, 76, 255, .22);
  box-shadow: 0 0 20px rgba(109, 76, 255, .25);
  color: #fff;
}

.dashboard-theme .dashboard-sidebar-item.active::before {
  content: '';
  position: absolute;
  left: -2px; /* Pull slightly out of padding */
  top: 50%;
  transform: translateY(-50%);
  height: 60%;
  width: 4px;
  background: var(--color-primary);
  border-radius: 0 4px 4px 0;
}

/* ─── KPI CARDS ─── */
.dashboard-theme .dashboard-kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-standard);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
}

html.dark body.dashboard-theme .dashboard-kpi {
  background: linear-gradient(145deg, #131C34, #101729);
}

.dashboard-theme .dashboard-kpi:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
}

/* Success KPI overrides */
html.dark body.dashboard-theme .dashboard-kpi.kpi-success {
  border: 1px solid rgba(0, 210, 138, .35);
  box-shadow: 0 0 24px rgba(0, 210, 138, .12);
}

.dashboard-theme .dashboard-kpi.kpi-success .kpi-icon-wrap {
  background: rgba(0, 210, 138, .1) !important;
  color: var(--color-success) !important;
}

/* ─── TYPOGRAPHY ─── */
.dashboard-theme h1, 
.dashboard-theme h2, 
.dashboard-theme h3,
.dashboard-theme h4 {
  font-weight: var(--fw-title);
  color: var(--text-primary);
}

.dashboard-theme .text-secondary {
  color: var(--text-secondary);
}

/* ─── FLOATING ACTION BAR ─── */
.dashboard-theme .dashboard-fab {
  background: rgba(18, 22, 40, .82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-color);
  box-shadow: 0 0 35px rgba(109, 76, 255, .15);
  border-radius: var(--radius-pill);
  color: #fff;
}

/* Fix text colors inside cards when in light mode vs dark mode */
.dashboard-theme .dashboard-card p, .dashboard-theme .dashboard-kpi p {
  color: var(--text-secondary);
}
.dashboard-theme .dashboard-card .title, .dashboard-theme .dashboard-kpi .title {
  color: var(--text-primary);
}

/* Global transitions */
.dashboard-theme a, .dashboard-theme button {
  transition: all 0.25s ease;
}

/* ─── HEADER ─── */
.dashboard-theme .dashboard-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
}

html.dark body.dashboard-theme .dashboard-header {
  background: rgba(17, 24, 45, .8);
}

/* ─── INPUTS & FORMS ─── */
.dashboard-theme .dashboard-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  transition: all 0.25s ease;
  width: 100%;
}

.dashboard-theme .dashboard-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(109, 76, 255, 0.15);
}

.dashboard-theme .dashboard-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ─── SECONDARY & DANGER BUTTONS ─── */
.dashboard-theme .dashboard-btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
}

.dashboard-theme .dashboard-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.dashboard-theme .dashboard-btn-danger {
  background: rgba(255, 90, 118, 0.1);
  border: 1px solid rgba(255, 90, 118, 0.2);
  border-radius: var(--radius-btn);
  color: var(--color-danger);
  font-weight: 600;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
}

.dashboard-theme .dashboard-btn-danger:hover {
  background: var(--color-danger);
  color: #fff;
  box-shadow: 0 10px 25px rgba(255, 90, 118, 0.3);
}

/* ─── TABLES ─── */
.dashboard-theme .dashboard-table-container {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.dashboard-theme .dashboard-table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}

.dashboard-theme .dashboard-table th {
  padding: 1rem 1.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.02);
}

html.dark body.dashboard-theme .dashboard-table th {
  background: rgba(255, 255, 255, 0.02);
}

.dashboard-theme .dashboard-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.dashboard-theme .dashboard-table tbody tr {
  transition: all 0.2s ease;
}

.dashboard-theme .dashboard-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.015);
}

html.dark body.dashboard-theme .dashboard-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}
