@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap");

:root {
  /* Colors */
  --bg-base: #05070D;
  --bg-surface: rgba(10, 15, 26, 0.6);
  --bg-card: rgba(16, 24, 39, 0.4);
  --bg-sidebar: rgba(5, 7, 13, 0.85);

  --primary: #00BFFF;
  --primary-hover: #00AEEF;
  --primary-active: #00D4FF;
  --primary-gradient: linear-gradient(135deg, #00BFFF, #009DFF);
  --primary-glow: rgba(0, 191, 255, 0.35);

  --secondary: #00AEEF;
  --secondary-glow: rgba(0, 174, 239, 0.25);
  
  --accent: #00D4FF;
  --accent-glow: rgba(0, 212, 255, 0.25);

  --success: #00E676;
  --success-bg: rgba(0, 230, 118, 0.1);
  --success-border: rgba(0, 230, 118, 0.25);

  --warning: #FFAB00;
  --warning-bg: rgba(255, 171, 0, 0.1);
  --warning-border: rgba(255, 171, 0, 0.25);

  --danger: #FF1744;
  --danger-bg: rgba(255, 23, 68, 0.1);
  --danger-border: rgba(255, 23, 68, 0.25);

  --text-primary: #FFFFFF;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 191, 255, 0.15);
  --border-active: #00BFFF;

  /* Typography */
  --font-sans: "Plus Jakarta Sans", "Outfit", system-ui, -apple-system, sans-serif;
  --font-heading: "Outfit", "Plus Jakarta Sans", system-ui, sans-serif;

  /* Shadows */
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.8), 0 0 2px rgba(255, 255, 255, 0.08) inset;
  --shadow-primary: 0 0 20px 0 rgba(0, 191, 255, 0.25);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  /* Transitions */
  --transition-speed: 200ms;
}

/* Base Styles */
* {
  box-sizing: border-box;
  font-family: var(--font-sans);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
  margin: 0;
  padding: 0;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

body {
  background-color: var(--bg-base) !important;
  color: var(--text-primary) !important;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(at 0% 0%, rgba(0, 191, 255, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 174, 239, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(5, 7, 13, 0.5) 0px, transparent 100%) !important;
  min-height: 100vh;
  overflow-x: hidden;
}

#root {
  min-height: 100vh;
  display: flex;
}

.app-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
}

/* Sidebar Styles */
.sidebar {
  background: var(--bg-sidebar) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
  z-index: 100;
  flex-direction: column;
  width: 260px;
  height: 100vh;
  padding: 24px 16px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  position: fixed;
}

.sidebar.collapsed {
  width: 76px;
  padding: 24px 10px;
}

.sidebar.collapsed .logo-container {
  justify-content: center;
  margin-bottom: 24px;
  padding-left: 0;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding: 12px 0;
}

.logo-container {
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  padding-left: 8px;
  display: flex;
}

.logo-icon {
  background: var(--primary-gradient) !important;
  color: #fff;
  width: 38px;
  height: 38px;
  box-shadow: 0 0 15px rgba(0, 191, 255, 0.4) !important;
  border-radius: 10px;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  font-weight: 800;
  display: flex;
}

.logo-text {
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff, #a5e2f9);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  font-size: 22px;
  font-weight: 700;
}

.nav-links {
  flex-direction: column;
  gap: 8px;
  list-style: none;
  display: flex;
}

.nav-item {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  display: flex;
}

.nav-item:hover {
  color: #FFFFFF !important;
  background: rgba(255, 255, 255, 0.05) !important;
  transform: translateX(2px);
}

.nav-item.active {
  color: #FFFFFF !important;
  border-color: rgba(0, 191, 255, 0.2) !important;
  box-shadow: inset 3px 0 0 0 var(--primary), 0 0 15px rgba(0, 191, 255, 0.1) !important;
  background: linear-gradient(90deg, rgba(0, 191, 255, 0.12), rgba(0, 174, 239, 0.03)) !important;
}

.nav-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* Main Content Styles */
.main-content {
  flex: 1;
  min-width: 0;
  max-width: calc(100vw - 260px);
  min-height: 100vh;
  margin-left: 260px;
  padding: 24px;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s;
  display: flex;
  flex-direction: column;
}

.main-content.collapsed {
  max-width: calc(100vw - 76px);
  margin-left: 76px;
}

.page-header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  display: flex;
}

.page-title {
  font-family: var(--font-heading);
  letter-spacing: -0.5px;
  color: #fff;
  font-size: 32px;
  font-weight: 700;
}

/* Card Premium / Glass Panels */
.card-premium {
  background: rgba(10, 15, 26, 0.55) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 24px;
  transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1), border-color var(--transition-speed), box-shadow var(--transition-speed) !important;
  position: relative;
  overflow: hidden;
}

.card-premium:before {
  content: "";
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  width: 100%;
  height: 2px;
  transition: opacity var(--transition-speed);
  position: absolute;
  top: 0;
  left: 0;
}

.card-premium:hover {
  border-color: rgba(0, 191, 255, 0.35) !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0, 191, 255, 0.15) !important;
}

.card-premium:hover:before {
  opacity: 1;
}

/* KPI Cards */
.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
  display: grid;
}

.kpi-card {
  flex-direction: column;
  gap: 8px;
  display: flex;
}

.kpi-header {
  justify-content: space-between;
  align-items: center;
  display: flex;
}

.kpi-title {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 14px;
  font-weight: 600;
}

.kpi-icon-wrapper {
  border-radius: 10px;
  justify-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  display: flex;
}

.kpi-value {
  font-family: var(--font-heading);
  color: #fff;
  margin-top: 4px;
  font-size: 28px;
  font-weight: 700;
}

.kpi-subtext {
  color: var(--text-muted);
  font-size: 13px;
}

/* Charts */
.charts-grid {
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
  display: grid;
}

@media (max-width: 1100px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  flex-direction: column;
  height: 360px;
  display: flex;
}

.chart-title {
  color: #fff;
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 600;
}

/* Modals */
.modal-overlay {
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  z-index: 1000;
  background: rgba(3, 7, 18, 0.85) !important;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  animation: 0.3s fadeIn;
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
}

.modal-content {
  border-radius: var(--radius-lg) !important;
  width: 480px;
  max-width: 90%;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.95), 0 0 20px rgba(0, 191, 255, 0.25) !important;
  background: rgba(10, 15, 26, 0.85) !important;
  backdrop-filter: blur(25px) !important;
  border: 1px solid rgba(0, 191, 255, 0.2) !important;
  padding: 36px;
  animation: 0.3s cubic-bezier(0.16, 1, 0.3, 1) scaleIn;
  position: relative;
}

/* Forms and Inputs */
.form-group {
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  display: flex;
}

.form-label {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.form-input {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-sm) !important;
  color: #fff !important;
  box-sizing: border-box;
  background: rgba(5, 7, 13, 0.6) !important;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  transition: all var(--transition-speed) ease-in-out !important;
}

.form-input:focus {
  border-color: var(--primary) !important;
  background: rgba(0, 191, 255, 0.04) !important;
  outline: none;
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.35) !important;
}

input.form-input, select.form-input {
  height: 46px;
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

select.form-input option {
  color: #f3f4f6;
  background-color: #0a0f1a;
}

/* Buttons */
.btn {
  border-radius: 20px !important; /* Premium pill style */
  cursor: pointer;
  border: 1px solid transparent;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
}

.btn-primary {
  background: var(--primary-gradient) !important;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(0, 191, 255, 0.4) !important;
  border: none !important;
}

.btn-primary:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(0, 191, 255, 0.6) !important;
}

.btn-primary:active {
  transform: translateY(1px) !important;
}

.btn-secondary {
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Tables */
.table-container {
  border-radius: var(--radius-md) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  background: rgba(10, 15, 26, 0.45) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  width: 100%;
  max-width: 100%;
  margin-top: 16px;
  overflow-x: auto;
  box-shadow: var(--shadow-lg) !important;
}

.data-table {
  border-collapse: collapse;
  text-align: left;
  width: 100%;
  font-size: 13px; /* slight text size improvement for enterprise readability */
}

.data-table th {
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 14px; /* clean layout padding */
  font-size: 11px;
  font-weight: 600;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s, color 0.2s;
}

.data-table th.sortable:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.data-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  padding: 12px 14px;
  transition: background-color 0.2s ease;
}

.data-table tr:hover td {
  background: rgba(0, 191, 255, 0.03) !important;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Badges */
.badge {
  border: 1px solid transparent;
  border-radius: 20px;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
}

.badge-success {
  background: var(--success-bg) !important;
  border-color: var(--success-border) !important;
  color: var(--success) !important;
}

.badge-warning {
  background: var(--warning-bg) !important;
  border-color: var(--warning-border) !important;
  color: var(--warning) !important;
}

.badge-danger {
  background: var(--danger-bg) !important;
  border-color: var(--danger-border) !important;
  color: var(--danger) !important;
}

/* Search bar */
.search-bar-wrapper {
  align-items: center;
  width: 100%;
  max-width: 450px;
  display: flex;
  position: relative;
}

.search-bar-wrapper .search-icon {
  color: var(--text-secondary);
  pointer-events: none;
  transition: color 0.2s;
  position: absolute;
  left: 14px;
}

.search-bar-wrapper:focus-within .search-icon {
  color: var(--primary);
}

.search-bar-wrapper .search-input {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-sm) !important;
  color: #fff !important;
  background: rgba(5, 7, 13, 0.6) !important;
  outline: none;
  width: 100%;
  height: 42px;
  padding: 10px 16px 10px 42px;
  font-size: 14px;
  transition: all var(--transition-speed) ease-in-out !important;
}

.search-bar-wrapper .search-input:focus {
  border-color: var(--primary) !important;
  background: rgba(0, 191, 255, 0.04) !important;
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.35) !important;
}

/* ==========================================
   CUSTOM OVERRIDES FOR SETUP WIZARD (INLINE RENDERED)
   ========================================== */

/* Background wrapper override */
div[style*="radial-gradient"] {
  background: var(--bg-base) !important;
  background-image: 
    radial-gradient(at 0% 0%, rgba(0, 191, 255, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 174, 239, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(5, 7, 13, 0.5) 0px, transparent 100%) !important;
  font-family: var(--font-sans) !important;
}

/* Inner setup card overlay */
div[style*="max-width: 580px"] {
  background: rgba(10, 15, 26, 0.55) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(0, 191, 255, 0.2) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 191, 255, 0.1) !important;
  box-sizing: border-box !important;
  padding: 40px 32px !important;
}

/* Logo icon inside setup wizard */
div[style*="width: 64px"][style*="linear-gradient"] {
  background: var(--primary-gradient) !important;
  border-radius: 12px !important;
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.45) !important;
}

/* Steps container glass effect */
div[style*="justify-content: space-between"][style*="position: relative"] {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 12px !important;
  padding: 12px 24px !important;
  margin-bottom: 32px !important;
}

/* Step connector line */
div[style*="position: absolute"][style*="top: 16px"][style*="height: 2px"] {
  background: rgba(255, 255, 255, 0.06) !important;
  top: 26px !important; /* realigned to center of the step dots */
  left: 48px !important;
  right: 48px !important;
}

/* Step circles */
div[style*="width: 32px"][style*="height: 32px"] {
  border-radius: 8px !important; /* rounded square styling to match modern Fluent UI */
  font-family: var(--font-heading) !important;
  transition: all 0.25s ease-out !important;
  width: 30px !important;
  height: 30px !important;
  border-width: 1px !important;
}

/* Active Step */
div[style*="width: 32px"][style*="height: 32px"][style*="rgb(59, 130, 246)"],
div[style*="width: 32px"][style*="height: 32px"][style*="#3b82f6"] {
  background: var(--primary-gradient) !important;
  border-color: rgba(0, 191, 255, 0.4) !important;
  box-shadow: 0 0 15px rgba(0, 191, 255, 0.4) !important;
}

/* Completed Step */
div[style*="width: 32px"][style*="height: 32px"][style*="rgb(16, 185, 129)"],
div[style*="width: 32px"][style*="height: 32px"][style*="#10b981"] {
  background: #00E676 !important;
  border-color: rgba(0, 230, 118, 0.4) !important;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.25) !important;
}

/* Inactive Step */
div[style*="width: 32px"][style*="height: 32px"][style*="rgba(17, 24, 39, 0.8)"] {
  background: rgba(5, 7, 13, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.3) !important;
}

/* Labels below steps */
span[style*="font-size: 12px"] {
  font-family: var(--font-heading) !important;
  font-size: 11px !important;
  letter-spacing: 0.2px !important;
}

/* Form input elements inside wizard */
div[style*="max-width: 580px"] input,
div[style*="max-width: 580px"] select {
  background: rgba(5, 7, 13, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  color: #FFFFFF !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  width: 100% !important;
  height: 44px !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease-in-out !important;
}

div[style*="max-width: 580px"] input:focus {
  border-color: #00BFFF !important;
  background: rgba(0, 191, 255, 0.03) !important;
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.4) !important;
  outline: none !important;
}

/* Buttons inside Setup Wizard */
div[style*="max-width: 580px"] button,
div[style*="max-width: 580px"] .btn {
  border-radius: 20px !important;
  padding: 12px 28px !important;
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  height: 42px !important;
  line-height: 1 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Primary actions inside wizard */
div[style*="max-width: 580px"] button:not(:disabled):not([style*="255, 255, 255"]):not(.btn-secondary) {
  background: var(--primary-gradient) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(0, 191, 255, 0.4) !important;
}

div[style*="max-width: 580px"] button:not(:disabled):not([style*="255, 255, 255"]):not(.btn-secondary):hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(0, 191, 255, 0.6) !important;
}

/* Secondary/Disabled buttons inside wizard */
div[style*="max-width: 580px"] button:disabled {
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Secondary buttons inside wizard (e.g. Test Connection) */
div[style*="max-width: 580px"] button[style*="255, 255, 255"]:not(:disabled),
div[style*="max-width: 580px"] .btn-secondary {
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

div[style*="max-width: 580px"] button[style*="255, 255, 255"]:not(:disabled):hover,
div[style*="max-width: 580px"] .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Error and success message overlays inside wizard */
div[style*="rgba(16, 185, 129, 0.15)"] {
  background: var(--success-bg) !important;
  border: 1px solid var(--success-border) !important;
  color: #00E676 !important;
  border-radius: 8px !important;
}

div[style*="rgba(239, 68, 68, 0.15)"] {
  background: var(--danger-bg) !important;
  border: 1px solid var(--danger-border) !important;
  color: #FF1744 !important;
  border-radius: 8px !important;
}

/* ==========================================
   ANIMATIONS & TRANSITIONS
   ========================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Micro-animations and hover transitions under 250ms */
.fade-in {
  animation: fadeIn 200ms ease-out forwards;
}

.slide-up {
  animation: scaleIn 220ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
