/* Tabbed Features Section - LivePlan Inspired */
.tabbed-features-section {
  background: linear-gradient(180deg, #f3f4f6 0%, #f0f2f5 100%);
  padding: 40px 0 80px;
  position: relative;
  overflow: hidden;
}

.tabbed-features-section::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(61, 97, 223, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Section Header - REMOVED (header now in HTML is optional) */
.tabbed-features-header {
  display: none; /* Hide the header for cleaner flow */
}

/* Hero Tabs Container - STANDOUT VISUAL SECTION */
.hero-tabs-container {
  transition: all 0.3s ease;
}

.hero-tabs-container:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
  transform: translateY(-2px);
}

/* Tab Panes Inside Hero Container */
.hero-tabs-container .feature-tab-pane {
  display: none;
  opacity: 0;
}

.hero-tabs-container .feature-tab-pane.active {
  display: block;
  opacity: 1;
  animation: fadeInTab 0.4s ease forwards;
}

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

/* Tab Content Layout Inside Hero */
.hero-tabs-container .tab-content-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
}

/* Video styling inside hero tabs */
.hero-tabs-container .tab-video-container {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border: 2px solid rgba(61, 97, 223, 0.2);
}

.hero-tabs-container .tab-video-container video {
  width: 100%;
  display: block;
  border-radius: 16px;
}

/* Content area inside hero tabs */
.hero-tabs-container .tab-content-area {
  padding: 0;
}

.hero-tabs-container .tab-content-title {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-tabs-container .tab-content-tagline {
  font-size: 16px;
  color: #64748b;
  font-style: italic;
  margin-bottom: 16px;
  font-weight: 600;
}

.hero-tabs-container .tab-content-description {
  font-size: 15px;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 24px;
}

.hero-tabs-container .tab-key-features {
  margin-bottom: 28px;
}

.hero-tabs-container .tab-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #475569;
}

.hero-tabs-container .tab-feature-item::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Phase-specific feature checkmarks */
.hero-tabs-container .tab-content-layout[data-phase="1"] .tab-feature-item::before {
  background: rgba(61, 97, 223, 0.12);
  color: #3d61df;
}

.hero-tabs-container .tab-content-layout[data-phase="2"] .tab-feature-item::before {
  background: rgba(243, 185, 0, 0.12);
  color: #f3b900;
}

.hero-tabs-container .tab-content-layout[data-phase="3"] .tab-feature-item::before {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.hero-tabs-container .tab-content-layout[data-phase="4"] .tab-feature-item::before {
  background: rgba(33, 221, 144, 0.12);
  color: #21dd90;
}

/* Hero Feature Tabs - LARGER & MORE PROMINENT */
.hero-tabs-container .feature-tab {
  background: transparent;
  border: none;
  padding: 18px 32px; /* BIGGER padding */
  font-size: 18px; /* BIGGER font */
  font-weight: 700; /* BOLDER */
  color: rgba(30, 41, 59, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 4px solid transparent; /* THICKER underline */
  margin-bottom: -3px;
  border-radius: 8px 8px 0 0;
}

.hero-tabs-container .feature-tab:hover {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.4);
}

.hero-tabs-container .feature-tab.active {
  color: #1e293b;
  font-weight: 800; /* EXTRA BOLD when active */
}

/* Phase-specific colors - WITH BACKGROUNDS */
.hero-tabs-container .feature-tab[data-phase="1"].active {
  color: #3d61df;
  border-bottom-color: #3d61df;
  background: rgba(61, 97, 223, 0.12);
}

.hero-tabs-container .feature-tab[data-phase="2"].active {
  color: #f3b900;
  border-bottom-color: #f3b900;
  background: rgba(243, 185, 0, 0.12);
}

.hero-tabs-container .feature-tab[data-phase="3"].active {
  color: #ef4444;
  border-bottom-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.hero-tabs-container .feature-tab[data-phase="4"].active {
  color: #21dd90;
  border-bottom-color: #21dd90;
  background: rgba(33, 221, 144, 0.12);
}

/* Tab Navigation (legacy - still used for mobile) */
.feature-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 48px;
  border-bottom: 2px solid #e5e7eb;
  position: relative;
}

.feature-tab {
  background: transparent;
  border: none;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  border-bottom: 4px solid transparent;
  margin-bottom: -2px;
}

.feature-tab:hover {
  color: #1e293b;
  background: rgba(0, 0, 0, 0.02);
}

.feature-tab.active {
  color: #1e293b;
  border-bottom-color: currentColor;
}

/* Phase-specific tab colors */
.feature-tab[data-phase="1"].active {
  color: #3d61df;
  border-bottom-color: #3d61df;
}

.feature-tab[data-phase="2"].active {
  color: #f3b900;
  border-bottom-color: #f3b900;
}

.feature-tab[data-phase="3"].active {
  color: #ef4444;
  border-bottom-color: #ef4444;
}

.feature-tab[data-phase="4"].active {
  color: #21dd90;
  border-bottom-color: #21dd90;
}

/* Tab Content Container */
.feature-tabs-content {
  position: relative;
  min-height: 600px;
}

.feature-tab-pane {
  display: none;
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

.feature-tab-pane.active {
  display: block;
}

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

/* Tab Content Layout */
.tab-content-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr; /* Video gets 60% more space */
  gap: 50px;
  align-items: center;
  max-width: 1300px; /* Slightly wider container */
  margin: 0 auto;
  padding: 0 20px;
}

/* Video Container - LARGER */
.tab-video-container {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15); /* Stronger shadow for prominence */
  transition: all 0.3s ease;
  transform: scale(1);
}

.tab-video-container:hover {
  transform: scale(1.02); /* Subtle hover scale */
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.tab-video-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 3px;
  background: linear-gradient(135deg, rgba(61, 97, 223, 0.3), rgba(33, 221, 144, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab-video-container:hover::before {
  opacity: 1;
}

.tab-video-container video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

/* Phase-specific borders */
.tab-content-layout[data-phase="1"] .tab-video-container {
  border: 3px solid #3d61df;
}

.tab-content-layout[data-phase="2"] .tab-video-container {
  border: 3px solid #f3b900;
}

.tab-content-layout[data-phase="3"] .tab-video-container {
  border: 3px solid #ef4444;
}

.tab-content-layout[data-phase="4"] .tab-video-container {
  border: 3px solid #21dd90;
}

/* Content Area */
.tab-content-area {
  padding: 20px 0;
}

.tab-phase-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.tab-phase-badge[data-phase="1"] {
  background: #3d61df;
  color: white;
}

.tab-phase-badge[data-phase="2"] {
  background: #f3b900;
  color: white;
}

.tab-phase-badge[data-phase="3"] {
  background: #ef4444;
  color: white;
}

.tab-phase-badge[data-phase="4"] {
  background: #21dd90;
  color: white;
}

.tab-content-title {
  font-size: 36px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  line-height: 1.2;
}

.tab-content-tagline {
  font-size: 16px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 20px;
  font-style: italic;
}

.tab-content-description {
  font-size: 16px;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 28px;
}

/* Key Features List */
.tab-key-features {
  margin-bottom: 32px;
}

.tab-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 15px;
  color: #475569;
}

.tab-feature-item::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.tab-content-layout[data-phase="1"] .tab-feature-item::before {
  background: rgba(61, 97, 223, 0.1);
  color: #3d61df;
}

.tab-content-layout[data-phase="2"] .tab-feature-item::before {
  background: rgba(243, 185, 0, 0.1);
  color: #f3b900;
}

.tab-content-layout[data-phase="3"] .tab-feature-item::before {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.tab-content-layout[data-phase="4"] .tab-feature-item::before {
  background: rgba(33, 221, 144, 0.1);
  color: #21dd90;
}

/* CTA Button */
.tab-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.tab-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  color: white;
  text-decoration: none;
}

.tab-content-layout[data-phase="1"] .tab-cta-button {
  background: #3d61df;
}

.tab-content-layout[data-phase="2"] .tab-cta-button {
  background: #f3b900;
}

.tab-content-layout[data-phase="3"] .tab-cta-button {
  background: #ef4444;
}

.tab-content-layout[data-phase="4"] .tab-cta-button {
  background: #21dd90;
}

.tab-cta-arrow {
  transition: transform 0.3s ease;
}

.tab-cta-button:hover .tab-cta-arrow {
  transform: translateX(4px);
}

/* Mobile Dropdown (for small screens) */
.feature-tabs-mobile-select {
  display: none;
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 32px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='%231e293b'%3E%3Cpath d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .tabbed-features-section {
    padding: 60px 0 80px;
  }

  .tabbed-features-header h2 {
    font-size: 36px;
  }

  .tabbed-features-header p {
    font-size: 18px;
  }

  .tab-content-layout {
    gap: 40px;
  }

  .feature-tab {
    padding: 14px 24px;
    font-size: 16px;
  }

  .tab-content-title {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .tabbed-features-section {
    padding: 48px 0 60px;
  }

  .tabbed-features-header {
    margin-bottom: 40px;
  }

  .tabbed-features-header h2 {
    font-size: 32px;
    margin-bottom: 12px;
  }

  .tabbed-features-header p {
    font-size: 16px;
  }

  /* Hide desktop tabs, show mobile dropdown */
  .feature-tabs {
    display: none;
  }

  .feature-tabs-mobile-select {
    display: block;
  }

  /* Stack layout on mobile */
  .tab-content-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .tab-video-container {
    order: -1; /* Video on top */
  }

  .tab-content-title {
    font-size: 24px;
  }

  .tab-content-tagline {
    font-size: 14px;
  }

  .tab-content-description {
    font-size: 15px;
  }

  .tab-feature-item {
    font-size: 14px;
  }

  .feature-tabs-content {
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .tabbed-features-section {
    padding: 40px 0 50px;
  }

  .tabbed-features-header h2 {
    font-size: 28px;
  }

  .tab-content-layout {
    gap: 24px;
  }

  .tab-content-title {
    font-size: 22px;
  }

  .tab-cta-button {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
  }
}

/* Animation for video container */
.tab-video-container.loading {
  opacity: 0.5;
}

/* Accessibility */
.feature-tab:focus,
.feature-tabs-mobile-select:focus {
  outline: 2px solid #3d61df;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .tabbed-features-section {
    break-inside: avoid;
  }

  .feature-tabs {
    display: none;
  }

  .feature-tab-pane {
    display: block !important;
    opacity: 1 !important;
    page-break-inside: avoid;
  }
}

/* ============================================ */
/* Main Solution Video Section (Enhanced with Animations) */
/* ============================================ */

.main-solution {
  position: relative;
  background: linear-gradient(135deg,
    #4776E6 0%,
    #6B5FE8 25%,
    #8E54E9 50%,
    #5A7AE0 75%,
    #4776E6 100%
  );
  background-size: 200% 200%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 0;
  overflow: hidden;
  z-index: 1;
  animation: gradientShift 15s ease infinite;
}

/* Animated gradient background */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* SVG Pattern Decorations with Float + Pulse Animations (Desktop Only) */
@media (min-width: 1280px) {
  .main-solution::before,
  .main-solution::after {
    content: "";
    background: url(/wp-content/themes/plb/img/pattern.webp);
    background-size: auto;
    background-repeat: repeat;
    display: flex;
    width: 420px;
    height: 150%;
    position: absolute;
    top: -110px;
    right: -150px;
    z-index: 0;
    opacity: 0.6;
    animation:
      patternFloat 20s ease-in-out infinite,
      patternPulse 8s ease-in-out infinite;
  }

  .main-solution::before {
    left: -150px;
    right: auto;
    animation:
      patternFloat 25s ease-in-out infinite reverse,
      patternPulse 10s ease-in-out infinite;
  }
}

/* Pattern animations */
@keyframes patternFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(2deg);
  }
}

@keyframes patternPulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
  }
}

/* Floating Gradient Orbs */
.main-solution .orb-1 {
  position: absolute;
  top: 15%;
  right: 20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(33, 221, 144, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: orbFloat1 18s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
  filter: blur(40px);
}

.main-solution .orb-2 {
  position: absolute;
  bottom: 20%;
  left: 15%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(243, 185, 0, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  animation: orbFloat2 22s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
  filter: blur(50px);
}

@keyframes orbFloat1 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-30px, -40px) scale(1.1);
  }
  66% {
    transform: translate(20px, -20px) scale(0.9);
  }
}

@keyframes orbFloat2 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(40px, 30px) scale(1.15);
  }
  66% {
    transform: translate(-25px, 15px) scale(0.85);
  }
}

.video-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  width: 100%;
  max-width: 900px;
  position: relative;
  z-index: 10;
  padding: 0 20px;
}

.video-container iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 12px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 40px rgba(71, 118, 230, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-container:hover iframe {
  transform: scale(1.02);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.35),
    0 0 0 2px rgba(255, 255, 255, 0.2),
    0 0 60px rgba(71, 118, 230, 0.5);
}

/* Shimmer effect on hover */
.video-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.7s ease;
  pointer-events: none;
  border-radius: 12px;
  z-index: 20;
}

.video-container:hover::after {
  left: 100%;
}

/* Responsive adjustments for video */
@media (max-width: 768px) {
  .main-solution {
    padding: 60px 0;
    animation: gradientShift 20s ease infinite; /* Slower on mobile for performance */
  }

  /* Hide orbs on mobile for better performance */
  .main-solution .orb-1,
  .main-solution .orb-2 {
    display: none;
  }

  .video-container {
    max-width: 100%;
    padding: 0 20px;
  }

  .video-container iframe {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .main-solution {
    padding: 48px 0;
  }

  .video-container iframe {
    border-radius: 8px;
  }
}

/* Accessibility: Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .main-solution,
  .main-solution::before,
  .main-solution::after,
  .main-solution .orb-1,
  .main-solution .orb-2 {
    animation: none !important;
  }

  .video-container:hover iframe {
    transform: none;
  }

  .video-container::after {
    display: none;
  }
}

/* Responsive for hero tabs and content on mobile */
@media (max-width: 1024px) {
  .hero-tabs-container .feature-tab {
    padding: 14px 24px;
    font-size: 16px;
  }

  .hero-tabs-container .tab-content-layout {
    gap: 32px;
  }

  .hero-tabs-container .tab-content-title {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .hero-tabs-container {
    max-width: 95% !important;
    padding: 24px 16px !important;
  }

  .hero-tabs-container .feature-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px !important;
    margin-bottom: 32px !important;
  }

  .hero-tabs-container .feature-tabs::-webkit-scrollbar {
    display: none;
  }

  .hero-tabs-container .feature-tab {
    font-size: 14px;
    padding: 12px 20px;
    white-space: nowrap;
  }

  /* Stack video and content on mobile */
  .hero-tabs-container .tab-content-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-tabs-container .tab-video-container {
    order: -1; /* Video on top */
  }

  .hero-tabs-container .tab-content-title {
    font-size: 24px;
  }

  .hero-tabs-container .tab-content-tagline {
    font-size: 14px;
  }

  .hero-tabs-container .tab-content-description {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .hero-tabs-container .feature-tab {
    font-size: 13px;
    padding: 10px 16px;
  }

  .hero-tabs-container .tab-content-title {
    font-size: 22px;
  }

  .hero-tabs-container .tab-cta-button {
    width: 100%;
    justify-content: center;
  }
}
