/**
 * Indilites Calculator — Premium Frontend Styles
 * Brand: Indi Lites | Primary: #00A3DA | Accent: #FFB703
 * Scoped to .indilites-calc to prevent theme conflicts.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────────────── */
.indilites-calc {
  /* Brand Colors */
  --il-primary:        #00A3DA;
  --il-primary-hover:  #0087b5;
  --il-primary-light:  rgba(0, 163, 218, 0.08);
  --il-primary-glow:   rgba(0, 163, 218, 0.25);
  --il-accent:         #FFB703;
  --il-accent-dark:    #e09e00;

  /* Neutrals */
  --il-text:           #1A1A1A;
  --il-text-muted:     #4A5568;
  --il-text-light:     #718096;
  --il-bg:             #FFFFFF;
  --il-bg-alt:         #F8FAFC;
  --il-bg-card:        #FFFFFF;
  --il-border:         #E2E8F0;
  --il-border-focus:   #00A3DA;

  /* Status */
  --il-success:        #10b981;
  --il-success-light:  rgba(16, 185, 129, 0.1);
  --il-error:          #ef4444;
  --il-error-light:    rgba(239, 68, 68, 0.08);

  /* Spacing & Shape */
  --il-radius:         14px;
  --il-radius-sm:      8px;
  --il-radius-xs:      6px;
  --il-shadow:         0 4px 24px rgba(0, 0, 0, 0.07);
  --il-shadow-card:    0 2px 12px rgba(0, 0, 0, 0.05);
  --il-shadow-hover:   0 8px 28px rgba(0, 163, 218, 0.15);
}

/* ── Dark Theme ────────────────────────────────────────────────── */
.indilites-calc--dark {
  --il-text:           #F1F5F9;
  --il-text-muted:     #94A3B8;
  --il-text-light:     #64748B;
  --il-bg:             #0F172A;
  --il-bg-alt:         #1E293B;
  --il-bg-card:        #1E293B;
  --il-border:         #334155;
  --il-shadow:         0 4px 24px rgba(0, 0, 0, 0.4);
  --il-shadow-card:    0 2px 12px rgba(0, 0, 0, 0.3);
  --il-shadow-hover:   0 8px 28px rgba(0, 163, 218, 0.2);
}

/* ── Base Container ────────────────────────────────────────────── */
.indilites-calc {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--il-text);
  background: var(--il-bg);
  border: 1px solid var(--il-border);
  border-radius: var(--il-radius);
  box-shadow: var(--il-shadow);
  max-width: 680px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  line-height: 1.6;
}

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

.indilites-calc h1,
.indilites-calc h2,
.indilites-calc h3,
.indilites-calc h4 {
  font-family: 'Outfit', sans-serif;
}

/* ── Progress Bar ──────────────────────────────────────────────── */
.indilites-calc__progress {
  height: 5px;
  background: var(--il-bg-alt);
  width: 100%;
}

.indilites-calc__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--il-primary), #00c8ff);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--il-primary-glow);
}

/* ── Header ────────────────────────────────────────────────────── */
.indilites-calc__header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--il-border);
  text-align: center;
  background: linear-gradient(135deg, var(--il-bg) 0%, var(--il-bg-alt) 100%);
}

.indilites-calc__header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--il-text);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.indilites-calc__header p {
  font-size: 14px;
  color: var(--il-text-muted);
}

/* ── Body ──────────────────────────────────────────────────────── */
.indilites-calc__body {
  padding: 28px;
}

/* ── Step Title (inside header, dynamic) ───────────────────────── */
#il-step-title {
  font-size: 22px;
  font-weight: 700;
}

/* ── Forms ─────────────────────────────────────────────────────── */
.il-form-group {
  margin-bottom: 18px;
}

.il-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--il-text);
  letter-spacing: 0.1px;
}

.il-form-group input,
.il-form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--il-border);
  border-radius: var(--il-radius-sm);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  background: var(--il-bg);
  color: var(--il-text);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.il-form-group input:focus,
.il-form-group select:focus {
  outline: none;
  border-color: var(--il-primary);
  box-shadow: 0 0 0 3px var(--il-primary-glow);
}

.il-form-group input::placeholder {
  color: var(--il-text-light);
}

/* Custom select arrow */
.il-select-wrapper {
  position: relative;
}

.il-select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--il-text-muted);
  pointer-events: none;
}

.il-select-wrapper select {
  padding-right: 38px;
  cursor: pointer;
}

.il-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .il-form-row {
    grid-template-columns: 1fr;
  }
}

.il-help-text {
  display: block;
  font-size: 12px;
  color: var(--il-text-light);
  margin-top: 5px;
  line-height: 1.4;
}

/* ── Lux Info Badge ────────────────────────────────────────────── */
.il-lux-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--il-primary-light);
  border: 1px solid rgba(0, 163, 218, 0.2);
  border-radius: var(--il-radius-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--il-primary);
  font-weight: 500;
  transition: all 0.2s;
}

.il-lux-info__icon {
  font-size: 16px;
  flex-shrink: 0;
}

.il-lux-info__text span {
  font-weight: 700;
}

/* ── Advanced Toggle ───────────────────────────────────────────── */
.il-advanced-toggle {
  text-align: right;
  margin-bottom: 14px;
}

.il-advanced-toggle button {
  background: none;
  border: none;
  color: var(--il-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--il-radius-xs);
  transition: background 0.15s;
  font-family: 'Inter', sans-serif;
}

.il-advanced-toggle button:hover {
  background: var(--il-primary-light);
}

.il-advanced-panel {
  background: var(--il-bg-alt);
  padding: 16px;
  border-radius: var(--il-radius-sm);
  border: 1px solid var(--il-border);
  margin-bottom: 16px;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.il-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.1px;
}

.il-btn--primary {
  background: var(--il-primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--il-primary-glow);
}

.il-btn--primary:hover {
  background: var(--il-primary-hover);
  color: #fff;
  box-shadow: 0 6px 20px var(--il-primary-glow);
  transform: translateY(-1px);
}

.il-btn--primary:disabled {
  background: var(--il-border);
  color: var(--il-text-light);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.il-btn--secondary {
  background: var(--il-bg-alt);
  color: var(--il-text);
  border: 1.5px solid var(--il-border);
}

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

.il-btn--full {
  width: 100%;
}

.il-form-actions {
  margin-top: 24px;
}

.il-form-actions--split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ── Results Summary Chips ─────────────────────────────────────── */
.il-results-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

@media (max-width: 480px) {
  .il-results-summary {
    grid-template-columns: 1fr;
  }
}

.il-result-item {
  background: var(--il-bg-alt);
  border: 1.5px solid var(--il-border);
  border-radius: var(--il-radius-sm);
  padding: 16px;
  text-align: center;
  transition: border-color 0.2s;
}

.il-result-item:hover {
  border-color: var(--il-primary);
}

.il-result-label {
  display: block;
  font-size: 11px;
  color: var(--il-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 6px;
}

.il-result-value {
  display: block;
  font-size: 26px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: var(--il-primary);
  line-height: 1;
}

.il-result-value small {
  font-size: 13px;
  font-weight: 500;
  color: var(--il-text-muted);
  margin-left: 2px;
}

/* ── Section Title ─────────────────────────────────────────────── */
.il-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--il-text);
  margin-bottom: 6px;
  font-family: 'Outfit', sans-serif;
}

/* ── Product List & Cards ──────────────────────────────────────── */
.il-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.il-product-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1.5px solid var(--il-border);
  border-radius: var(--il-radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  background: var(--il-bg-card);
}

.il-product-card:hover {
  border-color: var(--il-primary);
  box-shadow: var(--il-shadow-hover);
}

.il-product-card.selected {
  border-color: var(--il-primary);
  background: var(--il-primary-light);
}

/* Custom Checkbox */
.il-product-checkbox {
  flex-shrink: 0;
}

.il-product-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--il-primary);
}

/* Product Thumbnail */
.il-product-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--il-radius-xs);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--il-border);
  background: var(--il-bg-alt);
}

.il-product-thumb-placeholder {
  width: 52px;
  height: 52px;
  border-radius: var(--il-radius-xs);
  background: var(--il-bg-alt);
  border: 1px solid var(--il-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

/* Product Info */
.il-product-info {
  flex: 1;
  min-width: 0;
}

.il-product-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--il-text);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.il-product-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.il-product-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--il-bg-alt);
  border: 1px solid var(--il-border);
  color: var(--il-text-muted);
}

/* Product Qty & Price */
.il-product-qty {
  text-align: right;
  flex-shrink: 0;
}

.il-product-qty-val {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--il-text);
  font-family: 'Outfit', sans-serif;
  line-height: 1;
}

.il-product-price {
  display: block;
  font-size: 12px;
  color: var(--il-text-muted);
  margin-top: 3px;
}

.il-product-watts {
  display: block;
  font-size: 11px;
  color: var(--il-accent-dark);
  font-weight: 600;
  margin-top: 2px;
}

/* ── Totals Bar ────────────────────────────────────────────────── */
.il-totals-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--il-radius-sm);
  background: var(--il-bg-alt);
  border: 1.5px solid var(--il-border);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.il-totals-right strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--il-primary);
  font-family: 'Outfit', sans-serif;
}

/* ── Alerts ────────────────────────────────────────────────────── */
.il-alert {
  padding: 11px 15px;
  border-radius: var(--il-radius-sm);
  font-size: 13px;
  margin-top: 14px;
  font-weight: 500;
}

.il-alert--error {
  background: var(--il-error-light);
  color: var(--il-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Success State ─────────────────────────────────────────────── */
.il-success-state {
  text-align: center;
  padding: 28px 20px;
}

.il-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--il-success-light);
  color: var(--il-success);
  margin-bottom: 20px;
}

.il-success-state h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--il-text);
}

.il-success-state p {
  color: var(--il-text-muted);
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.6;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.il-success-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
