/* ==========================================================================
   تطبيق هُدْهُد | Hudhud - ملف التجاوب الشامل للهواتف والشاشات اللوحية
   تصميم متقن 100%: تناسق تام، منع أي شريط تمرير أفقي، وضبط المحاذاة بدقة
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. أجهزة اللابتوب والشاشات المتوسطة (أقل من 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 36px;
  }

  .hero-badge-wrap {
    justify-content: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
  }

  .hero-actions {
    justify-content: center;
  }

  .store-badges {
    justify-content: center;
  }

  .five-minute-banner {
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
    text-align: right;
  }

  .hero-visual {
    margin: 0 auto 10px auto;
    max-width: 320px;
    width: 100%;
    position: relative;
  }

  .hero-mascot-img {
    max-width: 270px;
    margin: 0 auto;
  }

  .hero-mascot-glow {
    width: 280px;
    height: 280px;
  }

  .sources-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
    gap: 22px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
}

/* --------------------------------------------------------------------------
   2. الأجهزة اللوحية والهواتف الكبيرة (أقل من 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .section {
    padding: 65px 0;
  }

  /* الشريط العلوي */
  .navbar {
    height: 70px;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    right: 0;
    left: 0;
    background: rgba(4, 20, 17, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    padding: 24px 20px;
    gap: 12px;
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }

  [data-theme="light"] .nav-menu {
    background: rgba(246, 250, 248, 0.98);
    box-shadow: 0 16px 36px rgba(10, 35, 31, 0.12);
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 12px;
    font-size: 1.05rem;
    border-radius: var(--radius-sm);
  }

  /* نصوص الهيرو والعناوين */
  .hero-title {
    font-size: clamp(1.85rem, 5.5vw, 2.4rem);
    line-height: 1.32;
    margin-bottom: 18px;
  }

  .hero-desc {
    font-size: 1.02rem;
    line-height: 1.8;
    margin-bottom: 26px;
  }

  .section-title {
    font-size: clamp(1.6rem, 5vw, 2.1rem);
    line-height: 1.35;
  }

  .section-header {
    margin-bottom: 38px;
  }

  /* شخصية الهدهد والشارات المحيطة بها */
  .hero-visual {
    max-width: 290px;
    width: 100%;
    margin: 0 auto 12px auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .hero-mascot-img {
    max-width: 240px;
  }

  .hero-mascot-glow {
    width: 240px;
    height: 240px;
  }

  .floating-stat-badge {
    padding: 7px 12px;
    font-size: 0.78rem;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  }

  .badge-icon-img {
    width: 26px;
    height: 26px;
  }

  .floating-stat-badge.top-left {
    top: 5px;
    right: -10px;
  }

  .floating-stat-badge.bottom-right {
    bottom: 5px;
    left: -10px;
  }

  .floating-stat-badge.center-right {
    display: none;
  }

  /* المشغل الصوتي الحقيقي */
  .audio-verifier-card {
    padding: 26px 20px;
  }

  .verifier-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .verifier-header .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.88rem;
  }

  .audio-buttons-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* بطاقات القراء على الشاشات المتوسطة */
  .reciters-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
  }

  .reciter-card {
    padding: 20px 18px;
  }

  /* بطاقة التسجيل */
  .waitlist-card {
    padding: 36px 22px;
  }

  .waitlist-form {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .waitlist-input {
    width: 100%;
    min-width: 0;
  }

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

  /* الفوتر */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .footer-bottom > div:last-child {
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
  }

  /* الصفحات القانونية */
  .legal-section {
    padding-top: 100px !important;
    padding-bottom: 60px !important;
  }

  .legal-card {
    padding: 26px 20px !important;
  }
}

/* --------------------------------------------------------------------------
   3. شاشات الهواتف العادية (أقل من 600px)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .navbar {
    height: 66px;
  }

  .nav-menu {
    top: 66px;
  }

  .nav-brand-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .brand-title {
    font-size: 1.22rem;
  }

  .brand-tagline {
    display: none; /* إخفاء الشعار النصي الطويل لعدم التزاحم في الهيدر الصغير */
  }

  /* أزرار الهيرو */
  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }

  /* شارات المتاجر */
  .store-badges {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .store-btn {
    width: 100%;
    max-width: 340px;
    justify-content: center;
    padding: 12px 20px;
  }

  /* بنر الـ 5 دقائق */
  .five-minute-banner {
    flex-direction: column;
    text-align: center;
    padding: 18px 16px;
    gap: 10px;
  }

  .banner-icon {
    margin: 0 auto;
    font-size: 1.8rem;
  }

  .banner-text-title {
    font-size: 0.96rem !important;
  }

  .banner-text-desc {
    font-size: 0.85rem;
    line-height: 1.65;
  }

  /* شبكة مميزات المنهج */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .glass-card {
    padding: 24px 20px;
  }

  /* شبكة القراء: جعل الشارة فوق الاسم بدلاً من التداخل */
  .reciters-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .reciter-card {
    padding: 18px 16px;
  }

  .reciter-badge-top {
    position: static;
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: 10px;
  }

  /* أدوات البحث وتصفية التساؤلات */
  .faq-search-box {
    margin-bottom: 20px;
  }

  .faq-search-input {
    padding: 14px 44px 14px 16px;
    font-size: 0.92rem;
  }

  .faq-search-icon {
    right: 16px;
  }

  .faq-filter-tabs {
    gap: 8px;
    margin-bottom: 26px;
  }

  .filter-tab-btn {
    padding: 7px 14px;
    font-size: 0.82rem;
  }

  .faq-question {
    padding: 16px 16px;
    gap: 12px;
  }

  .faq-question-title {
    font-size: 0.98rem;
    line-height: 1.5;
  }

  .faq-answer {
    padding: 0 16px;
    font-size: 0.92rem;
    line-height: 1.8;
  }

  .faq-item.active .faq-answer {
    padding: 0 16px 18px 16px;
  }

  /* بطاقة استوديو Qynae في الفوتر */
  .qynae-brand-box {
    width: 100%;
    max-width: 320px;
    padding: 14px 16px;
    gap: 12px;
  }

  .qynae-logo-circle {
    width: 46px;
    height: 46px;
  }

  .qynae-name {
    font-size: 1.15rem;
  }

  .qynae-tagline {
    font-size: 0.72rem;
  }
}

/* --------------------------------------------------------------------------
   4. الهواتف الصغيرة جداً (أقل من 400px - مثل iPhone SE و Galaxy A)
   -------------------------------------------------------------------------- */
@media (max-width: 400px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-title {
    font-size: 1.68rem;
  }

  .hero-visual {
    max-width: 250px;
  }

  .hero-mascot-img {
    max-width: 210px;
  }

  .hero-mascot-glow {
    width: 210px;
    height: 210px;
  }

  .floating-stat-badge {
    padding: 5px 8px;
    font-size: 0.72rem;
    gap: 5px;
  }

  .badge-icon-img {
    width: 20px;
    height: 20px;
  }

  .floating-stat-badge.top-left {
    top: 0;
    right: -4px;
  }

  .floating-stat-badge.bottom-right {
    bottom: 0;
    left: -4px;
  }

  .store-btn {
    padding: 10px 14px;
  }

  .audio-verifier-card {
    padding: 20px 14px;
  }

  .sound-btn {
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  .hudhud-toast {
    font-size: 0.84rem;
    padding: 10px 18px;
    width: 90vw;
  }
}
