/**
 * ArenaPulse Layout Architecture
 * Mobile shell (390px baseline) & Desktop Responsive Grid (768px, 1024px, 1440px)
 */

.app-root {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--surface-floor);
  position: relative;
  overflow-x: hidden;
}

/* ==========================================================================
   1. AMBIENT BACKDROP GLOWS
   ========================================================================== */

.ambient-background {
  position: fixed;
  inset: 0;
  pointer-events-none;
  overflow: hidden;
  z-index: var(--z-background);
}

.ambient-glow-1 {
  position: absolute;
  top: -15%;
  right: -15%;
  width: 90vw;
  height: 90vw;
  max-width: 600px;
  max-height: 600px;
  border-radius: var(--radius-full);
  background: var(--color-surface-tint);
  opacity: 0.03;
  filter: blur(120px);
}

.ambient-glow-2 {
  position: absolute;
  bottom: 0;
  left: -15%;
  width: 80vw;
  height: 80vw;
  max-width: 500px;
  max-height: 500px;
  border-radius: var(--radius-full);
  background: var(--color-secondary);
  opacity: 0.03;
  filter: blur(120px);
}

/* ==========================================================================
   2. PAGE CONTAINER & SHELL
   ========================================================================== */

.page-container {
  width: 100%;
  max-width: 480px; /* Mobile viewport default container */
  margin-left: auto;
  margin-right: auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: var(--z-base);
  background-color: var(--color-background);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
}

.page-container.layout-wide {
  max-width: 1280px;
}

/* ==========================================================================
   3. TOP APP BAR (Sticky Mobile Header)
   ========================================================================== */

.top-app-bar {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: var(--z-sticky-header);
  background: rgba(17, 19, 26, 0.88);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

.top-app-bar-inner {
  height: 60px;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Home User Avatar & Badge */
.header-user-badge {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.header-avatar-ring {
  border: 2px solid var(--color-primary-container);
  box-shadow: 0 0 8px rgba(105, 255, 69, 0.3);
}

.header-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.player-tag-pill {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: var(--weight-bold);
  color: var(--color-primary-container);
  background: rgba(105, 255, 69, 0.12);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.05em;
  margin-left: 4px;
}

/* Back Navigation Group */
.header-back-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.header-back-btn {
  background: var(--color-surface-container-high);
  color: var(--color-on-surface);
  flex-shrink: 0;
}

.header-back-btn:hover {
  background: var(--color-surface-container-highest);
  color: var(--color-primary-fixed);
}

/* Hub Icon */
.header-hub-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.header-hub-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary-fixed-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(76, 227, 40, 0.35);
}

.header-title-box {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header-title-box h1 {
  margin: 0;
  font-size: var(--text-headline-sm);
  line-height: 1.2;
}

/* Desktop Global Search Bar (Hidden on Mobile) */
.header-desktop-search {
  display: none;
}

/* Header Balance Chip */
.header-balance-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface-container-high);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-title-sm);
  font-weight: var(--weight-bold);
  color: var(--color-on-surface);
  text-decoration: none;
  transition: all var(--transition-fast);
  min-height: 44px;
}

.header-balance-chip:hover {
  border-color: rgba(105, 255, 69, 0.4);
  background: var(--color-surface-container-highest);
  box-shadow: 0 0 10px rgba(105, 255, 69, 0.15);
}

.header-balance-add {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--color-primary-fixed-dim);
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.header-balance-chip:hover .header-balance-add {
  transform: scale(1.1);
}

.header-mobile-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: 40px;
  width: 40px;
  border-radius: var(--radius-full);
  background: var(--color-primary-fixed);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(105, 255, 69, 0.25);
}
.header-mobile-brand .material-symbols-outlined {
  color: #000000;
  font-size: 24px;
}

/* Notification Bell with Badge Dot */
.header-notif-btn {
  position: relative;
}

.header-notif-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  background: var(--color-live);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-surface-dim);
  animation: live-pulse 2s infinite ease-in-out;
}

.header-profile-link {
  display: inline-flex;
  margin-left: 2px;
}

/* ==========================================================================
   4. MAIN CONTENT AREA
   ========================================================================== */

.main-content {
  flex: 1;
  padding: var(--space-4);
  padding-bottom: 90px; /* Offset for fixed bottom navigation */
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.page-header-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  border-left: 4px solid var(--color-primary-fixed-dim);
  padding-left: var(--space-3);
  margin-top: var(--space-2);
}

/* ==========================================================================
   5. HORIZONTAL CAROUSEL RAILS
   ========================================================================== */

.horizontal-rail {
  display: flex;
  overflow-x: auto;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  scroll-snap-type: x mandatory;
}

.horizontal-rail > * {
  scroll-snap-align: start;
}

/* Hide scrollbar */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==========================================================================
   6. FIXED BOTTOM NAVIGATION BAR
   ========================================================================== */

.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  z-index: var(--z-bottom-nav);
  height: 64px;
  background: rgba(29, 31, 38, 0.94);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--space-2);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  color: var(--color-on-surface-variant);
  transition: all var(--transition-fast);
  position: relative;
  user-select: none;
  text-decoration: none;
}

.bottom-nav-item .nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-item .nav-icon-aura {
  position: absolute;
  inset: -6px;
  background: rgba(105, 255, 69, 0.15);
  filter: blur(8px);
  border-radius: var(--radius-full);
  z-index: -1;
}

.bottom-nav-item .nav-label {
  font-family: var(--font-body);
  font-size: var(--text-label-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  opacity: 0.7;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--color-primary-container);
}

.bottom-nav-item.active .nav-label {
  opacity: 1;
  font-weight: var(--weight-extrabold);
}

.bottom-nav-item.active .active-bar {
  position: absolute;
  bottom: 0;
  width: 28px;
  height: 2.5px;
  background: var(--color-primary-container);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
  box-shadow: 0 0 8px var(--color-primary-container);
}

/* Center Offset Action Button */
.center-action-btn {
  position: relative;
  top: -16px;
}

.center-fab {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-primary-fixed);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(105, 255, 69, 0.4);
  border: 4px solid rgba(29, 31, 38, 0.94);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.center-fab .material-symbols-outlined {
  color: #000000 !important;
  font-size: 26px;
}

.center-action-btn:hover .center-fab {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(105, 255, 69, 0.5);
}

.center-action-btn.active .center-fab {
  background: var(--color-primary-fixed-dim);
  box-shadow: 0 4px 20px rgba(76, 227, 40, 0.6);
}

.center-action-btn .nav-label {
  opacity: 1;
  font-weight: var(--weight-bold);
  color: var(--color-primary-fixed);
}

/* ==========================================================================
   6. DESKTOP SIDEBAR STYLES
   ========================================================================== */

.desktop-sidebar {
  display: none;
}

.sidebar-brand-box {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-fixed);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-primary);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  color: var(--color-primary);
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-sub {
  color: var(--color-secondary-container);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section-label {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--color-outline);
  padding: 8px 12px 4px 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--color-on-surface-variant);
  font-family: var(--font-body);
  font-size: var(--text-body-md);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-link:hover {
  background: var(--color-surface-container-high);
  color: var(--color-on-surface);
}

.sidebar-link.active {
  background: rgba(105, 255, 69, 0.08);
  color: var(--color-primary-fixed);
  font-weight: var(--weight-bold);
}

.sidebar-active-indicator {
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--color-primary-fixed);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: 0 0 8px var(--color-primary-fixed);
}

.sidebar-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: var(--weight-extrabold);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(255, 59, 48, 0.15);
  color: var(--color-live);
  letter-spacing: 0.05em;
}

.sidebar-badge.badge-live-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--color-live);
  animation: live-pulse 2s infinite ease-in-out;
}

/* Sidebar Wallet Mini Card */
.sidebar-wallet-card {
  background: var(--color-surface-container);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-wallet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Sidebar User Footer */
.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* Split Layout Base (Mobile First) */
.deposit-split-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.sidebar-user-tile {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

/* ==========================================================================
   10. DEDICATED FULLSCREEN AUTH LAYOUTS
   ========================================================================== */

.auth-root-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-page-container {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 auto !important;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-main-content {
  padding: var(--space-4) !important;
  padding-bottom: var(--space-4) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  gap: 0 !important;
}

.auth-card-wrapper {
  width: 100%;
  max-width: 440px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  animation: fadeInAuth 0.35s ease-out;
}

@keyframes fadeInAuth {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
