/* 
 * Clean Mobile Header - Facebook-Style Simplicity
 * Music Library Uganda
 * Simple, spacious, not congested - everything accessible
 */

/* ===== MOBILE HEADER - CLEAN & SIMPLE ===== */
@media (max-width: 768px) {
  
  /* Body padding handled by .main-content padding-top */
  body {
    padding-top: 0px !important;
  }
  
  /* Simple, clean header bar */
  .header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 56px !important;
    background: #000 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    z-index: 9999 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
  }
  
  .header .container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 56px !important;
    padding: 0 12px !important;
    gap: 0 !important;
  }
  
  /* Logo - Left side, simple */
  .logo {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    height: 40px !important;
    padding: 0 !important;
  }
  
  .logo img {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
  }
  
  .logo span {
    display: none !important;
  }
  
  /* Hide the old navigation completely */
  nav,
  .nav-menu,
  .header-search,
  .search-wrapper,
  .mobile-menu-toggle {
    display: none !important;
  }
  
  /* Right side icons - Simple row */
  .header-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
    margin-left: auto !important;
  }
  
  /* Clean icon buttons (search etc.) */
  .search-trigger,
  .header-icon-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    color: #fff !important;
    font-size: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
  }

  .search-trigger:active,
  .header-icon-btn:active {
    background: rgba(255, 255, 255, 0.18) !important;
    transform: scale(0.95) !important;
  }

  /* ── PREMIUM HAMBURGER BUTTON ── */
  .header-menu-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 44px !important;
    height: 44px !important;
    padding: 10px 9px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    flex-shrink: 0 !important;
  }
  .header-menu-btn:active {
    background: rgba(255, 255, 255, 0.1) !important;
  }

  /* The three animated lines */
  .header-menu-btn .burger-line {
    display: block !important;
    height: 2px !important;
    background: #ffffff !important;
    border-radius: 2px !important;
    transition: width 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease !important;
    transform-origin: center !important;
  }
  /* Line lengths: long / short / medium — gives it personality */
  .header-menu-btn .burger-line:nth-child(1) { width: 22px !important; }
  .header-menu-btn .burger-line:nth-child(2) { width: 15px !important; }
  .header-menu-btn .burger-line:nth-child(3) { width: 19px !important; }

  /* Animate to ✕ when menu is open */
  body.menu-open .header-menu-btn .burger-line:nth-child(1) {
    width: 20px !important;
    transform: translateY(7px) rotate(45deg) !important;
  }
  body.menu-open .header-menu-btn .burger-line:nth-child(2) {
    opacity: 0 !important;
    transform: scaleX(0) !important;
  }
  body.menu-open .header-menu-btn .burger-line:nth-child(3) {
    width: 20px !important;
    transform: translateY(-7px) rotate(-45deg) !important;
  }
  
  /* User menu - simplified */
  .user-menu {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }
  
  .login-btn,
  .signup-btn {
    display: none !important;
  }
  
  /* User profile hidden on mobile header */
  .user-profile,
  .profile-dropdown {
    display: none !important;
  }
}

/* ===== BOTTOM NAVIGATION BAR ===== */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* Base nav bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    background: rgba(10, 10, 10, 0.97) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    z-index: 9998 !important;
    justify-content: space-around !important;
    align-items: stretch !important;
    padding: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    box-sizing: border-box !important;
  }

  /* Each nav item fills equal width */
  .mobile-bottom-nav a,
  .mobile-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 56px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    gap: 3px !important;
    transition: color 0.2s ease !important;
    padding: 6px 2px !important;
    box-sizing: border-box !important;
    /* Scale text with viewport — fits nicely on 320px–430px */
    font-size: clamp(8px, 2.4vw, 11px) !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    overflow: hidden !important;
  }

  /* Labels — prevent overflow on tiny screens */
  .mobile-bottom-nav a span,
  .mobile-nav-item span {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1 !important;
  }

  /* Icons — scale with viewport too */
  .mobile-bottom-nav a i,
  .mobile-nav-item i {
    font-size: clamp(18px, 5vw, 22px) !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
  }

  /* Tap state */
  .mobile-bottom-nav a:active,
  .mobile-nav-item:active {
    color: rgba(255, 255, 255, 0.9) !important;
    transform: scale(0.94) !important;
  }

  /* Active / current page — site gold */
  .mobile-bottom-nav a.active,
  .mobile-nav-item.active {
    color: #FCD116 !important;
  }
  .mobile-bottom-nav a.active i,
  .mobile-nav-item.active i {
    color: #FCD116 !important;
  }
  .mobile-bottom-nav a.active span,
  .mobile-nav-item.active span {
    color: #FCD116 !important;
  }

  /* Body padding so content isn't hidden behind nav */
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Floating player sits just above the nav */
  .floating-player {
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ── Extra-small phones (≤ 360px) ── */
  @media (max-width: 360px) {
    .mobile-bottom-nav a,
    .mobile-nav-item {
      font-size: 8px !important;
      gap: 2px !important;
      padding: 4px 1px !important;
    }
    .mobile-bottom-nav a i,
    .mobile-nav-item i {
      font-size: 17px !important;
    }
  }

  /* ── Large phones (≥ 414px) ── */
  @media (min-width: 414px) {
    .mobile-bottom-nav a,
    .mobile-nav-item {
      font-size: 11px !important;
      gap: 4px !important;
    }
    .mobile-bottom-nav a i,
    .mobile-nav-item i {
      font-size: 22px !important;
    }
  }
}

/* ===== SLIDE-OUT MENU (Hamburger Menu) ===== */
.mobile-slide-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  pointer-events: none;
}

.mobile-slide-menu.active {
  display: block;
  pointer-events: auto;
}

.mobile-menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-slide-menu.active .mobile-menu-overlay {
  opacity: 1;
}

.mobile-menu-panel {
  position: absolute !important;
  top: 0 !important;
  left: auto !important;
  right: 0 !important;
  width: 280px !important;
  height: 100% !important;
  background: #1c1c1e !important;
  transform: translateX(100%) !important;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important; /* Smoother easing */
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  box-shadow: -5px 0 25px rgba(0,0,0,0.5) !important;
}

.mobile-slide-menu.active .mobile-menu-panel {
  transform: translateX(0) !important;
}

/* Stagger Animation for Menu Items */
.mobile-menu-panel a {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease !important;
}

.mobile-slide-menu.active .mobile-menu-panel a {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.mobile-slide-menu.active .mobile-menu-panel a:nth-child(1) { transition-delay: 0.1s !important; }
.mobile-slide-menu.active .mobile-menu-panel a:nth-child(2) { transition-delay: 0.15s !important; }
.mobile-slide-menu.active .mobile-menu-panel a:nth-child(3) { transition-delay: 0.2s !important; }
.mobile-slide-menu.active .mobile-menu-panel a:nth-child(4) { transition-delay: 0.25s !important; }
.mobile-slide-menu.active .mobile-menu-panel a:nth-child(5) { transition-delay: 0.3s !important; }
.mobile-slide-menu.active .mobile-menu-panel a:nth-child(6) { transition-delay: 0.35s !important; }
.mobile-slide-menu.active .mobile-menu-panel a:nth-child(7) { transition-delay: 0.4s !important; }
.mobile-slide-menu.active .mobile-menu-panel a:nth-child(8) { transition-delay: 0.45s !important; }
.mobile-slide-menu.active .mobile-menu-panel a:nth-child(9) { transition-delay: 0.5s !important; }
.mobile-slide-menu.active .mobile-menu-panel a:nth-child(10) { transition-delay: 0.55s !important; }
.mobile-slide-menu.active .mobile-menu-panel a:nth-child(n+11) { transition-delay: 0.6s !important; }

/* Menu Header */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-header .menu-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}

.mobile-menu-header .menu-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.mobile-menu-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Menu User Section */
.mobile-menu-user {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.menu-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.menu-user-name {
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}

.menu-user-email {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.menu-auth-buttons {
  display: flex;
  gap: 8px;
}

.menu-auth-buttons a {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.menu-login-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.menu-signup-btn {
  background: #0071e3;
  color: #fff;
}

/* Menu Navigation Links */
.mobile-menu-nav {
  padding: 8px 0;
}

.mobile-menu-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.mobile-menu-nav a:active {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-nav a i {
  width: 24px;
  text-align: center;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
}

.mobile-menu-nav a.active {
  background: rgba(0, 113, 227, 0.15);
  color: #0071e3;
}

.mobile-menu-nav a.active i {
  color: #0071e3;
}

/* Menu Divider */
.menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 8px 16px;
}

/* Menu Section Title */
.menu-section-title {
  padding: 12px 16px 8px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Menu Footer */
.mobile-menu-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

.mobile-menu-footer a {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  text-decoration: none;
  padding: 8px 0;
}

/* ===== TABLET VIEW ===== */
@media (min-width: 769px) {
  .mobile-bottom-nav,
  .mobile-slide-menu,
  .mobile-menu-btn {
    display: none !important;
  }
}

/* ===== SAFE AREA FOR NOTCHED PHONES ===== */
@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 768px) {
    .header {
      padding-top: env(safe-area-inset-top) !important;
      height: calc(56px + env(safe-area-inset-top)) !important;
    }
    
    body {
      padding-top: calc(0px + env(safe-area-inset-top)) !important;
    }
    
    .mobile-bottom-nav {
      height: calc(56px + env(safe-area-inset-bottom)) !important;
      padding-bottom: env(safe-area-inset-bottom) !important;
    }
    
    body {
      padding-bottom: calc(60px + env(safe-area-inset-bottom)) !important;
    }
  }
}



