/* ==========================================================================
   Ather Mobile Navigation Drawer & Menu Button Styles
   Provides clean, clutter-free mobile navigation on screens <= 992px
   ========================================================================== */

/* Mobile Menu Toggle Button in Header */
.mobile-menu-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md, 10px);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.mobile-menu-toggle-btn:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  transform: translateY(-1px);
}

.mobile-menu-toggle-btn svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   Responsive Breakpoints: Hide desktop crowded buttons on Mobile/Tablet
   ========================================================================== */
@media (max-width: 992px) {
  /* Show Mobile Menu Toggle Button */
  .mobile-menu-toggle-btn {
    display: inline-flex !important;
  }

  /* Hide individual crowded action buttons on mobile */
  .desktop-action-btn {
    display: none !important;
  }

  /* Keep theme toggle accessible alongside mobile menu button */
  .site-header .header-actions {
    gap: 8px !important;
  }

  /* Prevent brand logo from getting cramped */
  .site-header .brand-wrapper {
    flex-shrink: 0 !important;
    min-width: max-content !important;
  }

  /* Fix for previous .btn width:33px collision */
  .site-header .header-actions .btn-icon,
  .site-header .header-actions .mobile-menu-toggle-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
  }
}

/* ==========================================================================
   Mobile Navigation Drawer (Slide-in Panel & Backdrop)
   ========================================================================== */
/* Prevent background scrolling when mobile drawer is open */
html.mobile-drawer-open,
body.mobile-drawer-open {
  overflow: hidden !important;
  height: 100% !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
}

.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  touch-action: none;
  overscroll-behavior: none;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 330px;
  max-width: 88vw;
  height: 100%;
  background: var(--bg-card, #0e1726);
  border-left: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: none;
  visibility: hidden;
  pointer-events: none;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease, box-shadow 0.28s ease;
  overflow-y: hidden;
  overscroll-behavior: contain;
  touch-action: auto;
}

.mobile-nav-drawer.active {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.7), 0 0 25px rgba(16, 185, 129, 0.08);
}


/* Drawer Header */
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.4);
  flex-shrink: 0;
}

.mobile-drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-drawer-brand .brand-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
}

.mobile-drawer-brand .brand-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.drawer-brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.drawer-brand-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted, #94a3b8);
}

.mobile-drawer-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-drawer-close-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
  transform: rotate(90deg);
}

/* Drawer Scrollable Content */
.mobile-drawer-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 16px 18px calc(80px + env(safe-area-inset-bottom, 20px));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Live Prayer Status Card inside Drawer */
.mobile-drawer-prayer-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(6, 78, 59, 0.22) 100%), var(--bg-subtle, #142034);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.mobile-drawer-prayer-card:hover {
  border-color: #10b981;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.2);
}

.drawer-prayer-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.drawer-prayer-title-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
}

.drawer-prayer-title-text svg {
  color: #10b981;
}

.drawer-prayer-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.drawer-prayer-time-val {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}

.drawer-prayer-timer {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 1.05rem;
  font-weight: 800;
  color: #10b981;
}

.drawer-prayer-action-hint {
  font-size: 0.72rem;
  color: #10b981;
  font-weight: 600;
  text-align: right;
}

/* Drawer Section */
.mobile-drawer-group-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 8px;
  padding-left: 4px;
}

/* Nav Items List */
.mobile-drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #f8fafc);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.mobile-drawer-link:hover,
.mobile-drawer-link.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
  transform: translateX(3px);
}

.mobile-drawer-link-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #cbd5e1);
  flex-shrink: 0;
}

.mobile-drawer-link:hover .mobile-drawer-link-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.mobile-drawer-link-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.mobile-drawer-link-text strong {
  font-size: 0.92rem;
  font-weight: 700;
}

.mobile-drawer-link-text small {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
}

.mobile-drawer-pill,
.mobile-drawer-link .quran-badge-emerald,
.mobile-drawer-link .live-badge-red,
.mobile-drawer-link .prayer-badge-emerald {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mobile-drawer-pill {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #94a3b8);
}

/* Tools & Controls Grid */
.mobile-drawer-tools-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-tool-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #f8fafc);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.mobile-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(3px);
}

.mobile-tool-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #94a3b8);
  flex-shrink: 0;
}

.mobile-tool-btn-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.mobile-tool-btn-name {
  font-size: 0.88rem;
  font-weight: 700;
}

.mobile-tool-btn-desc {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
}

/* Account & Footer */
.mobile-drawer-account {
  padding-top: 8px;
  margin-top: auto;
}

.mobile-drawer-auth-btn {
  width: 100%;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.92rem;
  border-radius: 12px;
}

/* Authenticated Mobile User Card */
.mobile-drawer-user-card {
  background: var(--bg-tertiary, #151d2f);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[data-theme="light"] .mobile-drawer-user-card {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.08);
}

.mobile-drawer-profile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 4px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.mobile-drawer-profile-link:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mobile-drawer-avatar-img,
.mobile-drawer-avatar-initial {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mobile-drawer-avatar-img {
  object-fit: cover;
  border: 2px solid var(--accent-primary, #10b981);
}

.mobile-drawer-avatar-initial {
  background: linear-gradient(135deg, var(--accent-primary, #10b981) 0%, #047857 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.mobile-drawer-user-meta {
  flex: 1;
  min-width: 0;
}

.mobile-drawer-user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary, #f8fafc);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="light"] .mobile-drawer-user-name {
  color: #0f172a;
}

.mobile-drawer-user-handle {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
}

.mobile-drawer-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  padding-top: 8px;
}

.mobile-drawer-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, #f8fafc);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

[data-theme="light"] .mobile-drawer-action-chip {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  color: #1e293b;
}

.mobile-drawer-action-chip:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.mobile-drawer-action-chip.admin-chip {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
}

.mobile-drawer-action-chip.logout-chip {
  margin-left: auto;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.mobile-drawer-action-chip.logout-chip:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}
