/**
 * CONTENT SECTIONS STYLES
 *
 * Contains:
 * - FAQ Section (accordion)
 * - About Section (statistics)
 * - Pricing Section (pricing cards)
 * - Services Section (flip cards)
 *
 * Dependencies: base.css, components.css
 */

/* ===== FAQ SECTION ===== */
.faq-section {
  padding: var(--space-2xl) 0;
  position: relative;
  overflow: hidden;
}

/* Background gradient similar to process-hero */
.faq-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center,
      rgba(147, 228, 1, 0.08) 0%,
      rgba(147, 228, 1, 0.02) 40%,
      transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.faq-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-normal) ease;
}

.faq-item.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
}

.faq-item.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

.faq-question {
  width: 100%;
  background: radial-gradient(47.2% 50% at 50.39% 88.37%,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0) 100%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: left;
  font-size: 1.1rem;
  font-weight: var(--font-weight-medium);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-normal) ease;
  position: relative;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Glass effect border similar to scrollbar-glass */
.faq-question::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1px;
  background: linear-gradient(150deg,
      rgba(255, 255, 255, 0.48) 16.73%,
      rgba(255, 255, 255, 0.08) 30.2%,
      rgba(255, 255, 255, 0.08) 68.2%,
      rgba(255, 255, 255, 0.6) 81.89%);
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-normal) ease;
}

.faq-question:hover {
  background: radial-gradient(47.2% 50% at 50.39% 88.37%,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(255, 255, 255, 0) 100%),
    rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.faq-question:hover::before {
  opacity: 0.6;
  background: linear-gradient(150deg,
      rgba(212, 248, 153, 0.3) 16.73%,
      rgba(111, 179, 0, 0.2) 30.2%,
      rgba(111, 179, 0, 0.2) 68.2%,
      rgba(212, 248, 153, 0.3) 81.89%);
}

.faq-question:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.faq-question.active {
  background: radial-gradient(47.2% 50% at 50.39% 88.37%,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(255, 255, 255, 0) 100%),
    rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.faq-question.active::before {
  opacity: 0.6;
  background: linear-gradient(150deg,
      rgba(212, 248, 153, 0.3) 16.73%,
      rgba(111, 179, 0, 0.2) 30.2%,
      rgba(111, 179, 0, 0.2) 68.2%,
      rgba(212, 248, 153, 0.3) 81.89%);
}

.faq-question-text {
  flex: 1;
  padding-right: var(--space-md);
  line-height: 1.4;
}

.faq-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-normal) ease;
  color: var(--brand);
}

.faq-question.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out,
    padding 0.3s ease-in-out,
    opacity 0.2s ease-in-out 0.1s;
  padding: 0 var(--space-lg);
  color: var(--muted);
  line-height: 1.6;
  opacity: 0;
}

.faq-answer[aria-hidden="false"] {
  max-height: 500px;
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  opacity: 1;
  transition: max-height 0.4s ease-in-out,
    padding 0.3s ease-in-out,
    opacity 0.2s ease-in-out 0.1s;
}

.faq-answer p {
  margin: 0;
}

/* Responsive design */
@media (max-width: 768px) {
  .faq-section {
    padding: var(--space-xl) 0;
  }

  .faq-container {
    gap: var(--space-sm);
  }

  .faq-question {
    padding: var(--space-md);
    font-size: 1rem;
  }

  .faq-question-text {
    padding-right: var(--space-sm);
  }

  .faq-answer {
    transition: max-height 0.4s ease-in-out,
      padding 0.3s ease-in-out,
      opacity 0.2s ease-in-out 0.1s;
  }

  .faq-answer[aria-hidden="false"] {
    max-height: 400px;
    padding: var(--space-sm) var(--space-md) var(--space-md);
    opacity: 1;
    transition: max-height 0.4s ease-in-out,
      padding 0.3s ease-in-out,
      opacity 0.2s ease-in-out 0.1s;
  }
}

@media (max-width: 480px) {
  .faq-question {
    font-size: 0.95rem;
  }

  .faq-icon {
    width: 20px;
    height: 20px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .faq-item {
    transition: none;
  }

  .faq-question {
    transition: none;
  }

  .faq-question:hover {
    transform: none;
  }

  .faq-icon {
    transition: none;
  }

  .faq-answer {
    transition: none;
  }

  .faq-question.active .faq-icon {
    transform: none;
  }
}

/* ===== ABOUT SECTION ===== */
.about-section {
  padding: var(--space-2xl) var(--space-md);
  background: oklch(from var(--brand) 0.08 calc(c/2) h / 0.03);
  position: relative;
  overflow: hidden;
}

.about-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, oklch(from var(--brand) 0.15 calc(c/2) h / 0.3), transparent 60%);
  z-index: -1;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.about-text {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--muted);
}

.about-text p {
  margin-bottom: var(--space-md);
}

.about-text strong {
  color: var(--brand);
  font-weight: var(--font-weight-bold);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.stat-item {
  background: oklch(from var(--brand) 0.05 calc(c/2) h / 0.08);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--brand) 0.3 calc(c/2) h / 0.2);
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, oklch(from var(--brand) 0.3 calc(c/2) h / 0.2), transparent);
  transition: left 0.5s ease;
}

.stat-item:hover {
  transform: translateY(-5px);
  border-color: oklch(from var(--brand) 0.5 calc(c/2) h / 0.4);
  box-shadow: 0 10px 30px oklch(from var(--brand) 0.3 calc(c/2) h / 0.3);
}

.stat-item:hover::before {
  left: 100%;
}

/* Auto-hover animation class */
.stat-item.auto-hover {
  transform: translateY(-5px);
  border-color: oklch(from var(--brand) 0.5 calc(c/2) h / 0.4);
  box-shadow: 0 10px 30px oklch(from var(--brand) 0.3 calc(c/2) h / 0.3);
}

.stat-item.auto-hover::before {
  left: 100%;
}

.stat-number {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--font-weight-black);
  color: var(--brand);
  margin-bottom: var(--space-xs);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Animation for about section elements */
.about-text.animate-on-scroll,
.about-stats.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.about-text.animate-in,
.about-stats.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive design for about section */
@media (max-width: 768px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .about-stats {
    grid-template-columns: 1fr;
  }

  .about-text {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .about-section {
    padding: var(--space-xl) var(--space-sm);
  }

  .stat-item {
    padding: var(--space-md);
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.85rem;
  }
}

/* ===== PRICING SECTION ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.pricing-card {
  background: oklch(from var(--brand) 0.05 calc(c/2) h / 0.05);
  border: 1px solid oklch(from var(--brand) 0.3 calc(c/2) h / 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
  overflow: hidden;
}

.pricing-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.pricing-card:hover {
  transform: translateY(-8px);
  border-color: var(--brand);
  box-shadow: 0 20px 40px oklch(from var(--brand) 0.3 calc(c/2) h / 0.2);
}

.pricing-popular {
  border-color: var(--brand);
  background: oklch(from var(--brand) 0.08 calc(c/2) h / 0.08);
}

.popular-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--brand);
  color: white;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: var(--font-weight-bold);
  box-shadow: 0 4px 12px rgba(147, 228, 1, 0.4);
}

.pricing-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.pricing-title {
  font-size: 1.875rem;
  font-weight: var(--font-weight-black);
  color: var(--fg);
  margin-bottom: var(--space-md);
}

.pricing-price {
  margin-bottom: var(--space-md);
}

.price-amount {
  font-size: 3rem;
  font-weight: var(--font-weight-black);
  color: var(--brand);
  display: block;
  line-height: 1;
}

.price-period {
  color: var(--muted);
  font-size: 1rem;
  margin-left: var(--space-xs);
}

.pricing-description {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.pricing-features {
  margin-bottom: var(--space-xl);
}

.features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.features-list .feature-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--fg);
  font-size: 1rem;
  opacity: 1 !important;
  visibility: visible !important;
}

.features-list .feature-item svg {
  color: var(--brand);
  flex-shrink: 0;
}

.pricing-action {
  text-align: center;
}

.pricing-action .btn {
  width: 100%;
  justify-content: center;
}

/* Additional Services Section */
.additional-services {
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid oklch(from var(--brand) 0.2 calc(c/2) h / 0.1);
}

.additional-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.service-item {
  background: oklch(from var(--brand) 0.03 calc(c/2) h / 0.03);
  border: 1px solid oklch(from var(--brand) 0.2 calc(c/2) h / 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  opacity: 1;
  transform: translateY(0);
  transition: all 0.5s ease;
}

.service-item.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.service-item:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  background: oklch(from var(--brand) 0.05 calc(c/2) h / 0.05);
}

/* Special styling for "Optymalizacja stron" service item */
.service-item.optimization-highlight {
  border-color: var(--brand);
  background: oklch(from var(--brand) 0.05 calc(c/2) h / 0.05);
}

.service-item.optimization-highlight:hover {
  transform: translateY(-4px);
  /* Keep the same border and background on hover */
  border-color: var(--brand);
  background: oklch(from var(--brand) 0.05 calc(c/2) h / 0.05);
}

.service-item h4 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--fg);
  margin-bottom: var(--space-sm);
}

.service-item p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.service-price {
  color: var(--brand);
  font-weight: var(--font-weight-bold);
  font-size: 1.125rem;
}

/* Responsive Design for Pricing */
@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .pricing-card {
    padding: var(--space-lg);
  }

  .price-amount {
    font-size: 2.5rem;
  }

  .additional-services-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .pricing-card {
    padding: var(--space-lg);
  }

  .price-amount {
    font-size: 2rem;
  }

  .popular-badge {
    display: none;
  }
}

/* Sequential animations for pricing cards */
.pricing-card:nth-child(1).animate-in {
  transition-delay: 0s;
}

.pricing-card:nth-child(2).animate-in {
  transition-delay: 0.2s;
}

.pricing-card:nth-child(3).animate-in {
  transition-delay: 0.4s;
}

/* Sequential animations for service items */
.service-item:nth-child(1).animate-in {
  transition-delay: 0s;
}

.service-item:nth-child(2).animate-in {
  transition-delay: 0.15s;
}

.service-item:nth-child(3).animate-in {
  transition-delay: 0.3s;
}

/* ===== SERVICES SECTION ===== */
.services-section {
  padding: var(--space-2xl) var(--space-md);
  color: var(--fg);
  position: relative;
}

.services-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, oklch(from var(--brand) 0.35 calc(c/2) h / 0.6), transparent 50%),
    radial-gradient(circle at 70% 30%, oklch(from var(--brand) 0.3 calc(c/2) h / 0.5), transparent 50%),
    radial-gradient(circle at 15% 70%, oklch(from var(--brand) 0.25 calc(c/2) h / 0.45), transparent 60%);
  z-index: -1;
}

.services-container {
  max-width: 1200px;
  margin: 0 auto;
}

.services-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.services-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--hero-muted);
  margin-bottom: var(--space-xl);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
}

/* 2 columns for medium screens */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Service Card Base */
.service-card {
  background: oklch(from var(--brand) 0.05 calc(c/2) h / 0.05);
  border: 1px solid oklch(from var(--brand) 0.3 calc(c/2) h / 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  min-height: 500px;
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--brand);
  box-shadow: 0 10px 30px oklch(from var(--brand) 0.3 calc(c/2) h / 0.3);
}

/* Service Icon */
.service-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  color: var(--brand);
}

.service-icon svg {
  width: 100%;
  height: 100%;
}

/* Service Title */
.service-title {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--fg);
  margin-bottom: var(--space-sm);
}

/* Service Price */
.service-price {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: var(--space-lg);
}

.service-price strong {
  color: var(--brand);
  font-size: 1.5rem;
  font-weight: var(--font-weight-black);
}

/* Service Features List */
.service-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl) 0;
  width: 100%;
  flex: 1;
}

.service-features li {
  padding: var(--space-xs) 0;
  color: var(--muted);
  font-size: 0.95rem;
  position: relative;
  padding-left: 24px;
  text-align: left;
}

.service-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-size: 1rem;
  font-weight: var(--font-weight-bold);
}

/* CTA Button */
.service-card .btn {
  margin-top: auto;
  width: 100%;
}

/* Animation on scroll */
.service-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.service-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation for cards */
.service-card:nth-child(1).animate-in {
  transition-delay: 0s;
}

.service-card:nth-child(2).animate-in {
  transition-delay: 0.1s;
}

.service-card:nth-child(3).animate-in {
  transition-delay: 0.2s;
}

.service-card:nth-child(4).animate-in {
  transition-delay: 0.3s;
}

.service-card:nth-child(5).animate-in {
  transition-delay: 0.4s;
}

.service-card:nth-child(6).animate-in {
  transition-delay: 0.5s;
}

/* Ensure buttons animate with their cards */
.service-card.animate-in .btn {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

/* Responsive Design */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .services-section {
    padding: var(--space-xl) var(--space-md);
  }

  .service-card {
    height: 400px;
  }

  .service-card-front,
  .service-card-back {
    padding: var(--space-lg);
  }

  .service-icon {
    width: 60px;
    height: 60px;
  }

  /* Disable flip animation on mobile, show both sides stacked */
  .service-card-inner {
    transform: none !important;
  }

  .service-card:hover .service-card-inner {
    transform: none !important;
  }
}

@media (max-width: 480px) {
  .services-section {
    padding: var(--space-xl) var(--space-md);
  }

  .service-card {
    height: 380px;
  }

  .service-card-front,
  .service-card-back {
    padding: var(--space-md);
  }

  .service-icon {
    width: 48px;
    height: 48px;
  }

  .service-title {
    font-size: 1.125rem;
  }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .service-card-inner {
    transition: none;
  }

  .service-card:hover .service-card-inner {
    transform: none;
  }

  .service-card {
    opacity: 1;
    transform: translateY(0);
    transition: none;
  }

  .service-icon,
  .service-icon svg {
    transition: none;
  }

  .service-card-front::before {
    animation: none;
  }
}
