/* ============================================
   PFL App — Tabs
   Bottom navigation bar, tab content
   Morphing tab bar: Main mode ↔ Arena mode
   ============================================ */

/* ---- Morph timing ---- */
:root {
  --morph-duration: 0.18s;
  --morph-ease: cubic-bezier(0.4, 0, 0.15, 1);
}

/* ---- Bottom Tab Bar Container ---- */
.tabs-bar {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Shared Glass Pill ---- */
.tabs {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 
    0 4px 24px rgba(18, 122, 201, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.60);
  overflow: hidden;
}

/* Dark theme tabs */
:root[data-theme="dark"] .tabs {
  background: rgba(32, 41, 50, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ============================================
   MAIN PILL — expanded in main mode, circle in arena mode
   ============================================ */
.tabs-main {
  flex: 1 1 0%;
  min-width: 0;
  transition: flex var(--morph-duration) var(--morph-ease),
              padding var(--morph-duration) var(--morph-ease);
}

/* ============================================
   SOLO PILL — circle in main mode, expanded in arena mode
   ============================================ */
.tabs-solo {
  flex: 0 0 64px;
  height: 64px;
  padding: 0;
  margin-left: 8px;
  justify-content: center;
  transition: flex var(--morph-duration) var(--morph-ease),
              padding var(--morph-duration) var(--morph-ease);
}

/* ============================================
   ABOUT PILL — circle, visible only in arena mode
   ============================================ */
.tabs-about {
  flex: 0 0 0px;
  width: 0;
  height: 64px;
  padding: 0;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: flex var(--morph-duration) var(--morph-ease),
              width var(--morph-duration) var(--morph-ease),
              margin var(--morph-duration) var(--morph-ease),
              opacity 0.15s ease;
}

.tabs-about .tab-btn {
  flex: none;
  width: 56px;
  height: 56px;
  padding: 0;
}

/* ---- Tab Button (base) ---- */
.tab-btn {
  flex: 1;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 1;
  transition: 
    transform var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.tab-btn:active {
  transform: scale(0.96);
}

/* ============================================
   ANCHOR BUTTON — Fests/PFL, always visible in main pill
   Stays in place during morph, only label changes
   ============================================ */
.tab-btn--anchor {
  flex: 1;
  overflow: hidden;
  transition: 
    flex 0.15s var(--morph-ease),
    transform var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

/* Label crossfade helper */
.tab-btn--anchor .tab-label {
  transition: opacity 0.08s ease;
}

/* ============================================
   EXPANDABLE BUTTONS — Leaderboard, Partners
   Collapse in arena mode, expand in main mode
   ============================================ */
.tab-btn--expandable {
  overflow: hidden;
  transition: 
    flex 0.15s var(--morph-ease),
    opacity 0.08s ease,
    transform var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.tab-btn--expandable .tab-icon,
.tab-btn--expandable .tab-label {
  transition: opacity 0.08s ease;
}

/* ============================================
   ARENA BUTTON — in solo pill
   ============================================ */
.tabs-solo .tab-btn--arena {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  padding: 0;
  overflow: hidden;
  transition: 
    flex 0.15s var(--morph-ease),
    width 0.15s var(--morph-ease),
    opacity 0.08s ease,
    transform var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

/* ============================================
   VENUE BUTTONS — Didyliv (hidden in main mode)
   ============================================ */
.tabs-solo .tab-btn--venue {
  flex: 0 0 0px;
  min-width: 0;
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: 
    flex 0.15s var(--morph-ease),
    width 0.15s var(--morph-ease),
    opacity 0.08s ease,
    transform var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.tabs-solo .tab-btn--venue .tab-icon,
.tabs-solo .tab-btn--venue .tab-label {
  opacity: 0;
  transition: opacity 0.08s ease;
}

/* ============================================
   ARENA MODE — The Morph
   ============================================ */

/* Main pill -> circle (anchor stays, holds the pill) */
.tabs-bar.arena-mode .tabs-main {
  flex: 0 0 64px;
  padding: 4px;
}

/* Anchor -> circle size */
.tabs-bar.arena-mode .tab-btn--anchor {
  flex: 0 0 56px;
}

/* Expandable -> collapse & hide */
.tabs-bar.arena-mode .tab-btn--expandable {
  flex: 0 0 0px;
  opacity: 0;
  pointer-events: none;
}

.tabs-bar.arena-mode .tab-btn--expandable .tab-icon,
.tabs-bar.arena-mode .tab-btn--expandable .tab-label {
  opacity: 0;
}

/* Solo pill -> expanded */
.tabs-bar.arena-mode .tabs-solo {
  flex: 1 1 0%;
  padding: 4px;
}

/* Arena button -> flex tab */
.tabs-bar.arena-mode .tabs-solo .tab-btn--arena {
  flex: 1;
  width: auto;
}

/* Venue buttons -> visible */
.tabs-bar.arena-mode .tabs-solo .tab-btn--venue {
  flex: 1;
  width: auto;
  opacity: 1;
  pointer-events: auto;
}

.tabs-bar.arena-mode .tabs-solo .tab-btn--venue .tab-icon,
.tabs-bar.arena-mode .tabs-solo .tab-btn--venue .tab-label {
  opacity: 1;
  transition-delay: 0.05s;
}

/* About pill -> visible in arena mode */
.tabs-bar.arena-mode .tabs-about {
  flex: 0 0 64px;
  width: 64px;
  opacity: 1;
  pointer-events: auto;
  margin-left: 8px;
  transition-delay: 0.06s;
}

/* ---- Staggered delays ---- */

/* Entering arena mode */
.tabs-bar.arena-mode .tab-btn--expandable {
  transition-delay: 0s;
}
.tabs-bar.arena-mode .tab-btn--expandable .tab-icon,
.tabs-bar.arena-mode .tab-btn--expandable .tab-label {
  transition-delay: 0s;
}
.tabs-bar.arena-mode .tabs-solo .tab-btn--venue {
  transition-delay: 0.05s;
}
.tabs-bar.arena-mode .tab-btn--anchor {
  transition-delay: 0s;
}

/* Exiting arena mode */
.tabs-bar:not(.arena-mode) .tabs-about {
  transition-delay: 0s;
}
.tabs-bar:not(.arena-mode) .tabs-solo .tab-btn--venue {
  transition-delay: 0s;
}
.tabs-bar:not(.arena-mode) .tabs-solo .tab-btn--venue .tab-icon,
.tabs-bar:not(.arena-mode) .tabs-solo .tab-btn--venue .tab-label {
  transition-delay: 0s;
}
.tabs-bar:not(.arena-mode) .tab-btn--expandable {
  transition-delay: 0.05s;
}
.tabs-bar:not(.arena-mode) .tab-btn--expandable .tab-icon,
.tabs-bar:not(.arena-mode) .tab-btn--expandable .tab-label {
  transition-delay: 0.05s;
}
/* Anchor delay ONLY during arena exit morph (class added/removed by JS) */
.tabs-bar.morph-exiting .tab-btn--anchor {
  transition-delay: 0.08s;
}

/* ============================================
   Tab Icon & Label
   ============================================ */
.tab-icon {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}

.tab-icon.bounce {
  animation: iconBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.78); }
  60%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.tab-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-top: var(--spacing-xs);
  white-space: nowrap;
}

/* ---- Active Tab ---- */
.tab-btn.active {
  background: rgba(217, 242, 255, 0.85);
  color: #0F130E;
  font-weight: 600;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.80),
    0 2px 8px rgba(18, 122, 201, 0.12);
}

.tab-btn.active::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  border: 1px solid rgba(35, 139, 218, 0.18);
  pointer-events: none;
}

/* Dark theme active tab */
:root[data-theme="dark"] .tab-btn.active {
  background: rgba(78, 163, 255, 0.22);
  color: var(--text);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 2px 8px rgba(78, 163, 255, 0.15);
}

:root[data-theme="dark"] .tab-btn.active::before {
  border-color: rgba(78, 163, 255, 0.25);
}

/* ---- Delayed active state after morph ---- */
.tab-btn--expandable.morph-entering {
  background: transparent !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}

.tab-btn--expandable.morph-entering::before {
  display: none;
}

/* ---- Tab Content ---- */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tab-slide-in-right 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.tab-content.active.slide-left {
  animation-name: tab-slide-in-left;
}

.tab-content.active.slide-right {
  animation-name: tab-slide-in-right;
}

@keyframes tab-slide-in-right {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes tab-slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   Venue Header (logo + title layout)
   ============================================ */
.venue-header {
  margin-bottom: 0;
}

.venue-header .page-subtitle {
  margin-bottom: 20px;
}

.venue-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.venue-header__logo {
  width: 80px;
  height: 80px;
  display: block;
  object-fit: contain;
}

/* ============================================
   Venue About Block
   ============================================ */
.venue-about {
  margin-top: 0;
  margin-bottom: 24px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.venue-about__link {
  display: inline;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.venue-about__link:active {
  opacity: 0.65;
}

.venue-about__dot {
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

/* ---- Venue Divider ---- */
.venue-divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 0 0 20px 0;
}
