/* ========================================
   Cloud Cost Compass - Styles
   Matched to bentsionweiss.com design system
   ======================================== */

/* --- Reset & Base (mirrors main site) --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a1a;
  background: #f8f8f8;
}

a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: #1d4ed8; }

/* --- Header (matches main site header) --- */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1.5rem 0;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.header-left { flex: 1; }

.back-link {
  font-size: 0.85rem;
  color: #6b7280;
  display: inline-block;
  margin-bottom: 0.35rem;
}
.back-link:hover { color: #2563eb; }

.header__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.15em;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

.header__subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  margin: 0;
}

.header-right {
  text-align: right;
  display: flex;
  align-items: center;
  padding-top: 0.5rem;
}

.header__disclaimer {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}


/* --- Container --- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main.container {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* --- Section Titles (JetBrains Mono, uppercase, small - matches main site) --- */
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin: 0 0 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}

.section-desc {
  color: #6b7280;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* --- Wizard --- */
.wizard {
  margin-bottom: 2.5rem;
}

.wizard__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.wizard__tile {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wizard__tile:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.wizard__tile--active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.wizard__tile-icon {
  font-size: 1.5rem;
  color: #2563eb;
  margin-bottom: 6px;
}

.wizard__tile-label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
  color: #1a1a1a;
  display: block;
}

.wizard__tile-desc {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.45;
}

.wizard__scale {
  margin-top: 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.wizard__scale-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
}

.wizard__scale-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* --- Configuration Panel --- */
.config {
  margin-bottom: 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.config .section-title {
  grid-column: 1 / -1;
}

.config__group {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
}


.config__group-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.config__row {
  margin-bottom: 1.15rem;
}

.config__row:last-child {
  margin-bottom: 0;
}

.config__row label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: #374151;
  flex-wrap: wrap;
}

.config__hint {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-left: 6px;
}

.config__input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.config__row--toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.config__row--toggle label {
  margin-bottom: 0;
}

.config__value {
  font-weight: 700;
  color: #1a1a1a;
  min-width: 36px;
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.config__select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.config__number {
  width: 110px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #1a1a1a;
  background: #fff;
}

.config__number:focus {
  outline: none;
  border-color: #2563eb;
}

.config__select:focus {
  outline: none;
  border-color: #2563eb;
}

/* --- Range Slider --- */
.config__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #e5e7eb;
  outline: none;
}

.config__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25);
  transition: transform 0.15s ease;
}

.config__slider::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

.config__slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25);
}

.scale-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.scale-btn {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.scale-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.scale-btn--active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 600;
}

/* --- Toggle Switch --- */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #d1d5db;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle__slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

.toggle input:checked + .toggle__slider {
  background: #2563eb;
}

.toggle input:checked + .toggle__slider::before {
  transform: translateX(20px);
}

/* --- Tooltip --- */
.tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.info-icon {
  font-size: 15px;
  color: #9ca3af;
  transition: color 0.2s ease;
}

.tooltip-trigger:hover .info-icon {
  color: #2563eb;
}

.tooltip-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #f8f8f8;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 6px;
  width: 280px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  pointer-events: none;
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
}

.tooltip-trigger:hover .tooltip-text {
  display: block;
}

/* --- DB Storage Row visibility --- */
#db-storage-row.hidden {
  opacity: 0.3;
  pointer-events: none;
  transition: opacity 0.2s ease;
}


/* --- Chart Section --- */
.chart-section {
  margin-bottom: 2.5rem;
}

.chart-container {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem 1.25rem;
  position: relative;
  max-height: 420px;
}

/* --- Provider Cards --- */
.cards {
  margin-bottom: 2.5rem;
}

.cards__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.card--best {
  border-color: #16a34a;
  box-shadow: 0 0 0 1px #16a34a;
}

.card__badge {
  display: none;
  position: absolute;
  top: -11px;
  right: 12px;
  background: #16a34a;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
}

.card--best .card__badge {
  display: block;
}

.card__provider {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1a1a1a;
}

.card__provider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.card__driver {
  margin-bottom: 0.75rem;
}

.card__driver-label {
  font-size: 0.75rem;
  color: #6b7280;
  display: block;
  margin-bottom: 0.35rem;
}

.card__driver-bar {
  height: 6px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}

.card__driver-bar span {
  display: block;
  height: 100%;
  background: #2563eb;
  width: 0%;
}

.card__line {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 5px 0;
  border-bottom: 1px solid #f3f4f6;
  color: #6b7280;
}

.card__line:last-of-type {
  border-bottom: none;
}

.card__line-amount {
  font-weight: 600;
  color: #374151;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.card__total {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.card__total-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  font-family: 'JetBrains Mono', monospace;
}

.card__total-amount {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a1a;
  font-family: 'JetBrains Mono', monospace;
}

/* --- Insights Panel --- */
.insights {
  margin-bottom: 2.5rem;
}

.insights__content {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid #2563eb;
}

.insight-item {
  padding: 7px 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #374151;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.insight-item + .insight-item {
  border-top: 1px solid #f3f4f6;
}

.insight-item .material-icons {
  font-size: 18px;
  color: #2563eb;
  flex-shrink: 0;
  margin-top: 3px;
}

.insight-item strong {
  color: #1a1a1a;
}

/* --- Footer (matches main site footer) --- */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.site-footer a { color: #6b7280; }
.site-footer a:hover { color: #2563eb; }
.site-footer p { margin: 0 0 0.25em; }
.site-footer p:last-child { margin-bottom: 0; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .cards__grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .header-right {
    text-align: left;
    padding-top: 0;
  }

  .wizard__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .config {
    grid-template-columns: 1fr;
  }

  .wizard__scale {
    flex-direction: column;
    align-items: flex-start;
  }


  .cards__grid {
    grid-template-columns: 1fr;
  }

  main.container {
    padding: 1.5rem 1rem 2rem;
  }

  .tooltip-text {
    width: 220px;
    left: auto;
    right: -8px;
    transform: none;
  }

  .tooltip-text::after {
    left: auto;
    right: 14px;
    transform: none;
  }
}

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

  .header__title {
    font-size: 1.4rem;
  }

}

@media print {
  body { background: #fff; }
  .site-header { border-bottom-color: #ccc; }
  .site-footer { border-top-color: #ccc; }
  .wizard__tile:hover { border-color: #e5e7eb; box-shadow: none; }
  .card:hover { box-shadow: none; }
}
