/* DimeStack Estimation Page Styles */
/* Version: 1.0.0 */
/* Date: April 15, 2026 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --ds-primary: #10b981;
  --ds-primary-dark: #059669;
  --ds-primary-light: #34d399;
  --ds-secondary: #6366f1;
  --ds-background: #0f172a;
  --ds-surface: #1e293b;
  --ds-surface-light: #334155;
  --ds-text: #f1f5f9;
  --ds-text-muted: #94a3b8;
  --ds-error: #ef4444;
  --ds-success: #10b981;
  --ds-border: #334155;
  --ds-shadow: rgba(0, 0, 0, 0.3);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--ds-background) 0%, #1e293b 100%);
  color: var(--ds-text);
  min-height: 100vh;
  line-height: 1.6;
}

.ds-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.ds-header {
  text-align: center;
  margin-bottom: 50px;
}

.ds-header h1 {
  font-size: 3em;
  color: var(--ds-text);
  margin-bottom: 15px;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.ds-header .ds-tagline {
  font-size: 1.3em;
  color: var(--ds-text-muted);
  font-weight: 400;
}

.ds-header .ds-logo {
  font-size: 4em;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.4));
}

#estimatePanel {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 8px 32px var(--ds-shadow);
  margin-bottom: 30px;
}

/* Step Indicator */
.ds-step-indicator {
  background: linear-gradient(135deg, var(--ds-primary) 0%, var(--ds-primary-dark) 100%);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  display: inline-block;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Progress Bar */
.ds-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--ds-surface-light);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 35px;
  position: relative;
}

.ds-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ds-primary) 0%, var(--ds-primary-light) 100%);
  transition: width 0.4s ease;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

/* Question Title */
.ds-question-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--ds-text);
}

.ds-question-label {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 25px;
  color: var(--ds-text-muted);
}

.ds-tooltip {
  font-size: 15px;
  color: var(--ds-primary-light);
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--ds-primary);
  border-radius: 6px;
}

/* Form Inputs */
.ds-input,
.ds-select,
.ds-textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--ds-background);
  border: 2px solid var(--ds-border);
  border-radius: 10px;
  color: var(--ds-text);
  font-size: 16px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.ds-input:focus,
.ds-select:focus,
.ds-textarea:focus {
  outline: none;
  border-color: var(--ds-primary);
  background: var(--ds-surface);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.ds-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 20px;
  padding-right: 40px;
}

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

/* Radio and Checkbox Groups */
.ds-radio-group,
.ds-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ds-radio-label,
.ds-checkbox-label {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: var(--ds-background);
  border: 2px solid var(--ds-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ds-radio-label:hover,
.ds-checkbox-label:hover {
  background: var(--ds-surface-light);
  border-color: var(--ds-primary);
}

.ds-radio-label input[type="radio"],
.ds-checkbox-label input[type="checkbox"] {
  margin-right: 12px;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--ds-primary);
}

.ds-radio-label input:checked ~ span,
.ds-checkbox-label input:checked ~ span {
  color: var(--ds-primary-light);
  font-weight: 600;
}

/* Slider */
.ds-slider {
  width: 100%;
  height: 8px;
  background: var(--ds-surface-light);
  border-radius: 10px;
  outline: none;
  margin: 10px 0;
  -webkit-appearance: none;
}

.ds-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--ds-primary);
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  transition: all 0.2s ease;
}

.ds-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.7);
}

.ds-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--ds-primary);
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  border: none;
  transition: all 0.2s ease;
}

.ds-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.7);
}

.ds-slider-value {
  text-align: center;
  margin-top: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ds-primary-light);
}

/* Navigation Buttons */
.ds-nav-buttons {
  display: flex;
  gap: 15px;
  margin-top: 35px;
}

.ds-btn {
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: inherit;
}

.ds-btn-primary {
  background: linear-gradient(135deg, var(--ds-primary) 0%, var(--ds-primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.ds-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.ds-btn-secondary {
  background: var(--ds-surface-light);
  color: var(--ds-text);
  border: 2px solid var(--ds-border);
}

.ds-btn-secondary:hover {
  background: var(--ds-surface);
  border-color: var(--ds-primary);
}

.ds-btn:active {
  transform: translateY(0);
}

/* Loading State */
.ds-loading {
  text-align: center;
  padding: 80px 20px;
}

.ds-loading h2 {
  color: var(--ds-text);
  font-size: 24px;
  margin: 20px 0 10px;
}

.ds-loading p {
  color: var(--ds-text-muted);
  font-size: 16px;
}

.ds-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  border: 4px solid var(--ds-surface-light);
  border-top: 4px solid var(--ds-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error State */
.ds-error-state {
  text-align: center;
  padding: 60px 20px;
}

.ds-error-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.ds-error-state h2 {
  color: var(--ds-error);
  font-size: 24px;
  margin-bottom: 15px;
}

.ds-error-state p {
  color: var(--ds-text-muted);
  margin-bottom: 25px;
}

.ds-error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--ds-error);
  color: var(--ds-error);
  padding: 12px 18px;
  border-radius: 8px;
  margin-top: 15px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Results Display */
.ds-results {
  text-align: center;
  padding: 40px 20px;
}

.ds-success-icon {
  font-size: 72px;
  margin-bottom: 20px;
  animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.ds-results h2 {
  font-size: 32px;
  color: var(--ds-text);
  margin-bottom: 15px;
}

.ds-estimate-id {
  color: var(--ds-text-muted);
  font-size: 14px;
  margin-bottom: 25px;
}

.ds-results-card {
  background: var(--ds-background);
  border: 2px solid var(--ds-primary);
  border-radius: 12px;
  padding: 30px;
  margin: 30px 0;
  text-align: left;
}

.ds-total-cost {
  font-size: 36px;
  color: var(--ds-primary);
  margin-bottom: 25px;
  text-align: center;
  font-weight: 800;
}

.ds-breakdown {
  margin: 25px 0;
}

.ds-breakdown h4 {
  color: var(--ds-text);
  margin-bottom: 15px;
  font-size: 18px;
}

.ds-breakdown ul {
  list-style: none;
  padding: 0;
}

.ds-breakdown li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--ds-border);
}

.ds-breakdown-label {
  color: var(--ds-text-muted);
  text-transform: capitalize;
}

.ds-breakdown-value {
  color: var(--ds-text);
  font-weight: 600;
}

.ds-estimated-time {
  color: var(--ds-text-muted);
  margin-top: 20px;
  text-align: center;
}

.ds-details {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--ds-border);
}

.ds-details p {
  margin: 8px 0;
  color: var(--ds-text-muted);
}

.ds-details strong {
  color: var(--ds-text);
}

.ds-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 30px 0;
}

.ds-estimate-disclaimer {
  color: var(--ds-text-muted);
  font-size: 13px;
  margin-top: 20px;
  padding: 12px 15px;
  background: rgba(148, 163, 184, 0.08);
  border-left: 3px solid var(--ds-text-muted);
  border-radius: 0 8px 8px 0;
  line-height: 1.5;
}
.ds-contact-note {
  color: var(--ds-text-muted);
  font-size: 14px;
  margin-top: 25px;
  padding: 15px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 8px;
}

/* Footer */
.ds-footer {
  text-align: center;
  margin-top: 50px;
  padding: 30px 20px;
  color: var(--ds-text-muted);
  font-size: 14px;
  border-top: 1px solid var(--ds-border);
}

.ds-footer a {
  color: #7c8cff;
  text-decoration: none;
}

.ds-footer a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ds-container {
    padding: 20px 15px;
  }

  .ds-header h1 {
    font-size: 2em;
  }

  .ds-header .ds-tagline {
    font-size: 1.1em;
  }

  #estimatePanel {
    padding: 25px 20px;
  }

  .ds-question-title {
    font-size: 22px;
  }

  .ds-nav-buttons {
    flex-direction: column;
  }

  .ds-btn {
    width: 100%;
  }

  .ds-total-cost {
    font-size: 28px;
  }

  .ds-actions {
    flex-direction: column;
  }

  .ds-actions .ds-btn {
    width: 100%;
  }
}

/* ============================================================
   QUICK-CHOICE (auto-advance tile buttons)
   ============================================================ */

.ds-quick-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.ds-quick-btn {
  padding: 18px 16px;
  background: var(--ds-background);
  border: 2px solid var(--ds-border);
  border-radius: 12px;
  color: var(--ds-text);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  transition: all 0.18s ease;
  line-height: 1.4;
}

.ds-quick-btn:hover {
  background: var(--ds-surface-light);
  border-color: var(--ds-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.ds-quick-btn.is-selected {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--ds-primary);
  color: var(--ds-primary-light);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ============================================================
   TOGGLE BUTTONS (checkboxGroup — multi-select)
   ============================================================ */

.ds-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.ds-toggle-btn {
  padding: 12px 20px;
  background: var(--ds-background);
  border: 2px solid var(--ds-border);
  border-radius: 10px;
  color: var(--ds-text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s ease;
  user-select: none;
}

.ds-toggle-btn:hover {
  border-color: var(--ds-primary);
  color: var(--ds-text);
  background: var(--ds-surface-light);
}

.ds-toggle-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--ds-primary);
  color: var(--ds-primary-light);
  font-weight: 600;
}

.ds-max-warning {
  font-size: 13px;
  color: var(--ds-text-muted);
  margin-bottom: 10px;
  transition: color 0.2s ease;
}

/* ============================================================
   DYNAMIC SLIDER (with glow + labels)
   ============================================================ */

.ds-slider-container {
  padding: 8px 0;
}

.ds-slider.ds-dynamic-slider {
  width: 100%;
  height: 8px;
  background: linear-gradient(
    to right,
    var(--ds-primary) 0%,
    var(--ds-primary) var(--slider-fill, 0%),
    var(--ds-surface-light) var(--slider-fill, 0%),
    var(--ds-surface-light) 100%
  );
  border-radius: 10px;
  outline: none;
  -webkit-appearance: none;
  transition: background 0.1s ease;
}

.ds-slider.ds-dynamic-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  background: var(--ds-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 calc(var(--slider-glow, 0.35) * 28px) rgba(16, 185, 129, calc(var(--slider-glow, 0.35)));
  transition: box-shadow 0.15s ease;
}

.ds-slider.ds-dynamic-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  background: var(--ds-primary);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.ds-slider-value {
  text-align: center;
  margin-top: 14px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ds-primary-light);
}

.ds-slider-label {
  text-align: center;
  margin-top: 8px;
  font-size: 14px;
  color: var(--ds-text-muted);
  min-height: 22px;
  transition: all 0.2s ease;
}

/* ============================================================
   POS TREE (expandable folder → item selector with quantity)
   ============================================================ */

.ds-pos-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.ds-pos-item {
  border: 2px solid var(--ds-border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.ds-pos-item.has-selections {
  border-color: var(--ds-primary);
}

.ds-pos-parent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--ds-background);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.ds-pos-parent:hover {
  background: var(--ds-surface-light);
}

.ds-pos-chevron {
  font-size: 11px;
  color: var(--ds-text-muted);
  transition: transform 0.2s ease;
  display: inline-block;
}

.ds-pos-chevron.expanded {
  transform: rotate(90deg);
  color: var(--ds-primary);
}

.ds-pos-folder {
  font-size: 18px;
}

.ds-pos-label {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--ds-text);
}

.ds-pos-badge {
  background: var(--ds-primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

.ds-pos-children {
  padding: 8px;
  background: var(--ds-surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ds-pos-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--ds-background);
  border: 1px solid var(--ds-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.ds-pos-file:hover:not(.active) {
  border-color: var(--ds-primary);
  background: var(--ds-surface-light);
}

.ds-pos-file.active {
  border-color: var(--ds-primary);
  background: rgba(16, 185, 129, 0.1);
}

.ds-pos-file-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.ds-pos-file-name {
  flex: 1;
  font-size: 14px;
  color: var(--ds-text);
}

.ds-pos-file.active .ds-pos-file-name {
  color: var(--ds-primary-light);
  font-weight: 600;
}

.ds-pos-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.ds-pos-qty-btn {
  width: 26px;
  height: 26px;
  background: var(--ds-surface-light);
  border: 1px solid var(--ds-border);
  border-radius: 6px;
  color: var(--ds-text);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}

.ds-pos-qty-btn:hover {
  background: var(--ds-primary);
  border-color: var(--ds-primary);
  color: white;
}

.ds-pos-qty-display {
  font-size: 14px;
  font-weight: 700;
  color: var(--ds-primary-light);
  min-width: 20px;
  text-align: center;
}

/* ============================================================
   Print Styles
   ============================================================ */

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }

  #estimatePanel {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .ds-nav-buttons,
  .ds-actions {
    display: none;
  }

  .ds-progress-bar,
  .ds-step-indicator {
    display: none;
  }
}

/* ── Schedule a Call ──────────────────────────────────────────────────────── */
.ds-schedule-cta {
  text-align: center;
  margin: 1.5rem 0 0.5rem;
}
.ds-schedule-prompt {
  color: var(--ds-text-muted);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.ds-btn-schedule {
  font-size: 1rem;
  padding: 0.75rem 2rem;
}
.ds-schedule-form {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.25rem;
}
.ds-schedule-form h3 {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  color: var(--ds-primary);
}
.ds-schedule-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.ds-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ds-field-group label {
  font-size: 0.85rem;
  color: var(--ds-text-muted);
  font-weight: 500;
}
.ds-optional {
  font-weight: 400;
  opacity: 0.7;
}
.ds-field-full {
  grid-column: 1 / -1;
}
.ds-input-schedule {
  background: var(--ds-surface-light);
  border: 1px solid var(--ds-border);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
  color-scheme: dark;
}
.ds-input-schedule:focus {
  outline: none;
  border-color: var(--ds-primary);
  box-shadow: 0 0 0 2px rgba(16,185,129,0.2);
}
.ds-schedule-error {
  color: var(--ds-error);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(239,68,68,0.1);
  border-radius: 6px;
}
.ds-schedule-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.ds-schedule-confirm {
  text-align: center;
  padding: 1.5rem;
  background: var(--ds-surface);
  border: 1px solid var(--ds-primary);
  border-radius: 12px;
  margin-top: 1.25rem;
}
.ds-schedule-confirm h3 {
  color: var(--ds-primary);
  margin: 0.5rem 0;
}
.ds-schedule-confirm p {
  color: var(--ds-text-muted);
  font-size: 0.95rem;
}
@media (max-width: 480px) {
  .ds-schedule-fields { grid-template-columns: 1fr; }
}

/* ── Top Nav (secondary pages) ───────────────────────────────────────────── */
.ds-topnav {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 100;
}
.ds-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(60,90,255,0.22);
  border: 1px solid rgba(120,160,255,0.32);
  color: #cdd8f0;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1.15em;
  backdrop-filter: blur(10px);
  transition: background 0.15s ease;
  line-height: 1;
}
.ds-home-btn:hover {
  background: rgba(90,140,255,0.42);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.ds-footer {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  margin-top: 3rem;
  border-top: 1px solid var(--ds-border);
  color: var(--ds-text-muted);
  font-size: 0.82rem;
  line-height: 1.8;
}
.ds-footer-link {
  color: #7c8cff;
  text-decoration: none;
  font-weight: 500;
}
.ds-footer-link:hover {
  text-decoration: underline;
}
