/* ==========================================================================
   COMPONENTS STYLESHEET
   Interactive Comparison Slider, Data Cleaning Simulator, Fiverr Calculator,
   Case Studies, Modals & Floating Elements
   ========================================================================== */

/* ==========================================================================
   1. INTERACTIVE BEFORE / AFTER COMPARISON SLIDER
   ========================================================================== */
.comparison-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.scenario-selector {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.scenario-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.scenario-btn:hover {
  background: var(--bg-tertiary);
  color: #ffffff;
  border-color: var(--border-hover);
}

.scenario-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.comparison-wrapper {
  position: relative;
  width: 100%;
  max-width: 1050px;
  height: 520px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.comparison-pane {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.comparison-pane.before-pane {
  left: 0;
  background: #111827;
  z-index: 1;
}

.comparison-pane.after-pane {
  left: 0;
  background: #090d16;
  z-index: 2;
  width: 50%; /* controlled by JS slider */
  border-right: 2px solid var(--accent-light);
  box-shadow: 4px 0 20px rgba(16, 185, 129, 0.4);
}

.pane-badge {
  position: absolute;
  top: 1.25rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.before-badge {
  right: 1.25rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.after-badge {
  left: 1.25rem;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--accent-light);
  color: #34d399;
}

.pane-content-wrapper {
  width: 1050px; /* fixed full width so content doesn't stretch or squash */
  height: 100%;
  padding: 4.5rem 2rem 2rem 2rem;
  box-sizing: border-box;
  overflow-y: auto;
}

/* Messy Raw PDF Mock */
.raw-pdf-view {
  background: #1a2234;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #94a3b8;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(239, 68, 68, 0.3);
}

.raw-header {
  border-bottom: 1px dashed #475569;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  color: #cbd5e1;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.raw-text-line {
  margin-bottom: 0.6rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.raw-text-line.error-highlight {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
}

/* Clean Excel Grid Mock */
.clean-excel-view {
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-emerald);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.clean-excel-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.clean-excel-table th {
  background: #134e4a;
  color: #ffffff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  border: 1px solid #115e59;
}

.clean-excel-table td {
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
}

.clean-excel-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.clean-excel-table tr:hover {
  background: rgba(16, 185, 129, 0.08);
}

.clean-excel-table td.num-col {
  text-align: right;
  font-weight: 600;
  color: #34d399;
}

.clean-excel-table tr.total-row {
  background: #042f2e;
  font-weight: 700;
  border-top: 2px solid var(--accent-light);
}

/* Comparison Handle */
.slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 44px;
  margin-left: -22px;
  z-index: 20;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-handle-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 3px solid #ffffff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 0 20px var(--accent-glow), 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}

.slider-handle:hover .slider-handle-button {
  transform: scale(1.1);
  background: var(--accent-light);
}

/* ==========================================================================
   2. LIVE DATA CLEANING SIMULATOR / PLAYGROUND
   ========================================================================== */
.cleaner-demo-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.cleaner-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sample-selector-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sample-selector-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.cleaner-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.cleaner-select:focus {
  border-color: var(--accent-primary);
}

.cleaning-rules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.rule-toggle-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.rule-toggle-card:hover {
  border-color: var(--border-hover);
}

.rule-toggle-card.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent-primary);
}

.rule-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.rule-info {
  display: flex;
  flex-direction: column;
}

.rule-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.rule-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cleaner-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.cleaner-stats-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.88rem;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
}

.stat-pill strong {
  color: var(--accent-light);
}

/* Interactive Grid View */
.cleaner-grid-wrapper {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  background: #090d16;
  max-height: 400px;
}

.interactive-data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  min-width: 700px;
}

.interactive-data-table th {
  background: #1e293b;
  color: #cbd5e1;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--accent-primary);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 5;
}

.interactive-data-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}

.interactive-data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.interactive-data-table td.cell-cleaned {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  transition: background 0.4s ease;
}

.interactive-data-table td.cell-error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

/* ==========================================================================
   3. FIVERR PROJECT COST & TURNAROUND CALCULATOR
   ========================================================================== */
.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(16, 185, 129, 0.12);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
}

.calc-input-group {
  margin-bottom: 2rem;
}

.calc-label-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.calc-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.calc-value-display {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-light);
}

.calc-range-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
  -webkit-appearance: none;
  accent-color: var(--accent-primary);
}

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

.doc-option-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.doc-option-card:hover {
  border-color: var(--border-hover);
}

.doc-option-card.selected {
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.12);
}

.doc-option-card i {
  font-size: 1.35rem;
  color: var(--accent-light);
  margin-bottom: 0.4rem;
  display: block;
}

.doc-option-card .doc-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.doc-option-card .doc-mult {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.addons-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.addon-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.addon-item:hover {
  border-color: var(--border-hover);
}

.addon-item.selected {
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.08);
}

.addon-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.addon-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.addon-price {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-light);
}

/* Calculator Summary Right Panel */
.calc-summary-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.calc-summary-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.calc-summary-header h3 {
  font-size: 1.2rem;
}

.summary-breakdown-list {
  list-style: none;
  margin-bottom: 1.5rem;
}

.summary-breakdown-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.summary-breakdown-list li span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

.total-price-box {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.total-price-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  font-weight: 700;
}

.total-price-val {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
  margin: 0.25rem 0;
}

.total-time-val {
  font-size: 0.85rem;
  color: var(--accent-light);
  font-weight: 600;
}

/* ==========================================================================
   4. CASE STUDIES & PORTFOLIO SHOWCASE
   ========================================================================== */
.case-studies-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.case-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.case-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-emerald);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(16, 185, 129, 0.12);
}

.case-header-visual {
  height: 180px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.case-header-visual i {
  font-size: 4rem;
  color: rgba(16, 185, 129, 0.2);
}

.case-category-pill {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--accent-primary);
  color: var(--accent-light);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.case-body {
  padding: 1.75rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.case-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.case-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.case-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.case-metric-box .c-val {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-light);
}

.case-metric-box .c-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================================
   5. MODAL DIALOGS & ORDER INQUIRY
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  padding: 2.25rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(16, 185, 129, 0.25);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-normal);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-backdrop.open .modal-container {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-title {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-primary);
}

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

.copyable-specs-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  position: relative;
  white-space: pre-wrap;
}

/* ==========================================================================
   RESPONSIVE COMPONENT QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
  .calculator-card {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .case-studies-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .comparison-wrapper {
    height: 440px;
  }

  .pane-content-wrapper {
    width: 700px;
    padding: 3.5rem 1rem 1rem 1rem;
  }

  .doc-type-options {
    grid-template-columns: 1fr;
  }

  .cleaning-rules-grid {
    grid-template-columns: 1fr;
  }

  .cleaner-controls-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
