/* ============================================================
   all_events_mobile.css (V8 - Absolute Mobile Isolator)
   Complete reset and top-down reconstruction to solve the
   horizontal overflow and "cut-off" bug.
   ============================================================ */

/* ── 0. Initial State: Hide mobile components by default ── */
.mobile-header-box,
.mobile-drawer,
.drawer-overlay,
.sheet-overlay,
.mobile-filter-sheet {
  display: none;
}

@media (max-width: 768px) {

  /* ── 1. Absolute Base Reset ── */
  * {
    box-sizing: border-box !important;
    max-width: 100vw !important;
  }

  html,
  body {
    width: 100% !important; /* Changed from 100vw to fix horizontal scroll */
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    background-color: #F9FAFB;
    /* Match Dashboard base */
    /* soft gray wash */
    -webkit-text-size-adjust: 100%;
    position: relative;
    /* Viewport Guard: Removed contain: paint to fix fixed-position overlay clipping */
  }

  html {
    font-size: 70%;
  }

  /* Global 70% scale for premium feel */

  /* Force desktop containers to 100% block */
  .ventixe-layout,
  .ventixe-main,
  .main-content-box {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    gap: 0 !important;
  }

  /* Explicitly hide desktop-only sidebars and dropdowns */
  .ventixe-sidebar,
  .desktop-header,
  #categoryDropdown,
  #timeDropdown,
  #resultCountBadge,
  .result-badge,
  .layout-toggles {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* ── 2. Mobile Header (Logo-Left, Title-Center, Menu-Right) ── */
  .mobile-header-box {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #ffffff;
    position: sticky;
    top: 10px;
    /* Offset for floating look */
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    min-height: 56px;
    border-radius: 10px !important;
    /* Fixed 5px rounding */
    margin: 10px 16px 20px;
    /* All 4 corners visible */
    width: calc(100% - 32px);
    box-sizing: border-box;
  }

  .mobile-header-left,
  .mobile-header-right {
    flex: 0 0 45px;
    display: flex;
    align-items: center;
  }

  .mobile-header-right {
    justify-content: flex-end;
  }

  .mobile-logo-img {
    height: 32px;
    width: auto;
  }

  .mobile-page-title {
    font-size: 1.4rem;
    font-weight: 600;
    /* Blue Accent */
    color: #2563EB; 
    margin: 0;
    flex: 1;
    text-align: center;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  }

  .mobile-menu-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: #2563EB; /* Blue Accent */
    cursor: pointer;
    padding: 5px;
  }

  /* ── 3. Side Drawer Navigation (V12 Fix) ── */
  .mobile-drawer {
    display: block !important;
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    z-index: 2005;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    /* Header handles padding now */
    display: flex;
    flex-direction: column;
  }

  .mobile-drawer.open {
    transform: translateX(-300px);
  }

  .drawer-header {
    padding: 30px 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px solid #f1f0f7;
    margin-bottom: 20px;
  }

  .drawer-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
  }

  .drawer-close-btn {
    background: #f3f4f6;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    font-size: 1.2rem;
    cursor: pointer;
  }

  .drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
    flex: 1;
  }

  .drawer-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-radius: 12px;
    color: #1a0a2e;
    /* Branded Nav text */
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    transition: all 0.2s ease;
  }

  .drawer-nav-item i {
    width: 22px;
    text-align: center;
    color: #64748b;
    font-size: 1.2rem;
  }

  .drawer-nav-item.active {
    background: #DBEAFE;
    color: #2563EB;
  }

  .drawer-nav-item.active i {
    color: #2563EB;
  }

  .drawer-divider {
    height: 1.5px;
    background: #f1f0f7;
    margin: 15px 10px;
  }

  .drawer-nav-item.signout {
    margin-top: auto;
    margin-bottom: 40px;
    background: #fef2f2;
    color: #dc2626;
  }

  .drawer-nav-item.signout i {
    color: #dc2626;
  }

  .drawer-overlay {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.4);
    backdrop-filter: blur(4px);
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
  }

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

  /* ── 4. Main Toolbar & Side-to-Side Filter (V8) ── */
  .toolbar-actions {
    display: flex !important;
    align-items: stretch !important;
    /* Force matching heights and alignment */
    gap: 12px;
    padding: 0 16px;
    margin: 10px 0 24px;
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
  }

  .search-input-container {
    flex: 1;
    position: relative;
    order: 1;
  }

  .search-input {
    width: 100% !important;
    height: 48px !important;
    border-radius: 50px;
    border: none;
    background: #ffffff;
    padding: 0 44px 0 20px;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    outline: none;
    display: block;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  .search-icon {
    position: absolute;
    right: 18px;
    left: auto !important;
    color: #9ca3af;
    font-size: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
  }

  .mobile-filter-fab {
    width: 48px;
    height: 48px !important;
    min-width: 48px;
    background: #2563EB;
    border-radius: 12px;
    color: #ffffff;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    border: none;
    cursor: pointer;
    order: 2;
    margin: 0 !important;
    padding: 0;
    box-sizing: border-box !important;
  }

  /* ── 5. Modern List View Cards (V8 - Image-Left) ── */
  .event-container,
  #eventsGrid {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px;
    padding: 0 16px !important;
    margin-bottom: 40px;
    width: 100% !important;
  }

  .event-card {
    background: #ffffff !important;
    border-radius: 12px !important;
    /* Professional lower rounding */
    padding: 16px !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative;
  }

  /* New Row: [Media | Info ] */
  .card-row-top {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    width: 100%;
  }

  .card-media {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    position: relative;
    /* For absolutely positioned bookmark */
  }

  /* Bookmark / Save Button Styling */
  .save-button {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563EB;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }

  .save-button.active {
    background: #2563EB;
    color: #ffffff;
  }

  .save-button:active {
    transform: scale(0.9);
  }

  .save-button.loading i {
    animation: fa-spin 1s infinite linear;
  }

  .card-info {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    /* prevents text from pushing */
  }

  .event-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #2563EB;
    margin: 4px 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .meta-row {
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
  }

  .meta-row i {
    color: #2563EB;
    width: 14px;
    text-align: center;
  }

  /* ── Footer Row: [ Tickets | Price ] (V11) ── */
  .card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: none; /* Removed dashed line per request */
    width: 100%;
  }

  .card-tickets {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1.5px solid #f1f0f7;
    padding: 8px 12px;
    border-radius: 10px;
    min-width: 120px;
  }

  .card-tickets strong {
    font-size: 1.1rem;
    font-weight: 800;
    color: #2563EB; /* Blue accent */
    line-height: 1;
  }

  .card-tickets span {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
  }

  .ticket-icon {
    width: 34px;
    height: 34px;
    background: rgba(37, 99, 235, 0.08); /* Branded Blue Alpha */
    color: #2563EB; /* Blue Accent */
    border-radius: 8px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
  }

  .ticket-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .card-progress {
    flex: 1;
    margin: 0 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }

  .progress-top {
    display: flex;
    justify-content: center;
    margin: 0;
  }

  .progress-top strong {
    font-size: 0.95rem;
    font-weight: 800;
    color: #2563EB; /* Blue Accent */
  }

  .progress-bar {
    height: 6px;
    background: #f1f0f7;
    border-radius: 100px;
    overflow: hidden;
    width: 100%;
  }

  .progress-fill {
    background: #2563EB; /* Branded Blue */
    height: 100%;
  }

  .card-price {
    padding: 8px 14px;
    background: rgba(37, 99, 235, 0.08);
    color: #2563EB;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    min-width: 60px;
    text-align: center;
    box-sizing: border-box;
  }

  /* New V13 Long Width Button (Specifically for Orgs) */
  .card-action-btn {
    width: 100% !important;
    margin-top: 0px !important;
    /* Flush with content gap */
    padding: 12px !important;
    background: #2563EB !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 12px rgba(30, 27, 75, 0.15) !important;
    display: block !important;
    text-decoration: none !important;
  }

  /* ── Page Footer Refinement (V13) ── */
  .ventixe-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 15px 15px 30px !important; /* Shrunk padding */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-align: center !important;
    width: 100% !important;
  }

  .ventixe-footer .copyright {
    font-size: 0.7rem; /* Tiny mobile copyright */
    color: #94a3b8;
    order: 4;
    margin-top: 2px;
    width: 100%;
    text-align: center;
  }

  .ventixe-footer .footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    order: 2;
  }

  .ventixe-footer .footer-links a {
    font-size: 0.72rem; /* Tiny mobile links */
    color: #64748b;
    font-weight: 600;
    text-decoration: none;
  }

  .ventixe-footer .socials {
    display: flex;
    justify-content: center;
    gap: 16px;
    order: 1;
    margin-bottom: 10px;
  }

  .ventixe-footer .socials a {
    background: transparent;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563EB;
    font-size: 1.1rem; /* Smaller mobile icons */
    box-shadow: none;
    text-decoration: none;
    opacity: 0.8;
  }

  .pagination-container {
    width: 100%;
    margin-bottom: 5px;
  }

  .pagination-footer {
    flex-direction: column !important;
    gap: 12px;
    margin-top: 15px; /* Shrunk margin */
    padding: 10px 0;
    text-align: center;
  }

  .showing-text {
    font-size: 0.8rem; /* Smaller mobile showing text */
    justify-content: center;
    margin-bottom: 2px;
  }

  .pagination {
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .page-btn {
    width: 32px; /* Smaller mobile buttons */
    height: 32px;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #ffffff;
    border-color: #f1f0f7;
    margin: 2px;
  }

  .page-btn.active {
    background: #2563EB;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
  }

  /* ────────────────────────────────────────
     6. BOTTOM SHEET FILTER PANEL 
  ──────────────────────────────────────── */
  .mobile-filter-sheet {
    display: block !important;
    position: fixed !important; /* Force fixed positioning on top of viewport */
    bottom: 0 !important;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    box-shadow: 0 -12px 45px rgba(0, 0, 0, 0.18);
    z-index: 100000; /* Extremely high z-index */
    /* Above overlay */
    padding: 28px 24px 44px;
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    overflow-y: auto;
    max-height: 85vh;
  }

  .sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f0f7;
  }

  .sheet-reset-btn {
    background: transparent;
    border: none;
    color: #2563EB;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0;
    cursor: pointer;
  }

  .mobile-filter-sheet.open {
    transform: translateY(0);
    visibility: visible;
  }

  /* 7. TOAST NOTIFICATIONS (MOBILE) */
  .notification {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(-20px) !important;
    width: 90% !important;
    max-width: 400px !important;
    z-index: 100001 !important;
    padding: 16px 20px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    display: flex !important;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    transition: all 0.3s ease !important;
    opacity: 0;
    visibility: hidden;
  }

  .notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) !important;
  }

  .sheet-handle {
    width: 44px;
    height: 5px;
    background: #e2e8f0;
    border-radius: 10px;
    margin: -12px auto 24px;
  }

  .sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
  }

  .sheet-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2563EB;
    font-family: 'Outfit', sans-serif;
  }

  .sheet-close-btn {
    width: 38px;
    height: 38px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .sheet-section-label {
    font-size: 1rem;
    font-weight: 750;
    color: #2563EB;
    margin: 20px 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
  }

  .sheet-overlay {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    display: block !important;
    position: fixed !important; /* Force fixed positioning */
    inset: 0;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0.4s;
  }

  .sheet-overlay.open {
    visibility: visible;
    opacity: 1;
  }

  .sheet-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .sheet-option {
    padding: 10px 20px;
    border-radius: 50px;
    border: 1.5px solid #f1f0f7;
    background: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s ease;
  }

  .sheet-option.selected {
    background: #2563EB;
    color: #ffffff;
    border-color: #2563EB;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  }

  .sheet-apply-btn {
    width: 100%;
    margin-top: 32px;
    padding: 18px;
    background: #2563EB;
    color: #ffffff;
    border-radius: 14px;
    font-size: 1.2rem;
    font-weight: 800;
    border: none;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
    transition: transform 0.2s active;
  }

  /* --- NEW: Nearby & Explore Mobile Styles --- */
  .header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 2px;
    align-items: center;
  }

  .category-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    background: #2563EB;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
  }

  .distance-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: #2563EB;
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    border: 1px solid rgba(37, 99, 235, 0.2);
  }

  /* --- Card Entrance & Layout Polish --- */
  .event-card {
      animation: card-fade-up 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
      animation-delay: calc(var(--order) * 0.05s);
  }

  .card-row-top {
      gap: 12px;
      margin-bottom: 2px;
  }

  /* --- Empty State Mobile Polish --- */
  .empty-state {
      padding: 60px 20px !important;
      margin: 20px 0 !important;
      border-radius: 16px !important;
  }

  .empty-title {
      font-size: 1.5rem !important;
  }

  .empty-message {
      font-size: 0.9rem !important;
      margin-bottom: 24px !important;
  }

  /* --- Distance Badge Polish --- */
  .distance-badge {
      font-size: 0.65rem;
      padding: 1px 6px;
      border-color: rgba(37, 99, 235, 0.3);
  }

  /* --- Filter Sheet Polish --- */
  .sheet-title {
      font-size: 1.35rem;
  }

  .sheet-option i {
      margin-right: 6px;
      font-size: 0.9rem;
  }
}

/* -- 7. Loading Spinner (V22) -- */
.mobile-loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.mobile-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #f1f0f7;
  border-top: 4px solid #2563EB;
  border-radius: 50%;
  animation: mobile-spin 1s linear infinite;
}

@keyframes mobile-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* --- Unified Design System Polish (V30) --- */
.header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.distance-badge {
    background: rgba(37, 99, 235, 0.05);
    color: #2563EB;
    border: 1px solid rgba(37, 99, 235, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
}

.universal-loader-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.universal-loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner-ring {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(37, 99, 235, 0.1);
    border-top: 3px solid #2563EB;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    width: 100%;
}