/* ========================================
   Q&A PAGE - Styles
   ======================================== */

/* ===== HERO ===== */
.qa-hero {
  padding: 140px 0 80px;
  background: linear-gradient(160deg, #0D0520 0%, #1A0A3E 50%, #0D0520 100%);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.qa-hero-bg { position: absolute; inset: 0; pointer-events: none; }
.qa-circle { position: absolute; border-radius: 50%; }
.qa-c1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(107,70,255,0.2), transparent); top: -200px; right: -100px; }
.qa-c2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(255,107,157,0.15), transparent); bottom: -100px; left: -100px; }

.qa-hero-content { position: relative; z-index: 1; }
.qa-hero-content .section-title { color: white; }
.qa-hero-content .section-subtitle { color: rgba(255,255,255,0.65); margin: 0 auto 40px; }

/* Search */
.qa-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  padding: 14px 24px;
  max-width: 560px;
  margin: 0 auto 28px;
  transition: var(--transition);
}
.qa-search:focus-within {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 0 0 3px rgba(107,70,255,0.2);
}
.qa-search i { color: rgba(255,255,255,0.5); font-size: 1.1rem; flex-shrink: 0; }
.qa-search input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 1rem; color: white; font-family: inherit;
}
.qa-search input::placeholder { color: rgba(255,255,255,0.4); }
.qa-search-btn {
  padding: 8px 20px; border-radius: var(--radius-full);
  background: var(--primary); color: white;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  border: none; transition: var(--transition); font-family: inherit;
  flex-shrink: 0;
}
.qa-search-btn:hover { background: var(--primary-light); }

/* Quick Links */
.qa-quick-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.quick-link {
  padding: 8px 18px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: var(--transition); font-family: inherit;
}
.quick-link:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  border-color: rgba(255,255,255,0.2);
}

/* ===== Q&A LAYOUT ===== */
.qa-section { background: var(--bg-light); }
.qa-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
}

.qa-main {
  display: flex;
  flex-direction: column;
  gap: 48px;
  min-width: 0;
  width: 100%;
}
.qa-sidebar { position: sticky; top: calc(var(--nav-height) + 24px); }

.qa-cat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1.5px solid var(--border);
  margin-bottom: 20px;
}
.qa-cat-card h4 {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 16px;
}
.qa-cat {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.88rem; color: var(--text-secondary);
  transition: var(--transition); border: none; background: none;
  cursor: pointer; font-family: inherit;
  margin-bottom: 4px;
}
.qa-cat:last-child { margin-bottom: 0; }
.qa-cat i { width: 16px; text-align: center; color: var(--text-muted); flex-shrink: 0; }
.qa-cat span:nth-child(2) { flex: 1; text-align: left; font-weight: 500; }
.qa-cat:hover { color: var(--primary); background: rgba(107,70,255,0.06); }
.qa-cat:hover i { color: var(--primary); }
.qa-cat.active { color: var(--primary); background: rgba(107,70,255,0.08); font-weight: 600; }
.qa-cat.active i { color: var(--primary); }

.qa-count {
  background: var(--bg-light);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.qa-cat.active .qa-count { background: rgba(107,70,255,0.1); color: var(--primary); }

.qa-contact-card {
  background: linear-gradient(135deg, #F0EEFF, #E8E0FF);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1.5px solid rgba(107,70,255,0.15);
  text-align: center;
}
.qc-icon { font-size: 2rem; margin-bottom: 12px; }
.qa-contact-card h4 { font-weight: 700; margin-bottom: 8px; font-size: 0.95rem; }
.qa-contact-card p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; }

/* ===== Q&A MAIN ===== */


.qa-group { }

.qa-group-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary);
}
.qa-group-header i { font-size: 1.2rem; color: var(--primary); }
.qa-group-header h3 { font-size: 1.1rem; font-weight: 700; }

/* ===== CONTACT FORM ===== */
.qa-contact-form {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1.5px solid var(--border);
}
.qcf-inner { padding: 40px; }
.qcf-header {
  display: flex; align-items: flex-start; gap: 20px;
  margin-bottom: 32px;
}
.qcf-header > i {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.4rem; flex-shrink: 0;
}
.qcf-header h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.qcf-header p { color: var(--text-secondary); font-size: 0.9rem; }

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.cf-select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-light);
  outline: none;
  transition: var(--transition);
  cursor: pointer;
  -webkit-appearance: none;
}
.cf-select:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(107,70,255,0.1); }

.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-light);
  outline: none;
  resize: vertical;
  transition: var(--transition);
  min-height: 120px;
}
.contact-form textarea:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(107,70,255,0.1); }
.contact-form textarea::placeholder { color: var(--text-muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .qa-layout { grid-template-columns: 240px 1fr; gap: 32px; }
}

/* ===== GLOBAL MOBILE OVERFLOW FIX ===== */
@media (max-width: 768px) {
  html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .qa-section,
  .qa-layout,
  .qa-sidebar,
  .qa-main,
  .qa-group,
  .qa-group-header,
  .accordion-list,
  .accordion-item,
  .accordion-header,
  .accordion-body,
  .accordion-content,
  .qa-cat-card,
  .qa-contact-form,
  .qcf-inner,
  .contact-form,
  .container {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  /* Prevent any child from expanding beyond viewport */
  .qa-main > * { max-width: 100%; }
  .accordion-content * { max-width: 100%; word-break: break-word; }
}

/* ===== MOBILE CATEGORY TOGGLE (hidden on desktop) ===== */
.qa-mobile-cat-toggle { display: none; }

@media (max-width: 768px) {
  /* Layout */
  .qa-layout { grid-template-columns: 1fr; gap: 0; }
  .qa-sidebar { position: static; margin-bottom: 20px; width: 100%; box-sizing: border-box; overflow: hidden; }
  .qa-contact-card { display: none; }

  /* Mobile dropdown toggle button */
  .qa-mobile-cat-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }
  .qa-mobile-cat-toggle:hover { border-color: var(--primary); }
  .qa-mobile-cat-label { display: flex; align-items: center; gap: 10px; color: var(--primary); }
  .qa-mobile-cat-label i { font-size: 1rem; }
  .qa-mobile-cat-arrow { color: var(--text-muted); font-size: 0.9rem; transition: transform 0.25s ease; }

  /* Category card: hidden by default on mobile, shown when open */
  .qa-cat-card {
    display: none;
    flex-direction: column;
    border-radius: var(--radius-md);
    padding: 12px;
    border: 1.5px solid var(--border);
    margin-bottom: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    max-height: 60vh;
    overflow-y: auto;
  }
  .qa-cat-card.open { display: flex; }
  .qa-cat-card h4 { display: block; width: 100%; margin-bottom: 10px; }

  /* Category buttons in dropdown */
  .qa-cat {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .qa-cat i { display: inline-block; width: 18px; text-align: center; }
  .qa-cat.active {
    background: var(--primary);
    color: white;
  }
  .qa-cat.active i { color: white; }

  /* Hero */
  .qa-hero { padding: 100px 0 52px; }
  .qa-search { padding: 11px 14px; gap: 8px; }
  .qa-search input { font-size: 0.88rem; }
  .qa-search-btn { padding: 7px 14px; font-size: 0.8rem; }
  .qa-quick-links { gap: 6px; }
  .quick-link { padding: 6px 12px; font-size: 0.77rem; }

  /* Main QA area */
  .qa-main { gap: 28px; }
  .qa-group-header h3 { font-size: 1rem; }
  .accordion-header { font-size: 0.88rem; padding: 14px 16px; }
  .accordion-content { font-size: 0.86rem; padding: 0 16px 16px; line-height: 1.75; }

  /* Photos in accordion */
  .qa-photo-gallery { gap: 8px; margin-top: 14px; }
  .qa-photo-item { flex: 1 1 100px; max-width: 160px; }

  /* Contact form */
  .qcf-inner { padding: 20px 16px; }
  .cf-row { grid-template-columns: 1fr; }
  .qa-section { padding: 28px 0 56px; }

  /* Lightbox on mobile */
  .lightbox-img-wrap { max-width: 98vw; max-height: 80vh; border-radius: 10px; }
  #lightboxImg { max-width: 98vw; max-height: 80vh; border-radius: 10px; }
  .lightbox-container { gap: 0; }
  .lightbox-prev,
  .lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 38px; height: 38px;
    font-size: 0.85rem;
    z-index: 10001;
    background: rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.2);
  }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
  .lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; font-size: 1rem; }
  .lightbox-caption { font-size: 0.8rem; bottom: 16px; }
  .lightbox-counter { font-size: 0.78rem; top: 16px; }
}

/* ===== PHOTO GALLERY ===== */
.qa-photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.qa-photo-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  flex: 1 1 140px;
  max-width: 200px;
  aspect-ratio: 4/3;
  background: var(--bg-light);
  border: 2px solid var(--border);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.qa-photo-item:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 28px rgba(107,70,255,0.22);
  border-color: var(--primary);
}
.qa-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.qa-photo-item:hover img { transform: scale(1.06); }

.qa-photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,5,32,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.qa-photo-item:hover .qa-photo-overlay { opacity: 1; }
.qa-photo-overlay i {
  color: white;
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,4,20,0.93);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
  animation: lbFadeIn 0.22s ease;
}
.lightbox-overlay.active { display: flex; }

@keyframes lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 92vw;
  max-height: 92vh;
  width: 100%;
}

.lightbox-img-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  max-width: 80vw;
  max-height: 82vh;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
}
#lightboxImg {
  max-width: 80vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 16px;
  animation: lbZoomIn 0.25s ease;
}
@keyframes lbZoomIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.lightbox-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 1.8rem;
  display: none;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.18);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }

.lightbox-prev,
.lightbox-next {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(107,70,255,0.4); transform: scale(1.1); }

.lightbox-caption {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  font-size: 0.88rem;
  text-align: center;
  max-width: 80vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lightbox-counter {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
  background: rgba(0,0,0,0.4);
  padding: 4px 14px;
  border-radius: 99px;
}
