/**
 * Ghost Conversion Kit (ghost_conversion_kit.css)
 * Pure Client-Side Interactive Component Library for Ghost-Rainmaker
 * Mobile-First (375px Viewport Safe), Zero Dependencies, Zero Layout Shift
 */

:root {
  --gck-primary: #1a4473;
  --gck-primary-dark: #0f2b48;
  --gck-accent-orange: #e65100;
  --gck-accent-orange-hover: #bf360c;
  --gck-success: #059669;
  --gck-success-light: #ecfdf5;
  --gck-warning: #f59e0b;
  --gck-text: #1e293b;
  --gck-text-muted: #64748b;
  --gck-bg-card: #ffffff;
  --gck-bg-soft: #f8fafc;
  --gck-border: #e2e8f0;
  --gck-border-focus: #3b82f6;
  --gck-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --gck-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --gck-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --gck-radius: 10px;
  --gck-radius-pill: 9999px;
  --gck-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   1. Interactive Simulator Container
   ========================================================================== */
.gck-simulator-card {
  box-sizing: border-box;
  font-family: var(--gck-font);
  background: var(--gck-bg-card);
  border: 1px solid var(--gck-border);
  border-radius: var(--gck-radius);
  box-shadow: var(--gck-shadow-md);
  padding: 20px 16px;
  margin: 24px 0;
  width: 100%;
  max-width: 100%;
}

.gck-simulator-header {
  border-bottom: 2px solid var(--gck-border);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.gck-simulator-badge {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--gck-radius-pill);
  margin-bottom: 6px;
}

.gck-simulator-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--gck-primary-dark);
  line-height: 1.4;
  margin: 0;
}

.gck-simulator-desc {
  font-size: 13px;
  color: var(--gck-text-muted);
  margin-top: 4px;
}

/* Input Controls */
.gck-control-group {
  margin-bottom: 18px;
}

.gck-control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.gck-control-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--gck-text);
}

.gck-control-value-display {
  font-size: 16px;
  font-weight: 800;
  color: var(--gck-primary);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
}

.gck-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  outline: none;
  cursor: pointer;
  margin: 10px 0 6px 0;
}

.gck-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gck-primary);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.gck-range-slider::-webkit-slider-thumb:hover,
.gck-range-slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
  background: var(--gck-accent-orange);
}

.gck-range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gck-text-muted);
}

/* Simulator Results Box */
.gck-result-box {
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f0fa 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--gck-radius);
  padding: 16px;
  margin-top: 18px;
  text-align: center;
}

.gck-result-label {
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
}

.gck-result-main-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--gck-accent-orange);
  line-height: 1.2;
  margin: 6px 0;
}

.gck-result-main-value .gck-unit {
  font-size: 18px;
  font-weight: 700;
  color: var(--gck-text);
  margin-left: 2px;
}

.gck-result-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #bfdbfe;
  text-align: left;
}

.gck-breakdown-item {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  padding: 8px 10px;
}

.gck-breakdown-sublabel {
  font-size: 11px;
  color: var(--gck-text-muted);
}

.gck-breakdown-subvalue {
  font-size: 14px;
  font-weight: 700;
  color: var(--gck-text);
  margin-top: 2px;
}

.gck-simulator-cta-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--gck-accent-orange) 0%, var(--gck-accent-orange-hover) 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  border-radius: var(--gck-radius-pill);
  box-shadow: 0 4px 14px rgba(230, 81, 0, 0.35);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.gck-simulator-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(230, 81, 0, 0.45);
}

/* ==========================================================================
   2. Dynamic Filter & Sort Table / Cards
   ========================================================================== */
.gck-filter-sort-wrapper {
  box-sizing: border-box;
  font-family: var(--gck-font);
  margin: 24px 0;
  width: 100%;
}

.gck-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.gck-filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.gck-filter-pills::-webkit-scrollbar {
  display: none;
}

.gck-filter-pill-btn {
  white-space: nowrap;
  background: #f1f5f9;
  border: 1px solid var(--gck-border);
  color: var(--gck-text);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--gck-radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.gck-filter-pill-btn.active,
.gck-filter-pill-btn:hover {
  background: var(--gck-primary);
  border-color: var(--gck-primary);
  color: #ffffff;
}

.gck-sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-end;
}

.gck-sort-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gck-text-muted);
}

.gck-sort-select {
  font-size: 12px;
  font-weight: 700;
  color: var(--gck-text);
  border: 1px solid var(--gck-border);
  border-radius: 6px;
  padding: 5px 8px;
  background: #ffffff;
  cursor: pointer;
}

/* Cards Grid */
.gck-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gck-card-item {
  background: var(--gck-bg-card);
  border: 1px solid var(--gck-border);
  border-radius: var(--gck-radius);
  box-shadow: var(--gck-shadow-sm);
  padding: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
  position: relative;
}

.gck-card-item.hidden {
  display: none !important;
}

.gck-card-item:hover {
  box-shadow: var(--gck-shadow-md);
  border-color: #cbd5e1;
}

.gck-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.gck-card-rank-badge {
  background: var(--gck-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

.gck-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gck-tag-pill {
  font-size: 10px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 6px;
  border-radius: 4px;
}

.gck-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--gck-primary-dark);
  margin-bottom: 10px;
}

.gck-card-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.gck-spec-cell {
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
}

.gck-spec-cell-label {
  font-size: 10px;
  color: var(--gck-text-muted);
}

.gck-spec-cell-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--gck-text);
  margin-top: 1px;
}

.gck-card-cta-btn {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--gck-accent-orange) 0%, var(--gck-accent-orange-hover) 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  border-radius: var(--gck-radius-pill);
  box-shadow: 0 3px 8px rgba(230, 81, 0, 0.28);
  box-sizing: border-box;
}

/* ==========================================================================
   3. Smart Floating Micro-CTA Bar (Mobile Optimized)
   ========================================================================== */
.gck-sticky-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(15, 43, 72, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 2px solid var(--gck-accent-orange);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.25);
  padding: 10px 14px;
  transform: translateY(110%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  font-family: var(--gck-font);
  box-sizing: border-box;
}

.gck-sticky-cta-bar.visible {
  transform: translateY(0);
}

.gck-sticky-cta-bar.visible.minimized {
  transform: translateY(calc(100% - 28px));
}

.gck-sticky-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.gck-sticky-content {
  flex: 1;
  min-width: 0;
}

.gck-sticky-badge {
  display: inline-block;
  background: var(--gck-accent-orange);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 2px;
}

.gck-sticky-text {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.gck-sticky-subtext {
  font-size: 11px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gck-sticky-action {
  flex-shrink: 0;
}

.gck-sticky-btn {
  display: inline-block;
  background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: var(--gck-radius-pill);
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(249, 115, 22, 0.4);
  white-space: nowrap;
  transition: transform 0.1s ease;
}

.gck-sticky-btn:active {
  transform: scale(0.96);
}

.gck-sticky-close-btn {
  position: absolute;
  top: -18px;
  right: 0;
  background: rgba(15, 43, 72, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: none;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  line-height: 1.2;
}

/* ==========================================================================
   4. Semantic Accordion FAQ (Schema.org / Accessibility Compliant)
   ========================================================================== */
.gck-faq-container {
  box-sizing: border-box;
  font-family: var(--gck-font);
  margin: 28px 0;
  width: 100%;
}

.gck-faq-header {
  border-left: 4px solid var(--gck-primary);
  padding-left: 10px;
  margin-bottom: 14px;
}

.gck-faq-heading {
  font-size: 18px;
  font-weight: 800;
  color: var(--gck-primary-dark);
}

.gck-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gck-faq-item {
  background: var(--gck-bg-card);
  border: 1px solid var(--gck-border);
  border-radius: var(--gck-radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.gck-faq-item.active {
  border-color: #93c5fd;
}

.gck-faq-question-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: none;
  border: none;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--gck-text);
}

.gck-faq-q-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--gck-primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  border-radius: 50%;
  flex-shrink: 0;
}

.gck-faq-chevron {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--gck-text-muted);
  transition: transform 0.2s ease;
}

.gck-faq-item.active .gck-faq-chevron {
  transform: rotate(180deg);
}

.gck-faq-answer-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0, 1, 0, 1);
  background: #f8fafc;
  border-top: 1px solid transparent;
}

.gck-faq-item.active .gck-faq-answer-panel {
  max-height: 800px;
  transition: max-height 0.35s ease-in-out;
  border-top-color: #f1f5f9;
}

.gck-faq-answer-body {
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--gck-text);
}

.gck-faq-answer-body strong {
  color: var(--gck-primary-dark);
}

/* ==========================================================================
   5. Strict 375px Mobile Viewport Safety Overrides
   ========================================================================== */
.gck-simulator-card,
.gck-simulator-card *,
.gck-filter-sort-wrapper,
.gck-filter-sort-wrapper *,
.gck-faq-container,
.gck-faq-container *,
.gck-sticky-cta-bar,
.gck-sticky-cta-bar * {
  box-sizing: border-box;
}

.gck-simulator-card,
.gck-filter-sort-wrapper,
.gck-faq-container {
  max-width: 100%;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

.gck-control-label-row {
  flex-wrap: wrap;
  gap: 6px;
}

.gck-breakdown-item,
.gck-spec-cell {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .gck-simulator-card {
    padding: 16px 12px;
  }

  .gck-simulator-title {
    font-size: 16px;
  }

  .gck-result-main-value {
    font-size: 26px;
  }

  .gck-result-main-value .gck-unit {
    font-size: 15px;
  }

  .gck-simulator-cta-btn {
    font-size: 14px;
    padding: 12px 12px;
  }

  .gck-sticky-cta-bar {
    padding: 8px 10px;
  }

  .gck-sticky-inner {
    gap: 8px;
  }

  .gck-sticky-btn {
    font-size: 12px;
    padding: 8px 12px;
  }

  .gck-faq-question-btn {
    padding: 12px 12px;
    font-size: 13.5px;
  }
}

/* ==========================================================================
   6. CRO Decision Architecture Card (ARA Summary + Honest Fit Filter + Microcopy)
   ========================================================================== */
.gck-cro-decision-card {
  box-sizing: border-box;
  font-family: var(--gck-font);
  background: var(--gck-bg-card);
  border: 1px solid var(--gck-border);
  border-top: 4px solid var(--gck-primary);
  border-radius: var(--gck-radius);
  box-shadow: var(--gck-shadow-sm);
  padding: 18px 16px;
  margin: 20px 0;
  width: 100%;
  max-width: 100%;
}

.gck-cro-header {
  margin-bottom: 12px;
}

.gck-cro-badge {
  display: inline-block;
  background: #eff6ff;
  color: var(--gck-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--gck-radius-pill);
  margin-bottom: 6px;
}

.gck-cro-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--gck-primary-dark);
  line-height: 1.4;
  margin: 0;
}

.gck-cro-ara-list {
  margin: 0 0 14px 0;
  padding: 0;
}

.gck-cro-ara-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  background: var(--gck-bg-soft);
  border-radius: 6px;
  margin-bottom: 8px;
}

.gck-cro-ara-row dt {
  font-size: 12px;
  font-weight: 800;
  color: var(--gck-primary);
}

.gck-cro-ara-row dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gck-text);
}

.gck-cro-fit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0;
}

@media (min-width: 640px) {
  .gck-cro-fit-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.gck-cro-fit-col {
  border-radius: 8px;
  padding: 12px;
  font-size: 13.5px;
  line-height: 1.55;
}

.gck-cro-fit-yes {
  background: var(--gck-success-light);
  border: 1px solid #a7f3d0;
}

.gck-cro-fit-no {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.gck-cro-fit-title {
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--gck-primary-dark);
}

.gck-cro-fit-col ul {
  margin: 0;
  padding-left: 18px;
}

.gck-cro-fit-col li {
  margin-bottom: 4px;
}

.gck-cro-objection-note {
  font-size: 13px;
  color: var(--gck-text-muted);
  background: #f8fafc;
  border-left: 3px solid var(--gck-success);
  padding: 8px 10px;
  margin: 10px 0 8px 0;
  line-height: 1.55;
}

.gck-cta-microcopy {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gck-success);
  margin: 8px 0 0 0;
  line-height: 1.5;
  text-align: center;
}
