/* ==========================================================================
   burc.lol — Mobile Web App & Responsive Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Root Variables & Safe Area Insets
   -------------------------------------------------------------------------- */
:root {
  --mobile-bottom-bar-height: 60px;
  --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mobile-safe-top: env(safe-area-inset-top, 0px);
  --mobile-drawer-width: 330px;
  --mobile-touch-target: 48px;
}

@media (max-width: 991.98px) {
  /* Alt navigasyon çubuğu için body alt boşluğu */
  body {
    padding-bottom: calc(var(--mobile-bottom-bar-height) + var(--mobile-safe-bottom) + 16px) !important;
  }

  /* İstemsiz yatay kaymayı kesin olarak engelle */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative;
  }
}

/* --------------------------------------------------------------------------
   2. Modern Mobile Top Header & Action Buttons
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  /* Eski Bootstrap navbar-collapse'ı mobilde tamamen devre dışı bırak */
  #navbar #navbarCollapse {
    display: none !important;
  }

  /* Eski header toggler gizle */
  #navbar .header-toggler {
    display: none !important;
  }

  /* Üst bar mobilde tam esnek ve temiz yerleşim */
  #navbar.navbar {
    padding: 0.65rem 1rem !important;
  }

  .header-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  /* Sağ taraftaki mobil eylemler (Tema Butonu + Modern Menü Butonu) */
  .mobile-header-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
  }

  .mobile-theme-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
  }

  /* Modern Mobil Menü (Hamburger) Butonu */
  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
    background: rgba(124, 58, 237, 0.08) !important;
    border: 1px solid rgba(124, 58, 237, 0.18) !important;
    color: var(--brand-primary, #7c3aed) !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-btn:hover,
  .mobile-menu-btn:active {
    background: rgba(124, 58, 237, 0.16) !important;
    transform: scale(0.96);
  }

  [data-bs-theme="dark"] .mobile-menu-btn {
    background: rgba(167, 139, 250, 0.12) !important;
    border-color: rgba(167, 139, 250, 0.25) !important;
    color: #c4b5fd !important;
  }

  /* 3 Çizgili Modern İkon */
  .mobile-menu-btn__icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 14px;
  }

  .mobile-menu-btn__icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: currentColor;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .mobile-menu-btn__icon span:nth-child(2) {
    width: 70%;
    margin-left: auto;
  }

  .mobile-menu-btn.is-active .mobile-menu-btn__icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .mobile-menu-btn.is-active .mobile-menu-btn__icon span:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-btn.is-active .mobile-menu-btn__icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

@media (min-width: 992px) {
  .mobile-header-actions,
  .mobile-menu-btn,
  #mobileDrawerOverlay,
  #mobileDrawer,
  #mobileBottomBar {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   3. Modern Slide-In Mobile Drawer (Yan Çekmece Menü)
   -------------------------------------------------------------------------- */
#mobileDrawerOverlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

#mobileDrawerOverlay.is-open {
  opacity: 1;
  visibility: visible;
}

#mobileDrawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 360px);
  height: 100%;
  background: #ffffff;
  z-index: 1051;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  padding-top: var(--mobile-safe-top);
  padding-bottom: var(--mobile-safe-bottom);
}

[data-bs-theme="dark"] #mobileDrawer {
  background: #141824;
  border-left: 1px solid rgba(124, 58, 237, 0.2);
  box-shadow: -8px 0 36px rgba(0, 0, 0, 0.6);
}

#mobileDrawer.is-open {
  transform: translateX(0);
}

/* Çekmece Başlığı */
.mobile-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(124, 58, 237, 0.08);
  flex-shrink: 0;
}

[data-bs-theme="dark"] .mobile-drawer__header {
  border-bottom-color: rgba(124, 58, 237, 0.15);
}

.mobile-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.08);
  border: none;
  color: var(--brand-primary, #7c3aed);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-drawer__close:active {
  transform: scale(0.92);
}

[data-bs-theme="dark"] .mobile-drawer__close {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
}

/* Çekmece İçerik Alanı */
.mobile-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.25rem 2rem;
}

/* Çekmece İçi Hızlı Arama */
.mobile-drawer__search {
  position: relative;
  margin-bottom: 1.25rem;
}

.mobile-drawer__search-input {
  width: 100%;
  height: 44px;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid rgba(124, 58, 237, 0.18);
  background: rgba(124, 58, 237, 0.04);
  color: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-drawer__search-input:focus {
  border-color: var(--brand-primary, #7c3aed);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

[data-bs-theme="dark"] .mobile-drawer__search-input {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(167, 139, 250, 0.2);
}

[data-bs-theme="dark"] .mobile-drawer__search-input:focus {
  background: #1a2030;
  border-color: #a78bfa;
}

.mobile-drawer__search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8a99ad;
  pointer-events: none;
  font-size: 1.15rem;
}

/* Çekmece Hızlı Çipler */
.mobile-drawer__quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.mobile-drawer__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.07);
  color: var(--brand-primary, #7c3aed);
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(124, 58, 237, 0.12);
}

.mobile-drawer__chip:active {
  transform: scale(0.95);
  background: var(--brand-primary, #7c3aed);
  color: #ffffff;
}

[data-bs-theme="dark"] .mobile-drawer__chip {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}

/* Bölüm Başlıkları */
.mobile-drawer__section-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a99ad;
  margin: 1.25rem 0 0.6rem;
}

/* Kategori & Menü Liste Öğeleri */
.mobile-drawer__nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  color: #2b354f;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  min-height: 44px;
}

.mobile-drawer__link:hover,
.mobile-drawer__link:active {
  background: rgba(124, 58, 237, 0.08);
  color: var(--brand-primary, #7c3aed);
}

[data-bs-theme="dark"] .mobile-drawer__link {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .mobile-drawer__link:hover,
[data-bs-theme="dark"] .mobile-drawer__link:active {
  background: rgba(167, 139, 250, 0.12);
  color: #c4b5fd;
}

.mobile-drawer__link-left {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.mobile-drawer__link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--brand-primary, #7c3aed);
  font-size: 1.15rem;
  flex-shrink: 0;
}

[data-bs-theme="dark"] .mobile-drawer__link-icon {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
}

.mobile-drawer__badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--brand-primary, #7c3aed);
  font-weight: 700;
}

[data-bs-theme="dark"] .mobile-drawer__badge {
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}

/* Çekmece Alt Bölümü */
.mobile-drawer__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(124, 58, 237, 0.08);
  background: rgba(124, 58, 237, 0.02);
  flex-shrink: 0;
}

[data-bs-theme="dark"] .mobile-drawer__footer {
  border-top-color: rgba(124, 58, 237, 0.15);
  background: rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   4. Sticky Bottom Navigation Bar (Mobil Alt Tab Bar)
   -------------------------------------------------------------------------- */
#mobileBottomBar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--mobile-bottom-bar-height) + var(--mobile-safe-bottom));
  padding-bottom: var(--mobile-safe-bottom);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(124, 58, 237, 0.12);
  z-index: 1040;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-around;
  user-select: none;
}

[data-bs-theme="dark"] #mobileBottomBar {
  background: rgba(18, 22, 34, 0.94);
  border-top: 1px solid rgba(124, 58, 237, 0.2);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
}

.mobile-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: #64748b;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 0;
  transition: all 0.2s ease;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-tab-item:active {
  transform: scale(0.92);
}

.mobile-tab-item__icon {
  font-size: 1.4rem;
  line-height: 1.2;
  margin-bottom: 2px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-tab-item.is-active {
  color: var(--brand-primary, #7c3aed) !important;
  font-weight: 700;
}

[data-bs-theme="dark"] .mobile-tab-item.is-active {
  color: #c4b5fd !important;
}

.mobile-tab-item.is-active .mobile-tab-item__icon {
  transform: translateY(-2px);
  color: var(--brand-primary, #7c3aed);
}

[data-bs-theme="dark"] .mobile-tab-item.is-active .mobile-tab-item__icon {
  color: #c4b5fd;
}

.mobile-tab-item.is-active::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--cosmic-gradient);
}

/* --------------------------------------------------------------------------
   5. 12 Zodiac Touch Carousel (Yatay Akıcı Kaydırma Şeridi)
   -------------------------------------------------------------------------- */
.zodiac-strip-wrap {
  position: relative;
  margin: 1.5rem 0 2rem;
  padding: 0 4px;
}

.zodiac-strip-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 10px;
  width: 36px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.85) 100%);
  pointer-events: none;
  border-radius: 0 16px 16px 0;
}

[data-bs-theme="dark"] .zodiac-strip-wrap::after {
  background: linear-gradient(90deg, transparent 0%, rgba(15, 17, 24, 0.85) 100%);
}

.zodiac-strip {
  display: flex !important;
  gap: 0.6rem !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 6px 4px 10px;
}

.zodiac-strip::-webkit-scrollbar {
  display: none !important;
}

.zodiac-chip {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 76px !important;
  padding: 0.65rem 0.5rem !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  border: 1px solid rgba(124, 58, 237, 0.12) !important;
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.05) !important;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
}

.zodiac-chip:active {
  transform: scale(0.94) !important;
}

[data-bs-theme="dark"] .zodiac-chip {
  background: #191e2b !important;
  border-color: rgba(167, 139, 250, 0.18) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.zodiac-chip__glyph {
  font-size: 1.6rem !important;
  line-height: 1 !important;
  margin-bottom: 4px !important;
}

.zodiac-chip__name {
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  color: #1e293b !important;
}

[data-bs-theme="dark"] .zodiac-chip__name {
  color: #e2e8f0 !important;
}

/* --------------------------------------------------------------------------
   6. Touch-Friendly Calculation Forms (17 Astroloji Aracı)
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  /* iOS Safari Auto-Zoom Önleme: font-size en az 16px olmalıdır */
  .calc-form input[type="text"],
  .calc-form input[type="search"],
  .calc-form input[type="number"],
  .calc-form input[type="date"],
  .calc-form select,
  .calc-form .form-select,
  .calc-form .form-control {
    font-size: 16px !important;
    min-height: 48px !important;
    border-radius: 12px !important;
  }

  /* Tarih seçicisi (Gün / Ay / Yıl) mobilde esnek hizalama */
  .isg-date {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    width: 100% !important;
  }

  .isg-date__sel {
    flex: 1 1 30% !important;
    min-width: 0 !important;
    padding-left: 0.5rem !important;
    padding-right: 1.5rem !important;
  }

  .isg-date__sel--month {
    flex: 1 1 42% !important;
  }

  .isg-date__sep {
    font-weight: bold;
    color: #94a3b8;
    flex-shrink: 0;
  }

  /* Hesapla ve Sıfırla butonları mobilde tam genişlik */
  .calc-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    width: 100% !important;
    margin-top: 1.25rem !important;
  }

  .calc-actions .btn-calc {
    width: 100% !important;
    min-height: 50px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .calc-actions .btn-reset {
    width: 100% !important;
    min-height: 42px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Sonuç Kartları Mobilde Ferah */
  .calc-card {
    padding: 1.25rem !important;
    border-radius: 18px !important;
  }

  .calc-result {
    padding: 1.25rem !important;
    border-radius: 16px !important;
  }

  /* Tablolar mobilde taşmasın, yatay kaydırılabilsin */
  .table-responsive,
  .calc-result table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --------------------------------------------------------------------------
   7. Homepage & Blog Mobile Responsive Refinements
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .home-hero {
    padding: 5.5rem 0 2rem !important;
  }

  .home-hero__title {
    font-size: 1.75rem !important;
    line-height: 1.25 !important;
  }

  .home-hero__lead {
    font-size: 0.95rem !important;
    margin-bottom: 1.5rem !important;
  }

  .home-hero__search-box {
    display: flex !important;
    align-items: center !important;
    border-radius: 999px !important;
    padding: 4px 6px !important;
    gap: 0.35rem !important;
    background: #ffffff !important;
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.1) !important;
  }

  [data-bs-theme="dark"] .home-hero__search-box {
    background: #181d2a !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
  }

  .home-hero__search-input {
    font-size: 15px !important;
    height: 42px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
    padding-left: 2.2rem !important;
  }

  .home-hero__search-btn {
    height: 40px !important;
    border-radius: 999px !important;
    padding: 0 1.25rem !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .home-hero__stats {
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
  }

  .home-cat {
    padding: 0.9rem !important;
  }

  .home-cat__icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 20px !important;
  }

  /* SmartMag Blog Mobilde Boyut Ayarları */
  .smartmag-hero-card--lg {
    min-height: 280px !important;
  }

  .smartmag-hero-card--sm {
    min-height: 180px !important;
  }
}
