/* ==========================================================================
   SECTION 05: PROBLEM VS SOLUTION (2-COLUMN BEFORE/AFTER SLIDER & COMPACT TABLE)
   ========================================================================== */

.mrd-compare-wrapper {
  padding: 80px 0;
  background-color: #ffffff;
  position: relative;
  border-top: 1px solid #e2e8f0;
}

.mrd-compare-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 48px auto;
}

.mrd-compare-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: rgba(0, 159, 227, 0.08);
  border: 1px solid rgba(0, 159, 227, 0.25);
  border-radius: 30px;
  color: #009fe3;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.mrd-compare-tag-dot {
  width: 8px;
  height: 8px;
  background-color: #009fe3;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 159, 227, 0.6);
}

.mrd-compare-title {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.mrd-compare-title .mrd-vs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 4px 12px;
  border-radius: 20px;
  vertical-align: middle;
  margin: 0 10px;
  letter-spacing: 0.5px;
  line-height: 1;
}

.mrd-compare-title .mrd-highlight {
  color: #009fe3;
  white-space: nowrap;
}


.mrd-compare-desc {
  font-size: 16px;
  color: #475569;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   2-COLUMN COMPARISON GRID
   -------------------------------------------------------------------------- */

.mrd-compare-2col-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: stretch;
}

/* LEFT COLUMN: SLIDER */
.mrd-compare-col-slider {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mrd-slider-container {
  position: relative;
  width: 100%;
  flex: 1 1 0%;
  min-height: 420px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12);
  border: 1px solid #cbd5e1;
  background-color: #0f172a;
  user-select: none;
  -webkit-user-select: none;
}

/* Base (Before) Image Layer: MRD-BWT002 */
.mrd-slider-layer-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.mrd-slider-layer-before img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Clipped (After) Image Layer: Máy Thường */
.mrd-slider-layer-after {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
  z-index: 4;
  border-right: 2px solid #ffffff;
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.4);
}

.mrd-slider-layer-after img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  display: block;
}

/* Badges on Slider */
.mrd-slider-badge {
  position: absolute;
  top: 16px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

/* Left side badge (Máy Thường - Red) */
.mrd-slider-badge-bad {
  left: 16px;
  background: rgba(220, 38, 38, 0.88);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 5;
}

/* Right side badge (MRD-BWT002 - Blue) */
.mrd-slider-badge-good {
  right: 16px;
  background: rgba(2, 132, 199, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 2;
}


/* Divider & Interactive Handle */
.mrd-slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: #ffffff;
  z-index: 8;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.mrd-slider-handle-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: #ffffff;
  color: #009fe3;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #009fe3;
  cursor: ew-resize;
  pointer-events: auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mrd-slider-handle-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 159, 227, 0.5);
}

.mrd-slider-handle-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Range Input for Smooth Dragging */
.mrd-slider-range {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 10;
  margin: 0;
  padding: 0;
}

/* Drag Guide Hint */
.mrd-slider-hint {
  text-align: center;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   RIGHT COLUMN: COMPACT COMPARISON TABLE / CARD
   -------------------------------------------------------------------------- */

.mrd-compare-col-table {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mrd-compact-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Header with 2 columns */
.mrd-compact-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 2px solid #e2e8f0;
}

.mrd-compact-th-bad {
  padding: 16px 20px;
  background: #fff5f5;
  color: #dc2626;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-right: 1px solid #fecaca;
  letter-spacing: 0.3px;
}

.mrd-compact-th-good {
  padding: 16px 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  color: #0284c7;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  letter-spacing: 0.3px;
}


/* Compact Comparison Rows */
.mrd-compact-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.mrd-compact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.2s ease;
}

.mrd-compact-row:hover {
  background-color: #fafafa;
}

.mrd-compact-row:last-child {
  border-bottom: none;
}

.mrd-compact-cell-bad {
  padding: 14px 20px;
  background: rgba(254, 242, 242, 0.35);
  border-right: 1px solid #fee2e2;
  font-size: 13.5px;
  line-height: 1.5;
  color: #4b5563;
}

.mrd-compact-cell-bad strong {
  display: block;
  color: #dc2626;
  font-size: 14px;
  margin-bottom: 2px;
}

.mrd-compact-cell-good {
  padding: 14px 20px;
  background: rgba(240, 249, 255, 0.4);
  font-size: 13.5px;
  line-height: 1.5;
  color: #334155;
}

.mrd-compact-cell-good strong {
  display: block;
  color: #0284c7;
  font-size: 14px;
  margin-bottom: 2px;
}

/* Compact Bottom Action Bar */
.mrd-compact-footer {
  padding: 18px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mrd-compact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  background: linear-gradient(135deg, #009fe3 0%, #0077b6 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 159, 227, 0.35);
  transition: all 0.3s ease;
  width: 100%;
}

.mrd-compact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 159, 227, 0.45);
  background: linear-gradient(135deg, #008cd0 0%, #006097 100%);
}

.mrd-compact-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.mrd-compact-subtext {
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

/* --------------------------------------------------------------------------
   RESPONSIVE (MOBILE & TABLET)
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .mrd-compare-2col-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .mrd-slider-container {
    aspect-ratio: 16 / 10;
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .mrd-compare-wrapper {
    padding: 50px 0;
  }
  .mrd-compare-title {
    font-size: 24px;
  }
  .mrd-compact-header {
    grid-template-columns: 1fr;
  }
  .mrd-compact-th-bad {
    border-right: none;
    border-bottom: 1px solid #fecaca;
  }
  .mrd-compact-row {
    grid-template-columns: 1fr;
  }
  .mrd-compact-cell-bad {
    border-right: none;
    border-bottom: 1px solid #fee2e2;
  }
}
