/* ==========================================================================
   Finanzads — E-Commerce Profitability & Unit Economics SaaS Suite
   Custom Dark Mode Styles & Micro-interactions
   ========================================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.78);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.55);
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-cyan: #06b6d4;
  --accent-violet: #8b5cf6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 48%),
    radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.09) 0px, transparent 45%),
    radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  color: #f8fafc;
  overflow-x: hidden;
}

.font-mono-num {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* Glassmorphism SaaS Cards */
.saas-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.saas-card:hover {
  border-color: rgba(148, 163, 184, 0.22);
}

.saas-card-interactive:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px -10px rgba(99, 102, 241, 0.15);
}

/* Custom Range Sliders */
input[type="range"].fin-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(51, 65, 85, 0.8);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

input[type="range"].fin-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1;
  border: 2px solid #e0e7ff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

input[type="range"].fin-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #818cf8;
}

input[type="range"].fin-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1;
  border: 2px solid #e0e7ff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

/* Number Input Clean Styling */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.4;
}

.fin-input {
  background: rgba(9, 13, 22, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: all 0.18s ease;
}

.fin-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  outline: none;
  background: rgba(9, 13, 22, 0.95);
}

/* Interactive Stacked Cost Breakdown Bar */
.cost-bar-container {
  position: relative;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  width: 100%;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}

.cost-bar-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.cost-bar-segment:hover {
  filter: brightness(1.18);
  z-index: 10;
}

.cost-bar-segment.active-segment {
  filter: brightness(1.22);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}

/* Subtle diagonal stripes for loss or return segments */
.pattern-diagonal {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.08) 8px,
    transparent 8px,
    transparent 16px
  );
}

/* Highlight pulse when segment is clicked */
@keyframes ringPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

.highlight-pulse {
  animation: ringPulse 1.1s ease-out;
  border-color: #818cf8 !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #090d16;
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Print Fallback Styling */
@media print {
  body {
    background: #090d16 !important;
    color: #f8fafc !important;
  }
  .no-print {
    display: none !important;
  }
}
