/* ════════════════════════════════════════════════════════════════════════
   mobile.css — podcast.ma App-First Redesign
   Mobile-first: base = 375px, desktop enhancements at 768px+
   Loads LAST after main.css & design-v2.css
   ════════════════════════════════════════════════════════════════════════ */

/* ── 0. App-level tokens ── */
:root {
  --app-header-h: 56px;
  --bottom-nav-h: 60px;
  --drawer-w: 288px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --transition-slide: 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(8, 8, 22, 0.94);
  --glass-border: rgba(255, 255, 255, 0.07);
}

/* ── 1. App Shell Reset ── */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  padding-top: var(--app-header-h);
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-b));
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}

/* Extra padding when audio player bar is visible */
body.player-open,
body.has-player {
  padding-bottom: calc(var(--bottom-nav-h) + 68px + var(--safe-b));
}

/* ── 2. App Header (compact, fixed) ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-header-h);
  z-index: 500;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

.navbar-v2 {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  gap: 8px;
}

/* Brand stays left */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  text-decoration: none;
}

.navbar-brand img,
.navbar-brand svg {
  width: 28px;
  height: 28px;
}

/* Push nav center + right to fill */
.navbar-v2 .navbar-center,
.navbar-v2 .navbar-right {
  display: none;
}

/* Mobile: show only search icon + hamburger on right */
.navbar-v2 .navbar-mobile-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-primary, #fff);
  transition: background 0.15s;
}

.nav-icon-btn:hover,
.nav-icon-btn:active {
  background: rgba(255,255,255,0.08);
}

.nav-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* ── 3. Bottom Navigation ── */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: calc(var(--bottom-nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  display: flex !important;
  align-items: flex-start;
  justify-content: space-around;
  z-index: 600 !important;
  padding-top: 4px;
}

.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 56px;
  padding: 6px 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.45);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s;
  font-size: 0;
  -webkit-appearance: none;
  flex: 1;
}

.bnav-item:hover,
.bnav-item.is-active,
.bnav-item[aria-current="page"] {
  color: var(--accent, #8B5CF6);
}

.bnav-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.bnav-item.is-active .bnav-icon,
.bnav-item[aria-current="page"] .bnav-icon {
  stroke-width: 2.5;
}

.bnav-item:active .bnav-icon {
  transform: scale(0.88);
}

.bnav-label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Active indicator dot */
.bnav-item.is-active .bnav-label::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent, #8B5CF6);
  margin: 3px auto 0;
}

/* ── 4. Side Drawer ── */
.app-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--drawer-w);
  max-width: 85vw;
  background: rgba(8, 8, 22, 0.98);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  border-right: 1px solid var(--glass-border);
  z-index: 600;
  transform: translateX(-100%);
  transition: transform var(--transition-slide);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.app-drawer.is-open {
  transform: translateX(0);
}

/* RTL: drawer from right */
[dir="rtl"] .app-drawer {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--glass-border);
  transform: translateX(100%);
}
[dir="rtl"] .app-drawer.is-open {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 590;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slide);
  backdrop-filter: blur(2px);
}

.drawer-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer header */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  padding-top: calc(16px + var(--safe-t));
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.drawer-brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.drawer-close:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* Drawer sections */
.drawer-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.drawer-section:last-child {
  border-bottom: none;
}

.drawer-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 4px 20px 8px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  text-decoration: none;
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
  border-radius: 0;
}

.drawer-link:hover,
.drawer-link:active {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.drawer-link svg {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  flex-shrink: 0;
  stroke-width: 1.8;
}

.drawer-link:hover svg,
.drawer-link:active svg {
  opacity: 1;
}

/* Lang switcher in drawer */
.drawer-lang {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
}

.drawer-lang-btn {
  flex: 1;
  padding: 9px 4px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.drawer-lang-btn.lang-btn--active,
.drawer-lang-btn:hover {
  background: rgba(139,92,246,0.2);
  border-color: var(--accent, #8B5CF6);
  color: #fff;
}

/* ── 5. Mobile Search Bar (fullscreen) ── */
.mobile-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(6, 6, 18, 0.97);
  padding: 16px;
  padding-top: calc(16px + var(--safe-t));
  display: none;
  flex-direction: column;
  gap: 12px;
}

.mobile-search-overlay.is-open {
  display: flex;
}

.mobile-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-search-input-wrap {
  flex: 1;
  position: relative;
}

.mobile-search-input-wrap input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-size: 16px; /* prevent iOS zoom */
  outline: none;
}

.mobile-search-input-wrap input:focus {
  border-color: var(--accent, #8B5CF6);
  background: rgba(255,255,255,0.1);
}

.mobile-search-input-wrap::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat center/contain;
}

.mobile-search-cancel {
  padding: 8px 4px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

/* ── 6. Main Content Offset ── */
.main-content {
  min-height: calc(100dvh - var(--app-header-h) - var(--bottom-nav-h));
  padding-bottom: 24px;
}

/* ── 7. Hero Section (mobile) ── */
.hero-v2 {
  min-height: calc(100dvh - var(--app-header-h) - var(--bottom-nav-h));
  padding: 24px 20px 40px !important;
  padding-top: 24px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.hero-eyebrow {
  margin-bottom: 16px;
}

.hero-h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-sub-v2 {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.65);
  margin-bottom: 28px;
  max-width: 480px;
}

/* Hero search input — mobile */
.hero-search-v2,
.hero-search-wrap {
  width: 100%;
  margin-bottom: 28px;
}

.hero-search-v2 input,
.hero-search-wrap input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  border-radius: 14px;
  font-size: 16px; /* prevent iOS zoom */
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  transition: border-color 0.2s, background 0.2s;
}

.hero-search-v2 input:focus,
.hero-search-wrap input:focus {
  outline: none;
  border-color: var(--accent, #8B5CF6);
  background: rgba(255,255,255,0.1);
}

/* Hero stats row — horizontal on mobile */
.hero-stats-v2 {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stat-n {
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--gradient, linear-gradient(135deg, #8B5CF6, #06B6D4));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-l {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── 8. Section Layout ── */
.section-v2,
.home-section {
  padding: 24px 0;
  overflow: hidden;
}

.section-header-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 16px;
}

.section-title-v2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-link {
  font-size: 0.8rem;
  color: var(--accent, #8B5CF6);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
}

/* ── 9. Horizontal Scroll Carousel ── */
.scroll-row,
.cards-row,
.podcasts-grid-v2,
.episodes-list-v2 {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 20px 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar,
.cards-row::-webkit-scrollbar,
.podcasts-grid-v2::-webkit-scrollbar,
.episodes-list-v2::-webkit-scrollbar {
  display: none;
}

/* ── 10. Podcast Cards (mobile) ── */
.podcast-card-v2 {
  display: flex;
  flex-direction: column;
  width: 152px;
  min-width: 152px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  border-radius: var(--radius, 12px);
  overflow: hidden;
  background: var(--bg-card, rgba(255,255,255,0.035));
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.15s, box-shadow 0.15s;
}

.podcast-card-v2:active {
  transform: scale(0.96);
}

.podcast-card-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
}

.podcast-card-info {
  padding: 10px 10px 12px;
}

.podcast-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.podcast-card-meta {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 11. Episode Cards (mobile) ── */
.episode-card-v2 {
  display: flex;
  width: 260px;
  min-width: 260px;
  scroll-snap-align: start;
  gap: 12px;
  background: var(--bg-card, rgba(255,255,255,0.035));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius, 12px);
  padding: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  transition: transform 0.15s;
  cursor: pointer;
}

.episode-card-v2:active {
  transform: scale(0.97);
}

.episode-card-thumb {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}

.episode-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.episode-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-card-pod {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-card-duration {
  font-size: 0.7rem;
  color: var(--accent-2, #06B6D4);
  font-weight: 500;
}

/* ── 12. Category Cards ── */
.category-card-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100px;
  min-width: 100px;
  height: 90px;
  scroll-snap-align: start;
  border-radius: var(--radius, 12px);
  background: var(--bg-card, rgba(255,255,255,0.035));
  border: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  color: rgba(255,255,255,0.75);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  gap: 8px;
  padding: 8px;
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
}

.category-card-v2:active {
  transform: scale(0.93);
  background: rgba(139,92,246,0.12);
}

.category-card-icon {
  font-size: 1.5rem;
  line-height: 1;
}

/* ── 13. Radio Cards ── */
.radio-card-v2 {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 220px;
  min-width: 220px;
  scroll-snap-align: start;
  background: var(--bg-card, rgba(255,255,255,0.035));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius, 12px);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.radio-card-v2:active {
  transform: scale(0.96);
  background: rgba(255,255,255,0.07);
}

.radio-card-logo {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
}

.radio-card-info {
  flex: 1;
  min-width: 0;
}

.radio-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radio-card-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  padding: 2px 7px;
  border-radius: 4px;
}

.radio-card-live::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: pulse-live 1.2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── 14. Player Bar (above bottom nav on mobile) ── */
.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-nav-h) + var(--safe-b));
  z-index: 470;
  background: rgba(13, 13, 32, 0.98);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.25s ease, bottom 0.25s ease;
}

/* Player compact on mobile */
.player-inner {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 2px;
}

.player-podcast {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.player-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.player-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.player-play-btn {
  width: 40px;
  height: 40px;
  background: var(--accent, #8B5CF6);
  color: #fff;
  border-radius: 50%;
}

.player-play-btn:hover {
  background: rgba(139,92,246,0.85);
}

/* Progress bar at top of player */
.player-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.08);
  cursor: pointer;
}

.player-progress-fill {
  height: 100%;
  background: var(--gradient, linear-gradient(90deg, #8B5CF6, #06B6D4));
  transition: width 0.5s linear;
}

/* ── 15. Footer (compact on mobile) ── */
.footer {
  margin-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.footer-v2-inner {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0;
  padding: 24px 20px;
}

.footer-v2-brand {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.footer-v2-brand p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  margin: 8px 0;
}

/* Footer columns: collapsible on mobile */
.footer-v2-col {
  overflow: hidden;
}

.footer-v2-col h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  margin: 0 0 8px;
  padding-top: 12px;
}

.footer-v2-col a,
.footer-v2-col li a {
  display: block;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 5px 0;
  transition: color 0.15s;
}

.footer-v2-col a:hover {
  color: #fff;
}

.footer-bottom {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.3);
}

/* ── 16. Auth Modal (full-screen on mobile) ── */
/* NOTE: display is controlled by JS — we only set layout/appearance */
.modal-overlay,
#auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  /* align-items / justify-content work when JS sets display: flex */
  align-items: flex-end;
  justify-content: center;
}

.modal-box,
#auth-modal {
  width: 100%;
  max-height: 90dvh;
  border-radius: 20px 20px 0 0;
  background: var(--bg-secondary, #0d0d20);
  border: 1px solid var(--glass-border);
  border-bottom: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 20px;
  animation: slide-up 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slide-up {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── 17. Search Page ── */
.search-page,
.search-wrap {
  padding: 20px;
}

.search-hero-input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  border-radius: 14px;
  font-size: 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  outline: none;
  margin-bottom: 20px;
}

.search-hero-input:focus {
  border-color: var(--accent, #8B5CF6);
}

/* ── 18. Podcast Detail Page ── */
.podcast-hero {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.podcast-hero-cover {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-lg, 20px);
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  align-self: center;
}

.podcast-hero-info {
  text-align: center;
}

.podcast-hero-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.2;
}

.podcast-hero-author {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  margin: 0 0 12px;
}

/* Episode list on podcast page */
.episode-list-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.12s;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.episode-list-item:active {
  background: rgba(255,255,255,0.04);
}

.episode-list-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}

.episode-list-body {
  flex: 1;
  min-width: 0;
}

.episode-list-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-list-meta {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  margin: 0;
}

/* ── 19. Submit Page ── */
.submit-page {
  padding: 24px 20px;
  max-width: 540px;
  margin: 0 auto;
}

.submit-page h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.submit-page .form-group {
  margin-bottom: 16px;
}

.submit-page label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  margin-bottom: 6px;
}

.submit-page input,
.submit-page select,
.submit-page textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.submit-page input:focus,
.submit-page select:focus,
.submit-page textarea:focus {
  border-color: var(--accent, #8B5CF6);
}

.submit-page textarea {
  min-height: 100px;
  resize: vertical;
}

/* ── 20. Radio Page ── */
.radio-page-hero {
  padding: 28px 20px 20px;
  text-align: center;
}

.radio-page-hero h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 6px;
}

.radio-page-hero p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 20px;
}

.radio-grid-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--bg-card, rgba(255,255,255,0.035));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius, 12px);
  padding: 16px 12px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  text-align: center;
}

.radio-grid-card:active {
  transform: scale(0.96);
}

.radio-grid-logo {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255,255,255,0.06);
}

.radio-grid-name {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

/* ── 21. Admin pages (keep functional, just pad) ── */
.admin-container {
  padding: 16px;
}

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius, 12px);
}

.admin-table {
  min-width: 600px;
}

/* ── Hide all legacy mobile nav elements ── */
.mobile-nav,
#mobile-nav,
.mobile-nav-overlay,
.mobile-nav-dropdown,
nav[aria-label="Navigation mobile"] {
  display: none !important;
}

/* ── 22. Navbar mobile: hide desktop nav elements ── */
.navbar-v2 .navbar-center {
  display: none;
}

/* Hide navbar-end items on mobile — only search icon stays visible */
.navbar-end .nav-submit-pill,
.navbar-end .user-menu,
.navbar-end #theme-toggle,
.navbar-end .lang-switcher {
  display: none !important;
}
/* Keep search toggle visible on mobile */
.navbar-end #search-toggle {
  display: flex !important;
}

/* Lang switcher: hide from header on mobile (it's in the drawer) */
.navbar-v2 .lang-switcher {
  display: none;
}

/* Mobile hamburger (keep visible for drawer toggle) */
.navbar-hamburger,
.hamburger-btn,
#hamburger-btn,
[id$=hamburger] {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide old mobile-nav dropdown (replaced by drawer) */
.mobile-nav,
#mobile-nav,
.mobile-nav-overlay {
  display: none !important;
}

/* ── 23. Touch + Scroll Polish ── */
/* Smooth scroll containers */
[class*="scroll"],
[class*="-row"],
[class*="-grid"] {
  -webkit-overflow-scrolling: touch;
}

/* Touch target minimum — apply only to standalone interactive elements */
.btn, .nav-icon-btn, .player-btn, .drawer-close, .mobile-search-cancel {
  min-height: 44px;
}

/* Remove default button padding that conflicts */
.bnav-item {
  min-height: unset;
  height: auto;
}

/* Prevent text selection on interactive elements */
.bottom-nav,
.app-drawer,
.player-bar {
  user-select: none;
  -webkit-user-select: none;
}

/* ── 24. Utility ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.truncate-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 25. RTL (Arabic) Support ── */
[dir="rtl"] .bnav-item {
  /* flip nothing — icons are symmetric */
}

[dir="rtl"] .drawer-link {
  flex-direction: row-reverse;
}

[dir="rtl"] .drawer-lang {
  direction: ltr; /* keep lang buttons in visual LTR order */
}

[dir="rtl"] .section-link {
  direction: ltr;
}

[dir="rtl"] .scroll-row,
[dir="rtl"] .cards-row,
[dir="rtl"] .podcasts-grid-v2,
[dir="rtl"] .episodes-list-v2 {
  direction: ltr; /* horizontal scroll always LTR */
}

[dir="rtl"] .hero-stats-v2 {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .podcast-hero-info {
  text-align: right;
}

/* ════════════════════════════════════════════════════════════════
   26. Desktop Enhancements (≥768px)
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {

  /* Taller header on desktop */
  :root {
    --app-header-h: 70px;
    --bottom-nav-h: 0px;
  }

  body {
    padding-bottom: 0;
  }

  body.has-player,
  body.player-open {
    padding-bottom: 90px;
  }

  /* Show desktop nav */
  .navbar-v2 .navbar-center {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    gap: 4px;
  }

  /* Show lang switcher in header on desktop */
  .navbar-v2 .lang-switcher {
    display: flex;
  }

  /* Restore navbar-end items on desktop */
  .navbar-end .nav-submit-pill,
  .navbar-end .user-menu,
  .navbar-end #theme-toggle {
    display: flex !important;
  }

  .navbar-v2 .navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  /* Hide hamburger on desktop */
  .navbar-hamburger,
  .hamburger-btn,
  #hamburger-btn,
  [id$=hamburger] {
    display: none;
  }

  /* Hide bottom nav on desktop */
  .bottom-nav {
    display: none !important;
  }

  /* Player: full width at bottom, no offset for bottom nav */
  .player-bar {
    bottom: 0;
  }

  /* Hero: proper centering */
  .hero-v2 {
    min-height: 80vh;
    padding: 60px 48px !important;
    align-items: flex-start;
  }

  .hero-h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
  }

  .hero-sub-v2 {
    font-size: 1.05rem;
    max-width: 560px;
  }

  .hero-search-v2,
  .hero-search-wrap {
    max-width: 520px;
  }

  /* Sections: proper padding */
  .section-header-v2 {
    padding: 0 48px;
  }

  .scroll-row,
  .cards-row,
  .podcasts-grid-v2,
  .episodes-list-v2 {
    padding: 4px 48px 16px;
  }

  /* Podcast cards: slightly larger */
  .podcast-card-v2 {
    width: 180px;
    min-width: 180px;
  }

  /* Episode cards: wider */
  .episode-card-v2 {
    width: 300px;
    min-width: 300px;
  }

  /* Podcast hero: horizontal layout */
  .podcast-hero {
    flex-direction: row;
    align-items: flex-start;
    padding: 40px 48px;
    gap: 32px;
  }

  .podcast-hero-cover {
    width: 200px;
    height: 200px;
    align-self: flex-start;
  }

  .podcast-hero-info {
    text-align: left;
  }

  [dir="rtl"] .podcast-hero-info {
    text-align: right;
  }

  /* Footer: multi-column */
  .footer-v2-inner {
    grid-template-columns: 2fr 1fr 1fr 1fr !important;
    gap: 32px;
    padding: 48px;
  }

  .footer-v2-brand {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }

  .footer-v2-col h4 {
    padding-top: 0;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    padding: 20px 48px;
  }

  /* Auth modal: centered dialog */
  .modal-overlay,
  #auth-modal-overlay {
    align-items: center;
  }

  .modal-box,
  #auth-modal {
    width: 420px;
    border-radius: 20px;
    max-height: 85vh;
  }

  /* Radio: 3-col grid */
  .radio-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 20px 48px;
  }

  /* Admin: full table visible */
  .admin-container {
    padding: 24px 48px;
  }

  /* Search: max-width centered */
  .search-page,
  .search-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 48px;
  }

  /* Submit: centered */
  .submit-page {
    padding: 40px 48px;
  }

  /* Mobile search overlay: not needed on desktop */
  .mobile-search-overlay {
    display: none !important;
  }

  /* Nav icon buttons: hide on desktop */
  .navbar-mobile-actions {
    display: none;
  }
}

/* ════════════════════════════════════════════════════════════════
   27. Wide Desktop (≥1024px)
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {

  .main-content {
    max-width: 1400px;
    margin: 0 auto;
  }

  .hero-v2 {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 80px;
  }

  .section-header-v2 {
    padding: 0 80px;
  }

  .scroll-row,
  .cards-row,
  .podcasts-grid-v2,
  .episodes-list-v2 {
    padding: 4px 80px 20px;
  }

  /* Allow multi-row grid at larger screens */
  .podcasts-grid-v2.is-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    overflow-x: visible;
    padding-bottom: 0;
  }

  .podcast-hero {
    padding: 60px 80px;
  }

  .radio-grid {
    grid-template-columns: repeat(4, 1fr);
    padding: 20px 80px;
  }

  .admin-container {
    padding: 32px 80px;
  }

  .search-page,
  .search-wrap {
    padding: 40px 80px;
  }

  .submit-page {
    padding: 48px 80px;
    max-width: 700px;
  }

  .footer-v2-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 80px;
  }

  .footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 80px;
  }
}

/* ═══════════ MOBILE-FIX-FINAL BLOCK ═══════════ */
/* Applied by mobile-fix-final.sh — overrides design-v2.css bugs */

/* ── 0. Header height: actual header is 70px not 56px ── */
:root {
  --app-header-h: 70px;
}
body {
  padding-top: var(--app-header-h);
}

/* ── 1. Main content top gap: design-v2 adds 100px — remove it ── */
.main-content {
  padding-top: 0 !important;
}

/* ── 2. Hero: design-v2 sets 108px padding-top ── */
.hero-v2 {
  padding-top: 24px !important;
}

/* ── 3. Hero stats: prevent wrapping ("13+" on 2nd line) ── */
.hero-stats-v2,
.hero-stats {
  flex-wrap: nowrap !important;
  gap: 14px !important;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.hero-stats-v2::-webkit-scrollbar,
.hero-stats::-webkit-scrollbar { display: none; }

/* ── 4. Navbar: hide desktop items on mobile (class is .navbar-end not .navbar-right) ── */
.navbar-end .nav-submit-pill,
.navbar-end .user-menu,
.navbar-end .lang-switcher,
.navbar-end #theme-toggle {
  display: none !important;
}
/* Keep search toggle */
.navbar-end #search-toggle,
.navbar-end .search-toggle,
.navbar-end .btn-icon[id="search-toggle"] {
  display: flex !important;
}

/* ── 5. Auth modal: remove forced display:flex (breaks JS show/hide) ── */
.modal-overlay,
#auth-modal {
  display: none;
}
.modal-overlay.is-open,
.modal-overlay[style*="display"],
#auth-modal.is-open {
  display: flex !important;
}

/* ── 6. Two-col section: collapse 980+300 grid to single column ── */
.two-col-section {
  display: block !important;
  grid-template-columns: unset !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden;
}

/* ── 7. Episode list: stretch to full width, hide overflow ── */
.episodes-list {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden;
}
.episode-list-item {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow: hidden;
  padding: 12px 16px !important;
}
.episode-list-info {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}
.episode-list-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}
.episode-list-podcast {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}

/* ── 8. Container-xl: full width, no overflow ── */
.container-xl {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden;
  box-sizing: border-box;
}

/* ── 9. Podcasts page: 2-column grid with side padding ── */
.podcasts-grid-full {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 10px !important;
  padding: 0 16px 24px !important;
  box-sizing: border-box;
}
.podcasts-grid-full .podcast-card-v2 {
  width: 100% !important;
  min-width: 0 !important;
}
/* Page hero (podcasts, categories, etc.) */
.page-hero {
  padding: 16px 16px 24px !important;
}
.page-hero-title {
  font-size: 1.6rem !important;
}
.page-info {
  padding: 0 16px !important;
}

/* ── 10. Radio page: 2-column station grid + fix hero ── */
.radio-hero {
  padding: 24px 16px 20px !important;
}
.radio-hero-title {
  font-size: 1.5rem !important;
}
.station-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 10px !important;
  padding: 0 16px 24px !important;
  box-sizing: border-box;
}
.station-card {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}
/* Station card inner layout: vertical stacking */
.station-card {
  flex-direction: column !important;
  align-items: center !important;
  padding: 14px 10px !important;
  gap: 8px !important;
  text-align: center;
}
.sc-logo {
  width: 60px !important;
  height: 60px !important;
  flex-shrink: 0;
}
.sc-info {
  width: 100%;
  min-width: 0;
}
.sc-name {
  font-size: 0.78rem !important;
  white-space: normal !important;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── 11. Recent podcasts section ── */
.recent-podcasts {
  padding: 0 16px !important;
  gap: 10px;
}
.recent-podcast-item {
  width: 100% !important;
  box-sizing: border-box;
}

/* ── 12. Section padding on mobile ── */
.section-v2,
.home-section {
  overflow: hidden;
}
.page-sections-v2 {
  padding-top: 16px !important;
}

/* ── 13. Footer: force single column ── */
.footer-v2-inner {
  display: grid !important;
  grid-template-columns: 1fr !important;
}

/* ─────────────────────────────────────── */
/* DESKTOP RESTORE (≥ 768px)              */
/* ─────────────────────────────────────── */
@media (min-width: 768px) {
  :root { --app-header-h: 70px; }

  .main-content { padding-top: 0 !important; }

  /* Restore navbar items */
  .navbar-end .nav-submit-pill,
  .navbar-end .user-menu,
  .navbar-end .lang-switcher,
  .navbar-end #theme-toggle {
    display: flex !important;
  }
  .navbar-end .user-menu { display: block !important; }
  .navbar-end .nav-submit-pill { display: flex !important; }

  /* Modal: let JS control */
  .modal-overlay,
  #auth-modal { display: none; }

  /* Two-col: restore desktop grid */
  .two-col-section {
    display: grid !important;
    grid-template-columns: 1fr 300px !important;
    width: 100% !important;
    gap: 24px;
  }

  /* Episodes list: restore */
  .episodes-list { width: auto !important; }
  .episode-list-item { padding: 14px 20px !important; }

  /* Podcasts grid: auto-fill */
  .podcasts-grid-full {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    padding: 0 0 24px !important;
  }

  /* Radio grid: auto-fill */
  .station-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    padding: 0 0 24px !important;
  }
  .station-card {
    flex-direction: row !important;
    align-items: center !important;
    text-align: left;
    padding: 16px !important;
  }

  /* Footer: 4-col */
  .footer-v2-inner {
    grid-template-columns: 2fr 1fr 1fr 1fr !important;
  }

  /* Hero desktop */
  .hero-v2 { padding-top: 60px !important; }
  .radio-hero { padding: 60px 48px 40px !important; }
  .page-hero { padding: 32px 0 24px !important; }
}
/* ═══════════ END MOBILE-FIX-FINAL BLOCK ═══════════ */
