/* ============================================
   MOBILE NAVIGATION (≤768px)
   Top bar (ej sticky) + Bottom nav (fixed)
   Döljer headern och footern.
   ============================================ */

@media (max-width: 768px) {

  /* ======================================
     1. HIDE HEADER + FOOTER
     ====================================== */

  /* Visually hide header but keep DOM alive for notification dropdown */
  header.sticky-top {
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    position: relative !important;
  }

  /* Notification dropdown: show as fixed overlay on mobile */
  #notification-dropdown:not(.d-none) {
    visibility: visible !important;
    position: fixed !important;
    top: 56px !important;
    left: 8px !important;
    right: 8px !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    z-index: 1100 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18) !important;
  }

  .site-footer {
    display: none !important;
  }

  main#app {
    padding-top: 0 !important;
    padding-bottom: 56px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* ======================================
     2. MOBILE TOP BAR (non-sticky)
     ====================================== */

  .mobile-top-bar:not(.d-none) {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 16px !important;
    background: white !important;
    border-bottom: 1px solid #E2E8F0 !important;
  }

  .mobile-top-bar.d-none {
    display: none !important;
  }

  .mobile-top-logo {
    display: flex !important;
    align-items: center !important;
  }

  .mobile-top-logo img {
    height: 48px !important;
  }

  /* ======================================
     2b. CLUB BUTTON (centered, green)
     ====================================== */

  .mobile-top-club-btn {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #00D9A3 !important;
    color: white !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: opacity 0.15s !important;
  }

  .mobile-top-club-btn:active {
    opacity: 0.8 !important;
  }

  .mobile-top-club-btn i {
    font-size: 16px !important;
  }

  .mobile-top-actions {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .mobile-top-btn {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: none !important;
    border: none !important;
    color: #64748B !important;
    font-size: 20px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: background 0.15s !important;
  }

  .mobile-top-btn:active {
    background: #F1F5F9 !important;
  }

  /* ======================================
     3. TOP BAR BADGES
     ====================================== */

  .mobile-top-badge {
    position: absolute !important;
    top: 4px !important;
    right: 2px !important;
    min-width: 16px !important;
    height: 16px !important;
    background: #EF4444 !important;
    color: white !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 4px !important;
    line-height: 1 !important;
    border: 2px solid white !important;
  }

  .mobile-top-badge.d-none {
    display: none !important;
  }

  /* ======================================
     4. TOP BAR AVATAR
     ====================================== */

  .mobile-top-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: #94A3B8 !important;
    color: white !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    line-height: 1 !important;
  }

  .mobile-top-avatar i {
    font-size: 16px !important;
  }

  .mobile-top-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
  }

  /* ======================================
     5. BOTTOM NAVIGATION BAR
     ====================================== */

  .mobile-bottom-nav:not(.d-none) {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border-top: 1px solid #E2E8F0 !important;
    display: flex !important;
    padding: 8px 0 !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
    z-index: 1050 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
  }

  /* ======================================
     6. NAV ITEMS
     ====================================== */

  .mobile-nav-item {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: #94A3B8 !important;
    cursor: pointer !important;
    transition: color 0.2s !important;
    padding: 6px 0 !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mobile-nav-item i {
    font-size: 24px !important;
    line-height: 1 !important;
  }

  .mobile-nav-item.active {
    color: #00D9A3 !important;
  }

  .mobile-nav-item:active {
    transform: scale(0.92) !important;
  }

  .mobile-nav-icon-wrap {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
    line-height: 1 !important;
  }

  /* ======================================
     7. PROFILE PANEL OVERLAY
     ====================================== */

  .mobile-profile-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0) !important;
    z-index: 1060 !important;
    transition: background 0.3s !important;
  }
  .mobile-profile-overlay.open {
    background: rgba(0, 0, 0, 0.4) !important;
  }
  .mobile-profile-overlay.d-none {
    display: none !important;
  }

  /* ======================================
     8. PROFILE PANEL (slide up)
     ====================================== */

  .mobile-profile-panel {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border-radius: 20px 20px 0 0 !important;
    z-index: 1070 !important;
    transform: translateY(100%) !important;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1) !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12) !important;
  }
  .mobile-profile-panel.open {
    transform: translateY(0) !important;
  }
  .mobile-profile-panel.d-none {
    display: none !important;
  }

  .mobile-profile-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 20px 12px !important;
    border-bottom: 1px solid #E2E8F0 !important;
  }

  .mobile-profile-name {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1E293B !important;
  }

  .mobile-profile-close {
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    color: #94A3B8 !important;
    padding: 4px !important;
    cursor: pointer !important;
    line-height: 1 !important;
  }

  /* ======================================
     9. PROFILE MENU ITEMS
     ====================================== */

  .mobile-profile-menu {
    padding: 8px 0 !important;
  }

  .mobile-profile-menu-item {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 14px 20px !important;
    color: #334155 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    background: none !important;
    border: none !important;
    width: 100% !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
  }

  .mobile-profile-menu-item:active {
    background: #F1F5F9 !important;
  }

  .mobile-profile-menu-item i {
    font-size: 20px !important;
    color: #64748B !important;
    width: 24px !important;
    text-align: center !important;
  }

  .mobile-profile-menu-item.mobile-profile-logout {
    color: #EF4444 !important;
  }
  .mobile-profile-menu-item.mobile-profile-logout i {
    color: #EF4444 !important;
  }

  .mobile-profile-divider {
    height: 1px !important;
    background: #E2E8F0 !important;
    margin: 4px 20px !important;
  }
}

/* ======================================
   DESKTOP: Hide mobile-only elements
   ====================================== */

@media (min-width: 769px) {
  .mobile-bottom-nav,
  .mobile-top-bar,
  .mobile-profile-panel,
  .mobile-profile-overlay {
    display: none !important;
  }
}
