/* ================================
   Modern Premium FAQ CSS - Professional Redesign
   ================================ */

:root {
  --primary: #e63946;
  --primary-dark: #c42532;
  --primary-light: #ff4d5a;
  --accent: #1d3557;
  --accent-light: #457b9d;
  --dark: #0a0e27;
  --light: #f8f9fa;
  --white: #ffffff;
  --muted: #6b7280;
  --gradient-primary: linear-gradient(135deg, #e63946 0%, #ff4d5a 100%);
  --gradient-dark: linear-gradient(135deg, #1d3557 0%, #0a0e27 100%);
  --gradient-accent: linear-gradient(135deg, #457b9d 0%, #1d3557 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 40px rgba(230, 57, 70, 0.3);
  --shadow-glow-strong: 0 0 60px rgba(230, 57, 70, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: var(--dark);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* ===== FAQ Page Section ===== */
.faq-page {
  background: linear-gradient(180deg, var(--white) 0%, var(--light) 100%);
  position: relative;
  padding: 6rem 0;
  min-height: 400px;
}

.faq-content {
  margin-top: 3rem;
}

/* ===== Search Bar ===== */
.faq-search-wrapper {
  margin: 3rem 0 2rem;
  display: flex;
  justify-content: center;
}

.faq-search {
  position: relative;
  max-width: 700px;
  width: 100%;
}

.faq-search svg {
  position: absolute;
  left: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--muted);
  z-index: 2;
  pointer-events: none;
  transition: all 0.3s ease;
}

.faq-search:focus-within svg {
  color: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

.faq-search input {
  width: 100%;
  padding: 1.35rem 1.75rem 1.35rem 4.5rem;
  border: 2px solid rgba(230, 57, 70, 0.15);
  border-radius: 16px;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--accent);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
}

.faq-search input:hover {
  border-color: rgba(230, 57, 70, 0.25);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.faq-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.15), var(--shadow-lg);
  background: var(--white);
  transform: translateY(-3px) scale(1.01);
}

.faq-search input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.search-results-count {
  position: absolute;
  right: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 3;
  background: rgba(230, 57, 70, 0.1);
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
}

.search-results-count.show {
  opacity: 1;
}

/* ===== Category Filter Tabs ===== */
.faq-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2.5rem 0 3rem;
  padding: 0 1rem;
}

.category-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(230, 57, 70, 0.1);
  border-radius: 50px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.category-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.category-tab:hover {
  transform: translateY(-2px);
  border-color: rgba(230, 57, 70, 0.3);
  box-shadow: var(--shadow-md);
}

.category-tab.active {
  background: var(--gradient-primary);
  border-color: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-glow);
}

.category-tab.active::before {
  opacity: 1;
}

.tab-icon,
.tab-text,
.tab-count {
  position: relative;
  z-index: 1;
}

.tab-icon {
  font-size: 1.2rem;
}

.tab-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.category-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.3);
}

/* ===== Category Groups ===== */
.faq-categories {
  margin-top: 2rem;
}

.faq-category-group {
  margin-bottom: 4rem;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.faq-category-header {
  margin-bottom: 1.5rem;
}

.faq-category {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: var(--gradient-primary);
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 1rem 2rem;
  margin: 0;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.category-icon {
  font-size: 1.5rem;
}

.category-title {
  flex: 1;
}

.category-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

/* ===== FAQ Items ===== */
.faq-items {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-item {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid rgba(230, 57, 70, 0.08);
  overflow: hidden;
  position: relative;
  animation: slideInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.faq-item:nth-child(1) { animation-delay: 0.05s; }
.faq-item:nth-child(2) { animation-delay: 0.1s; }
.faq-item:nth-child(3) { animation-delay: 0.15s; }
.faq-item:nth-child(4) { animation-delay: 0.2s; }
.faq-item:nth-child(5) { animation-delay: 0.25s; }
.faq-item:nth-child(6) { animation-delay: 0.3s; }
.faq-item:nth-child(7) { animation-delay: 0.35s; }
.faq-item:nth-child(8) { animation-delay: 0.4s; }
.faq-item:nth-child(n+9) { animation-delay: 0.45s; }

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

.faq-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 20px rgba(230, 57, 70, 0.5);
}

.faq-item.open::before {
  transform: scaleX(1);
}

.faq-item:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-xl);
  border-color: rgba(230, 57, 70, 0.2);
}

.faq-item.open {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow-strong);
  background: rgba(255, 255, 255, 1);
}

.faq-question {
  width: 100%;
  padding: 1.75rem 5.5rem 1.75rem 2rem;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: -0.3px;
  line-height: 1.5;
}

.faq-question:hover {
  color: var(--primary);
  padding-left: 2.5rem;
}

.faq-question::after {
  content: '▾';
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  font-size: 1.4rem;
  color: var(--white);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-accent);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.faq-question:hover::after {
  background: var(--gradient-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-50%) rotate(0deg) scale(1.1);
}

.faq-item.open .faq-question::after {
  transform: translateY(-50%) rotate(180deg);
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-glow);
}

.faq-item.open .faq-question {
  color: var(--primary);
  padding-bottom: 1.5rem;
}

.faq-answer {
  max-height: 0;
  padding: 0 2rem;
  background: transparent;
  overflow: hidden;
  transition: 
    max-height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    padding 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 0.5s ease;
  opacity: 0;
}

.faq-item.open .faq-answer {
  padding: 0 2rem 2rem;
  max-height: 1000px;
  opacity: 1;
  border-top: 2px solid rgba(230, 57, 70, 0.1);
  margin-top: 0.5rem;
}

.faq-answer p {
  margin: 1.5rem 0 0;
  line-height: 1.8;
  color: #444;
  font-size: 1.05rem;
  animation: fadeInContent 0.7s ease-out 0.2s both;
  font-weight: 500;
}

.faq-answer div {
  margin: 0;
  line-height: 1.8;
  color: #444;
  font-size: 1.05rem;
  animation: fadeInContent 0.7s ease-out 0.2s both;
  font-weight: 500;
}

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

/* ===== Empty State ===== */
.faq-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  margin: 3rem 0;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.faq-empty-state h3 {
  font-size: 1.75rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.faq-empty-state p {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.btn-clear-search {
  padding: 0.875rem 2rem;
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.btn-clear-search:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ===== Contact CTA ===== */
.faq-cta {
  margin-top: 6rem;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.05), rgba(255, 142, 83, 0.05));
  border-radius: 28px;
  border: 2px solid rgba(230, 57, 70, 0.1);
  text-align: center;
}

.cta-content h3 {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 800;
}

.cta-content p {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.125rem 2.5rem;
  border-radius: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-md);
}

.cta-btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
}

.cta-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.cta-btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.cta-btn-secondary:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.cta-btn svg {
  width: 20px;
  height: 20px;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .faq-page {
    padding: 4rem 0;
  }

  .faq-search-wrapper {
    margin: 2rem 0 1.5rem;
  }

  .faq-search input {
    padding: 1.15rem 1.5rem 1.15rem 3.75rem;
    font-size: 1rem;
  }

  .faq-search svg {
    left: 1.5rem;
    width: 20px;
    height: 20px;
  }

  .search-results-count {
    right: 1.5rem;
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
  }

  .faq-category-tabs {
    gap: 0.75rem;
    margin: 2rem 0;
  }

  .category-tab {
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    gap: 0.5rem;
  }

  .tab-icon {
    font-size: 1.1rem;
  }

  .tab-count {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
  }

  .faq-category {
    font-size: 0.95rem;
    padding: 0.875rem 1.5rem;
    gap: 0.75rem;
  }

  .category-icon {
    font-size: 1.3rem;
  }

  .faq-item {
    border-radius: 20px;
    margin-bottom: 0;
  }

  .faq-question {
    padding: 1.5rem 4.5rem 1.5rem 1.5rem;
    font-size: 1.05rem;
  }

  .faq-question:hover {
    padding-left: 1.5rem;
  }

  .faq-question::after {
    right: 1.25rem;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }

  .faq-answer {
    padding: 0 1.5rem;
  }

  .faq-item.open .faq-answer {
    padding: 0 1.5rem 1.75rem;
  }

  .faq-answer div,
  .faq-answer p {
    font-size: 1rem;
    line-height: 1.7;
  }

  .faq-cta {
    margin-top: 4rem;
    padding: 3rem 1.5rem;
  }

  .cta-content h3 {
    font-size: 1.75rem;
  }

  .cta-content p {
    font-size: 1rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .faq-page {
    padding: 3rem 0;
  }

  .faq-category {
    font-size: 0.85rem;
    padding: 0.75rem 1.25rem;
  }

  .faq-question {
    padding: 1.25rem 4rem 1.25rem 1.25rem;
    font-size: 1rem;
  }

  .faq-question::after {
    right: 1rem;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .faq-answer div,
  .faq-answer p {
    font-size: 0.95rem;
  }

  .category-tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

/* ===== Focus Styles for Accessibility ===== */
.faq-question:focus {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
  border-radius: 20px;
}

.faq-question:focus:not(:focus-visible) {
  outline: none;
}

.category-tab:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.category-tab:focus:not(:focus-visible) {
  outline: none;
}

/* ===== Print Styles ===== */
@media print {
  .faq-search-wrapper,
  .faq-category-tabs,
  .faq-cta {
    display: none;
  }
  
  .faq-item {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .faq-question::after {
    display: none;
  }
  
  .faq-answer {
    max-height: none !important;
    opacity: 1 !important;
    padding: 1rem 2rem !important;
  }
}
