/* ==========================================================================
   MOGO X+ MOBILE-FIRST RESPONSIVE FOUNDATION & NAVIGATION DRAWER
   Obsidian Glassmorphism • Touch Target Optimization (48px) • Zero Overflow
   ========================================================================== */

/* 1. Global Viewport & Horizontal Overflow Lock */
html, body {
  max-width: 100vw;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

/* 2. Touch-Friendly Interactive Targets */
@media (max-width: 768px) {
  a, button, input, select {
    touch-action: manipulation;
  }
}

/* 3. Mobile Hamburger Button (Inside Navbar Pill) */
.mobile-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #FFFFFF;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.2s ease;
  z-index: 1001;
  box-sizing: border-box;
}

.mobile-hamburger:hover,
.mobile-hamburger:active {
  background: rgba(124, 101, 232, 0.25);
  border-color: rgba(124, 101, 232, 0.45);
}

.mobile-hamburger svg {
  width: 18px;
  height: 18px;
  stroke: #FFFFFF;
  stroke-width: 2.2;
}

/* Show Hamburger & Hide Desktop Links on Tablets / Phones */
@media (max-width: 768px) {
  .nav-links {
    display: none !important;
  }
  .mobile-hamburger {
    display: inline-flex !important;
  }
  .navbar-container {
    top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding: 0 12px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: none !important;
    z-index: 10000 !important;
    transition: none !important;
  }
  /* Header stays permanently visible on mobile screens as requested */
  .navbar-container.nav-scroll-hidden {
    transform: none !important;
    opacity: 1 !important;
    pointer-events: none !important;
  }
  .navbar-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 6px 0 14px !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    max-width: calc(100% - 16px) !important;
    width: auto !important;
    border-radius: 9999px !important;
    background: rgba(18, 19, 26, 0.92) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7) !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
  }
  .navbar-pill > div {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .nav-brand {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 7px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
    line-height: 1 !important;
  }
  .nav-brand-icon {
    width: 22px !important;
    height: 22px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
  }
  .nav-cta,
  .navbar-pill .nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    color: #000000;
    padding: 0 16px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 9999px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    line-height: 36px;
    white-space: nowrap;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    margin: 0;
    box-sizing: border-box;
    vertical-align: middle;
  }
  .nav-cta.hidden,
  .navbar-pill .nav-cta.hidden,
  .navbar-pill:has(.nav-profile-pill) .nav-cta,
  .navbar-pill.has-auth .nav-cta,
  body.customer-logged-in .nav-cta,
  .customer-logged-in .navbar-pill .nav-cta {
    display: none !important;
  }
  .mobile-hamburger {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    color: #FFFFFF !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  .container {
    padding: 0 16px !important;
  }
  .page-header {
    padding-top: 92px !important;
    padding-bottom: 28px !important;
  }
}

/* Universal Smooth Mobile Scroll for Tables */
.table-responsive,
.overflow-x-auto {
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin;
}


/* 4. Fullscreen Glassmorphic Mobile Drawer */
.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 8, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.mobile-drawer-overlay.active {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 86vw;
  max-width: 380px;
  height: 100vh;
  height: 100dvh;
  background: #080A10;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
  overflow-y: auto;
  z-index: 100000;
  padding: 24px 20px;
}

.mobile-drawer-overlay.active .mobile-drawer {
  transform: translateX(0);
  visibility: visible;
}

/* Drawer Header */
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.mobile-drawer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.mobile-drawer-brand .nav-brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7C65E8, #F5B8A8);
  color: #000;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.mobile-drawer-brand span {
  color: #FFFFFF;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.mobile-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9CA3AF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-drawer-close:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
}

/* Drawer Navigation Links List */
.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-radius: 12px;
  color: #D1D5DB;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  transition: all 0.2s ease;
  min-height: 48px;
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
  transform: translateX(3px);
}

.mobile-nav-item.active {
  background: rgba(124, 101, 232, 0.12);
  border: 1px solid rgba(124, 101, 232, 0.3);
  color: #C5BBE8;
}

.mobile-nav-item-icon {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.mobile-nav-item-icon svg {
  width: 18px;
  height: 18px;
  stroke: #9CA3AF;
  transition: stroke 0.2s ease;
}

.mobile-nav-item:hover .mobile-nav-item-icon svg {
  stroke: #7C65E8;
}

.mobile-nav-arrow {
  color: #6B7280;
  font-size: 13px;
}

/* Drawer Auth / Profile Slot */
.mobile-drawer-auth {
  margin: 18px 0 16px;
  padding: 14px;
  background: rgba(18, 20, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

/* Drawer Bottom Actions */
.mobile-drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-btn-primary {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #FFFFFF;
  color: #000000;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.mobile-btn-primary:active {
  transform: scale(0.98);
}

.mobile-btn-vault {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(124, 101, 232, 0.12);
  border: 1px solid rgba(124, 101, 232, 0.3);
  color: #C5BBE8;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
}

.mobile-btn-vault:hover,
.mobile-btn-vault:active {
  background: rgba(124, 101, 232, 0.22);
  color: #FFFFFF;
}

/* 5. Mobile Hero & Section Adjustments */
@media (max-width: 640px) {
  .hero-section {
    padding-top: 110px !important;
    padding-bottom: 40px !important;
  }
  .hero-title-holder {
    margin-bottom: 20px !important;
  }
  .hero-text, .hero-text-blur {
    font-size: clamp(38px, 12vw, 64px) !important;
    line-height: 1.05 !important;
  }
  .hero-sub {
    font-size: 14px !important;
    line-height: 1.6 !important;
    padding: 0 8px !important;
    margin-bottom: 28px !important;
  }
  
  /* Trial Input Pill Stack */
  .hero-input-pill {
    flex-direction: column !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto 24px !important;
    gap: 10px !important;
  }
  .hero-input-field {
    width: 100% !important;
    background: rgba(18, 20, 29, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 9999px !important;
    padding: 13px 18px !important;
    font-size: 13.5px !important;
    text-align: center !important;
    min-height: 48px !important;
  }
  .hero-submit-btn {
    width: 100% !important;
    border-radius: 9999px !important;
    padding: 13px 20px !important;
    min-height: 48px !important;
    font-size: 14px !important;
    justify-content: center !important;
  }
  
  /* Platform Compatibility Chips */
  .hero-platforms {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
    font-size: 12px !important;
  }
  .platform-chip {
    padding: 5px 10px !important;
    font-size: 11px !important;
  }
  
  /* Bento Grid Mobile Layout */
  .bento-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .col-8, .col-4, .col-6, .col-3, .col-12 {
    grid-column: span 1 !important;
  }
  .bento-card {
    padding: 20px 18px !important;
  }
}

/* Bento 1: Live Guest Slots & Telemetry Mobile Optimization */
.accounts-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .accounts-table-wrap {
    margin: 0 -8px !important;
    width: calc(100% + 16px) !important;
    padding: 0 4px !important;
  }
  .accounts-table {
    width: 100% !important;
    font-size: 10.5px !important;
    border-collapse: collapse !important;
  }
  .accounts-table th,
  .accounts-table td {
    padding: 8px 2px !important;
    font-size: 10.5px !important;
    line-height: 1.2 !important;
  }
  .accounts-table th {
    font-size: 9px !important;
    letter-spacing: 0.01em !important;
    white-space: nowrap !important;
  }
  .accounts-table th:last-child,
  .accounts-table td:last-child {
    text-align: right !important;
  }
  .table-account-cell {
    gap: 4px !important;
    font-size: 10.5px !important;
    white-space: nowrap !important;
  }
  .table-account-cell span:first-child {
    font-size: 12px !important;
  }
  .swap-action-btn {
    padding: 3px 6px !important;
    font-size: 9.5px !important;
    white-space: nowrap !important;
    border-radius: 6px !important;
  }

  /* Existing Customer Vault Banner Mobile Card Spec */
  .existing-customer-banner {
    border-radius: 20px !important;
    padding: 18px 20px !important;
    flex-direction: column !important;
    text-align: center !important;
    gap: 14px !important;
  }
  .existing-customer-banner > div {
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
  }
  .existing-customer-banner a {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px 20px !important;
  }
}
