/* ====================================================
   style.css — Main Frontend Styles
   ==================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', sans-serif; background: #f7f8fc; color: #222; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Header ──────────────────────────────────────── */
.site-header {
  background: #1a2436;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 20px;
  position: relative;
}
.site-logo { display: flex; align-items: center; gap: 8px; }
.logo-text {
  font-size: 20px; font-weight: 700; color: #fff;
  letter-spacing: -.3px;
}
.main-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.main-nav a {
  color: #b0bac9; padding: 7px 11px; border-radius: 6px;
  font-size: 13px; transition: all .2s;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; margin-left: auto; padding: 4px 8px; }

/* ── Downloader Section ───────────────────────────── */
.downloader-container { max-width: 1000px; margin: 30px auto; padding: 0 16px; }
.search-section {
  padding: 44px 20px; border-radius: 14px;
  text-align: center; color: #fff; margin-bottom: 24px;
  overflow: hidden;
}
.search-title   { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.search-subtitle { font-size: 15px; opacity: .8; margin-bottom: 24px; }
.form-group-download {
  display: flex; max-width: 700px; margin: 0 auto;
  background: #fff; padding: 5px; border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.form-group-download input {
  flex: 1; border: none; padding: 12px 14px;
  font-size: 14px; outline: none; color: #333; border-radius: 5px;
  min-width: 0;
}
.form-group-download button {
  background: #5e4cd8; color: #fff; border: none;
  padding: 12px 22px; border-radius: 5px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: background .2s;
  white-space: nowrap; flex-shrink: 0;
}
.form-group-download button:hover { background: #4939b9; }

/* ── Error Box ────────────────────────────────────── */
.error-box {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff5f5; border: 1px solid #feb2b2;
  border-radius: 10px; padding: 18px 20px; margin-bottom: 20px;
}
.error-box > i { color: #e53e3e; font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.error-box strong { display: block; color: #c53030; margin-bottom: 4px; }
.error-box p { color: #742a2a; font-size: 14px; }

/* ── Result Card ──────────────────────────────────── */
.result-card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,.07);
  padding: 24px; border: 1px solid #f0f0f0;
}
.result-header { margin-bottom: 20px; }
.result-header h3 { font-size: 19px; color: #222; line-height: 1.4; word-break: break-word; }
.result-header p { margin-top: 6px; color: #666; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.result-body { display: flex; gap: 26px; flex-wrap: wrap; }
.video-preview-box { flex: 1; min-width: 260px; position: relative; }
.video-preview-box img {
  width: 100%; border-radius: 10px; object-fit: cover;
  max-height: 280px; box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.platform-badge {
  position: absolute; bottom: 12px; left: 12px;
  color: #fff; padding: 5px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.download-options-box { flex: 1; min-width: 260px; }
.download-options-box h4 {
  font-size: 13px; text-transform: uppercase;
  letter-spacing: .5px; color: #888; margin-bottom: 12px;
}
.format-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid #edf0f5; gap: 12px;
}
.format-row:last-child { border-bottom: none; }
.format-info p { font-weight: 600; font-size: 14px; color: #222; }
.format-info span { font-size: 12px; color: #888; display: block; margin-top: 2px; }
.btn-download {
  color: #fff !important; padding: 9px 16px; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity .2s; white-space: nowrap; flex-shrink: 0;
  display: inline-block; text-align: center; min-width: 90px;
}
.btn-download:hover { opacity: .88; }

/* ── Footer ───────────────────────────────────────── */
.site-footer {
  background: #1a2436;
  color: #b0bac9;
  padding: 36px 20px;
  margin-top: 60px;
}
.footer-inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.footer-platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 20px; }
.footer-platforms a { color: #b0bac9; font-size: 14px; display: flex; align-items: center; gap: 6px; transition: color .2s; }
.footer-platforms a:hover { color: #fff; }
.footer-copy { font-size: 13px; opacity: .6; }

/* ════════════════════════════════════════════════════════
   Platform Content Sections (platform-content.php)
   ════════════════════════════════════════════════════════ */

.pc-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
}

.pc-section {
  margin: 50px 0;
}

.pc-section-title {
  font-size: 26px;
  font-weight: 700;
  color: #111;
  text-align: center;
  margin-bottom: 10px;
}

.pc-section-sub {
  font-size: 15px;
  color: #666;
  text-align: center;
  margin-bottom: 32px;
}

/* ── Formats Pills ─────────────────────────────────── */
.pc-formats-pills {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.pc-pill {
  color: #fff;
  padding: 9px 24px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .3px;
}

/* ── Feature Cards ─────────────────────────────────── */
.pc-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.pc-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 28px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  transition: transform .3s, box-shadow .3s;
  text-align: center;
}

.pc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.pc-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 22px;
}

.pc-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  margin-bottom: 10px;
}

.pc-card p {
  font-size: 13px;
  color: #666;
  line-height: 1.65;
  margin: 0;
}

/* ── Steps ─────────────────────────────────────────── */
.pc-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.pc-step-box {
  text-align: center;
}

.pc-step-num {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-weight: 700;
  font-size: 20px;
}

.pc-step-box h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #222;
}

.pc-step-box p {
  font-size: 13px;
  color: #666;
  line-height: 1.65;
}

/* ── FAQ ────────────────────────────────────────────── */
.pc-faq-box {
  max-width: 820px;
  margin: 0 auto;
}

.pc-faq-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.pc-faq-item summary {
  padding: 17px 22px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  outline: none;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  color: #222;
}

.pc-faq-item summary::-webkit-details-marker { display: none; }

.pc-faq-item summary::after {
  content: '\276F';
  transform: rotate(90deg);
  transition: transform .2s;
  font-size: 12px;
  color: #aaa;
  flex-shrink: 0;
  margin-left: 10px;
}

.pc-faq-item[open] summary::after {
  transform: rotate(-90deg);
}

.pc-faq-content {
  padding: 0 22px 18px;
  color: #555;
  font-size: 14px;
  line-height: 1.7;
  border-top: 1px solid #f5f5f5;
  margin-top: 0;
  padding-top: 14px;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE FIXES
   ══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .pc-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  /* ── Nav ── */
  .main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a2436;
    padding: 8px 12px 12px;
    z-index: 200;
    box-shadow: 0 6px 16px rgba(0,0,0,.3);
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }

  /* ── Downloader Hero ── */
  .search-section {
    padding: 30px 16px;
    border-radius: 12px;
  }
  .search-title { font-size: 20px; }
  .search-subtitle { font-size: 13px; margin-bottom: 18px; }

  /* ── Download Form ── */
  .form-group-download {
    flex-direction: column;
    gap: 0;
    padding: 8px;
    border-radius: 10px;
  }
  .form-group-download input {
    width: 100%;
    border-radius: 6px;
    padding: 12px 12px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
  }
  .form-group-download button {
    width: 100%;
    border-radius: 6px;
    margin-top: 6px;
    padding: 13px;
    font-size: 15px;
  }

  /* ── Result Card ── */
  .result-body { flex-direction: column; }
  .video-preview-box, .download-options-box { min-width: unset; width: 100%; }

  /* ── Platform Content ── */
  .pc-section { margin: 36px 0; }
  .pc-section-title { font-size: 20px; }
  .pc-section-sub   { font-size: 13px; margin-bottom: 22px; }
  .pc-grid-3        { grid-template-columns: 1fr; gap: 14px; }
  .pc-steps-grid    { grid-template-columns: 1fr; gap: 20px; }
  .pc-card          { padding: 22px 16px; }

  /* ── Footer ── */
  .site-footer { padding: 28px 16px; margin-top: 40px; }
  .footer-platforms { gap: 10px; }
  .footer-platforms a { font-size: 13px; }
}

@media (max-width: 400px) {
  .logo-text { font-size: 17px; }
  .search-title { font-size: 18px; }
  .pc-pill { padding: 7px 16px; font-size: 13px; }
  .btn-download { min-width: 80px; padding: 8px 12px; font-size: 12px; }
}

/* ══════════════════════════════════════════════════════
   MOBILE CRITICAL FIXES — Steps & FAQ
   ══════════════════════════════════════════════════════ */

/* Force steps to show as cards on mobile */
@media (max-width: 700px) {
  .pc-steps-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .pc-step-box {
    display: block !important;
    background: #fff;
    border-radius: 12px;
    padding: 20px 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    border: 1px solid #f0f0f0;
    text-align: center;
  }

  .pc-step-num {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 14px !important;
    font-weight: 700 !important;
    font-size: 18px !important;
  }

  .pc-step-box h3 {
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    color: #222 !important;
  }

  .pc-step-box p {
    font-size: 13px !important;
    color: #666 !important;
    line-height: 1.6 !important;
  }

  /* Force FAQ to show styled details/summary */
  .pc-faq-box {
    margin: 0 !important;
  }

  .pc-faq-item {
    display: block !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    margin-bottom: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
  }

  .pc-faq-item summary {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 16px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #222 !important;
    cursor: pointer !important;
    list-style: none !important;
    -webkit-appearance: none !important;
  }

  .pc-faq-item summary::-webkit-details-marker {
    display: none !important;
  }

  .pc-faq-item summary::after {
    content: '+' !important;
    font-size: 20px !important;
    color: #5e4cd8 !important;
    font-weight: 400 !important;
    flex-shrink: 0 !important;
    margin-left: 10px !important;
    transform: none !important;
  }

  .pc-faq-item[open] summary::after {
    content: '−' !important;
    transform: none !important;
  }

  .pc-faq-content {
    padding: 12px 16px 16px !important;
    color: #555 !important;
    font-size: 13px !important;
    line-height: 1.7 !important;
    border-top: 1px solid #f0f0f0 !important;
  }

  /* Feature cards — ensure text visible */
  .pc-card {
    padding: 20px 14px !important;
    border-radius: 10px !important;
  }

  .pc-card h3 {
    font-size: 15px !important;
    color: #111 !important;
    margin-bottom: 8px !important;
  }

  .pc-card p {
    font-size: 13px !important;
    color: #555 !important;
  }

  /* Section spacing */
  .pc-section {
    margin: 30px 0 !important;
  }
}

/* ── Download Progress Bar ── */
.dl-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 7px;
}
.dl-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(0,0,0,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.dl-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(34,197,94,0.5);
}
.dl-progress-pct {
  font-size: 11px;
  font-weight: 600;
  color: #16a34a;
  white-space: nowrap;
  min-width: 30px;
  text-align: right;
}
.btn-download.loading {
  opacity: 0.75;
  cursor: wait;
}
.format-row {
  flex-wrap: wrap;
}


/* ════════════════════════════════════════════════
   Language Switcher
   ════════════════════════════════════════════════ */
.lang-switcher {
  position: relative;
  margin-left: 1rem;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: inherit;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
  white-space: nowrap;
}

.lang-btn:hover {
  background: rgba(255,255,255,0.22);
}

.lang-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.lang-code {
  letter-spacing: 0.05em;
}

.lang-btn .fa-chevron-down {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.lang-switcher.open .fa-chevron-down {
  transform: rotate(180deg);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.14);
  width: 310px;
  z-index: 999;
  padding: 6px;
}

html[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

.lang-switcher.open .lang-dropdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  color: #334155;
  text-decoration: none;
  font-size: 0.83rem;
  transition: background 0.15s;
  border-radius: 8px;
  overflow: hidden;
}

.lang-flag-img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

.lang-code-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.lang-native-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-option:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.lang-option.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.lang-option.active .lang-code-badge {
  color: #93c5fd;
}
