/*
  FanPulse 2026 - Main Layout, Global Styles & Animations
*/

/* View Layout Containers */
.view-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  flex-direction: column;
  background-color: var(--bg-main);
  box-sizing: border-box;
}

.view-container.active {
  display: flex;
}

/* Momentum scrolling for premium app feel on iOS/Android */
.view-container.scrollable {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Inner scroll areas */
.scrollable {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hidden {
  display: none !important;
}

/* iOS/Android sliding page transitions */
.slide-in {
  animation: slideIn var(--transition-normal) forwards;
  z-index: 2;
}

.slide-out {
  animation: slideOut var(--transition-normal) forwards;
  z-index: 1;
}

.slide-in-back {
  animation: slideInBack var(--transition-normal) forwards;
  z-index: 2;
}

.slide-out-back {
  animation: slideOutBack var(--transition-normal) forwards;
  z-index: 1;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0.9;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-20%);
    opacity: 0.6;
  }
}

@keyframes slideInBack {
  from {
    transform: translateX(-100%);
    opacity: 0.9;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutBack {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0.6;
  }
}

/* Header Simulation Bar */
.app-header {
  height: 72px;
  min-height: 72px;
  background-color: rgba(11, 12, 16, 0.85);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: relative;
  z-index: 10;
  box-sizing: border-box;
}

/* Shift main view down when global header is visible */
#app-frame:has(.app-header:not(.hidden)) .view-container {
  padding-top: 72px;
}

/* Shift main view up when nav bar is visible */
#app-frame:has(.app-nav-bar:not(.hidden)) .view-container {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle, #252a3a, #151821);
  border: 1.5px solid var(--neon-cyan);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.user-meta-info {
  display: flex;
  flex-direction: column;
}

.user-nickname {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-pts-badge {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  color: var(--neon-gold);
  letter-spacing: 0.5px;
}

.app-logo-small {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--text-main);
}

.pulse-text {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan-glow);
}

/* Bottom Tab Navigation Bar */
.app-nav-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 72px;
  background-color: rgba(21, 24, 33, 0.92);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 10;
  padding-bottom: env(safe-area-inset-bottom); /* iOS home indicator spacing */
  box-sizing: border-box;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 25%;
  height: 100%;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform var(--transition-fast);
}

.nav-item:active svg {
  transform: scale(0.9);
}

.nav-item.active {
  color: var(--neon-cyan);
}

.nav-item.active svg {
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 5px var(--neon-cyan-glow));
}

/* Utility Animations */
.pulse-glow {
  animation: neonGlow 2s infinite ease-in-out;
}

@keyframes neonGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.6);
  }
}
