/* ChefTalk Marketing Website - Comparison Section (Tab-Based) */
/* Modern tab interface for Recipe Apps vs AI Assistants vs ChefTalk */

/* ======================
   COMPARISON SECTION
   ====================== */

.comparison {
  background: linear-gradient(135deg, #FFEDD5 0%, #FEF3E2 100%);
  padding: var(--section-padding) 0;
}

.comparison-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  box-sizing: border-box;
}

.comparison-header {
  text-align: center;
  margin-bottom: 48px;
}

.comparison-header .section-title {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.2;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.comparison-header .section-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-gray);
  max-width: 700px;
  margin: 0 auto;
}

/* ======================
   TAB-BASED LAYOUT
   ====================== */

.comparison-tabs-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: white;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-medium);
  overflow: hidden;
}

/* Tab Navigation (Left Side on Desktop) */
.comparison-tabs-nav {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  border-bottom: 2px solid #E5E7EB;
  background: #F9FAFB;
  padding: 8px;
  gap: 4px;
}

.comparison-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-small);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-gray);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.comparison-tab-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Progress bar for auto-advance */
.tab-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--primary-orange);
  transition: width 0.3s ease;
  border-radius: 0 0 var(--radius-small) var(--radius-small);
}

.comparison-tab.active .tab-progress {
  background: rgba(255, 255, 255, 0.5);
}

.comparison-tab svg {
  color: var(--text-gray);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.comparison-tab:hover {
  background: rgba(255, 107, 53, 0.1);
  color: var(--primary-orange);
}

.comparison-tab:hover svg {
  color: var(--primary-orange);
}

.comparison-tab.active {
  background: var(--primary-orange);
  color: white;
  font-weight: 600;
}

.comparison-tab.active svg {
  color: white;
}

/* Content Area (Right Side on Desktop) */
.comparison-content-area {
  padding: 32px 24px;
  min-height: 300px;
}

.comparison-tab-content {
  display: none;
}

.comparison-tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease-in-out;
}

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

/* Comparison Columns */
.comparison-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.comparison-column {
  padding: 20px;
  border-radius: var(--radius-medium);
  background: #F9FAFB;
  border: 2px solid #E5E7EB;
  transition: all 0.3s ease;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.column-header h4 {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 16px;
  color: var(--primary-dark);
  margin: 0;
}

.column-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-gray);
  margin: 0;
  min-height: 72px;
}

/* Status Icons */
.status-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  flex-shrink: 0;
}

.status-icon.positive {
  background: #D1FAE5;
  color: #059669;
}

.status-icon.negative {
  background: #FEE2E2;
  color: #DC2626;
}

.status-icon.partial {
  background: #FEF3C7;
  color: #D97706;
}

/* ChefTalk Column Highlight */
.comparison-column.cheftalk {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.08) 0%, rgba(255, 107, 53, 0.03) 100%);
  border: 2px solid rgba(255, 107, 53, 0.3);
}

.comparison-column.cheftalk .column-header h4 {
  color: var(--primary-orange);
}

.comparison-column.cheftalk:hover {
  border-color: var(--primary-orange);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
}

/* ======================
   ENHANCED DEEP-DIVE SPLIT LAYOUT
   ====================== */

.deep-dive-split-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 16px;
}

/* Full-width text when no blog card */
.deep-dive-split-layout.text-only {
  grid-template-columns: 1fr;
}

.deep-dive-split-layout.text-only .deep-dive-text {
  max-width: 100%;
}

/* LEFT: Text Content */
.deep-dive-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.scenario-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scenario-title {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 16px;
  color: var(--primary-dark);
  margin: 0;
}

.scenario-section p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-gray);
  margin: 0;
}

.scenario-highlight {
  font-weight: 500;
  color: var(--primary-orange);
  font-style: italic;
  padding-left: 16px;
  border-left: 3px solid var(--primary-orange);
  margin-top: 8px !important;
}

/* RIGHT: Blog Preview Card (Bluesky-style) */
.deep-dive-preview {
  width: 100%;
}

.blog-preview-card {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-medium);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.blog-preview-card:hover {
  border-color: var(--primary-orange);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
  transform: translateY(-2px);
}

.preview-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #F3F4F6;
  position: relative;
}

.preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-preview-card:hover .preview-image img {
  transform: scale(1.05);
}

.preview-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-title {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  color: var(--primary-dark);
  margin: 0;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-excerpt {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-gray);
  margin: 0;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.link-icon {
  color: #9CA3AF;
  flex-shrink: 0;
}

.preview-domain {
  font-size: 13px;
  color: #6B7280;
  font-weight: 500;
}

/* ======================
   RESPONSIVE - TABLET
   ====================== */

@media (min-width: 768px) {
  .comparison-header .section-title {
    font-size: 36px;
  }

  .comparison-header .section-description {
    font-size: 18px;
  }

  /* Show tabs in a scrollable row */
  .comparison-tabs-nav {
    padding: 12px;
    gap: 8px;
  }

  .comparison-tab {
    padding: 14px 20px;
    font-size: 15px;
  }

  /* Three columns for comparison */
  .comparison-columns {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .comparison-content-area {
    padding: 40px 32px;
  }

  .column-header h4 {
    font-size: 17px;
  }

  .column-text {
    font-size: 16px;
  }

  /* Enhanced Deep-Dive Responsive */
  .deep-dive-split-layout {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  /* Keep full-width for text-only layouts */
  .deep-dive-split-layout.text-only {
    grid-template-columns: 1fr;
  }

  .scenario-title {
    font-size: 17px;
  }

  .scenario-section p {
    font-size: 16px;
  }

  .preview-image {
    height: 220px;
  }

  .preview-title {
    font-size: 17px;
  }

  .preview-excerpt {
    font-size: 15px;
    line-clamp: 3;
    -webkit-line-clamp: 3;
  }
}

/* ======================
   RESPONSIVE - DESKTOP
   ====================== */

@media (min-width: 1024px) {
  .comparison-header {
    margin-bottom: 64px;
  }

  .comparison-header .section-title {
    font-size: 42px;
  }

  /* Side-by-side layout: Tabs on left, Content on right */
  .comparison-tabs-wrapper {
    flex-direction: row;
  }

  .comparison-tabs-nav {
    flex-direction: column;
    width: 280px;
    flex-shrink: 0;
    border-bottom: none;
    border-right: 2px solid #E5E7EB;
    overflow-x: visible;
    overflow-y: auto;
    padding: 16px;
    gap: 8px;
  }

  .comparison-tab {
    width: 100%;
    justify-content: flex-start;
    padding: 16px;
    font-size: 15px;
  }

  .comparison-tab span {
    white-space: normal;
  }

  .comparison-content-area {
    flex: 1;
    padding: 48px 40px;
  }

  .comparison-columns {
    gap: 24px;
  }

  .comparison-column {
    padding: 24px;
  }

  .status-icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .column-header h4 {
    font-size: 18px;
  }

  .column-text {
    font-size: 16px;
    min-height: 60px;
  }

  /* Enhanced Deep-Dive Desktop */
  .deep-dive-split-layout {
    gap: 40px;
  }

  /* Keep full-width for text-only layouts */
  .deep-dive-split-layout.text-only {
    grid-template-columns: 1fr;
  }

  .preview-image {
    height: 240px;
  }

  .preview-content {
    padding: 20px;
  }

  .preview-title {
    font-size: 18px;
  }
}

/* ======================
   FEATURE DEEP-DIVE (EXPANDABLE SECTIONS)
   ====================== */

.feature-deep-dive {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #E5E7EB;
}

.deep-dive-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--primary-orange);
  border-radius: var(--radius-small);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-orange);
  cursor: pointer;
  transition: all 0.3s ease;
}

.deep-dive-toggle:hover {
  background: rgba(255, 107, 53, 0.05);
  border-color: var(--primary-dark);
  color: var(--primary-dark);
}

.deep-dive-toggle:hover .toggle-icon {
  color: var(--primary-dark);
}

.toggle-icon {
  color: var(--primary-orange);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.deep-dive-toggle[data-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

/* ======================
   TYPING ANIMATION
   ====================== */

/* Typing animation cursor */
.toggle-cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--primary-orange);
  animation: cursor-blink 0.8s step-end infinite;
  opacity: 0; /* Hidden by default */
}

.deep-dive-toggle.typing .toggle-cursor {
  opacity: 1; /* Show during typing */
}

@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Hide cursor when typing complete */
.deep-dive-toggle.typing-complete .toggle-cursor {
  opacity: 0;
}

/* Suffix text (appears after typing) */
.toggle-suffix {
  display: inline-block;
  margin-left: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-orange);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.deep-dive-toggle.typing-complete .toggle-suffix {
  opacity: 1;
  transform: translateX(0);
}

/* Pulsate effect after typing completes - 3 cycles then stop */
.deep-dive-toggle.typing-complete {
  animation: button-pulsate 1.5s ease-in-out 1;
}

@keyframes button-pulsate {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 12px 4px rgba(255, 107, 53, 0.2);
  }
}

/* Stop pulsate on hover */
.deep-dive-toggle:hover {
  animation: none !important;
}

/* Instant display for visited tabs */
.deep-dive-toggle.visited .toggle-text {
  opacity: 1;
}

.deep-dive-toggle.visited .toggle-cursor {
  display: none;
}

.deep-dive-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s ease;
  margin-top: 0;
}

.deep-dive-content.expanded {
  max-height: 2000px;
  opacity: 1;
  margin-top: 16px;
}

.deep-dive-example {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-gray);
  margin: 0 0 16px 0;
  padding: 16px;
  background: #F9FAFB;
  border-left: 3px solid var(--primary-orange);
  border-radius: var(--radius-small);
}

.deep-dive-example strong {
  color: var(--primary-dark);
  font-weight: 600;
}

.blog-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-orange);
  text-decoration: none;
  transition: all 0.3s ease;
}

.blog-link:hover {
  color: var(--primary-dark);
  gap: 8px;
}

.blog-link svg {
  flex-shrink: 0;
  transition: all 0.3s ease;
}

/* ======================
   ANIMATION SUPPORT
   ====================== */

.comparison-tabs-wrapper.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.comparison-tabs-wrapper.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.comparison-tabs-wrapper.stagger-2 {
  transition-delay: 0.1s;
}
