/**
 * Layout Styles - Warm Neon Cantina
 * App structure, banner, header, tab bar
 */

/* ==========================================================================
   APP LAYOUT STRUCTURE
   ========================================================================== */

.app-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-background);
}

/* Main content area with textured background */
.main-content-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--banner-height) + 60px);
}

/* Textured Background Layer */
.textured-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.textured-background .texture-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.textured-background .watermark-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.12;
  pointer-events: none;
  filter: blur(1px);
}

/* Main Content */
#main-content {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--tab-bar-height);
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ==========================================================================
   ROLLING ANNOUNCEMENT BANNER - Enhanced with glow
   ========================================================================== */

.announcement-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--banner-height);
  overflow: hidden;
  z-index: 5;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Gradient overlay for depth */
.announcement-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.15));
  pointer-events: none;
}

.announcement-banner.lime {
  background: linear-gradient(135deg, var(--color-chulas-lime) 0%, #C4CC1F 100%);
  box-shadow: 0 4px 30px var(--color-chulas-lime-glow);
}

.announcement-banner.orange {
  background: linear-gradient(135deg, var(--color-chulas-orange) 0%, #E89445 100%);
  box-shadow: 0 4px 30px var(--color-chulas-orange-glow);
}

.announcement-banner.purple {
  background: linear-gradient(135deg, var(--color-chulas-purple) 0%, #5D4E94 100%);
  box-shadow: 0 4px 30px var(--color-chulas-purple-glow);
}

.announcement-banner.red {
  background: linear-gradient(135deg, var(--color-chulas-red) 0%, #D84850 100%);
  box-shadow: 0 4px 30px var(--color-chulas-red-glow);
}

.announcement-banner.teal {
  background: linear-gradient(135deg, var(--color-chulas-teal) 0%, #009B87 100%);
  box-shadow: 0 4px 30px var(--color-chulas-teal-glow);
}

.announcement-banner .banner-text-container {
  position: absolute;
  top: 66px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.announcement-banner .banner-text {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: bold;
  color: var(--color-chulas-black);
  white-space: nowrap;
  animation: scrollText 16s linear 0.3s infinite;
  transform: translateZ(0);
  transition: opacity 0.3s ease;
  letter-spacing: 0.03em;
}

@keyframes scrollText {
  0% {
    transform: translateX(100vw);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* ==========================================================================
   HEADER LOGO - Enhanced with subtle glow
   ========================================================================== */

.header-logo {
  position: absolute;
  top: 66px;
  left: 20px;
  z-index: 10;
  height: var(--logo-height);
  width: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.header-logo img {
  height: 100%;
  width: auto;
  display: block;
}

/* ==========================================================================
   DRAWER PULL TAB - Hangs off bottom of banner
   ========================================================================== */

.drawer-pull-tab {
  position: absolute;
  top: var(--banner-height);
  right: 20px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 20px 8px;
  background: linear-gradient(180deg, rgba(30, 26, 27, 0.95) 0%, rgba(21, 18, 19, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-radius: 0 0 14px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.drawer-pull-tab.open {
  background: linear-gradient(180deg, rgba(40, 35, 36, 0.98) 0%, rgba(30, 26, 27, 0.98) 100%);
  border-color: rgba(248, 160, 84, 0.3);
}

.pull-tab-line {
  width: 32px;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.drawer-pull-tab.open .pull-tab-line {
  background: rgba(248, 160, 84, 0.5);
}

.pull-tab-chevron {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.25s ease;
}

.drawer-pull-tab.open .pull-tab-chevron {
  color: var(--color-chulas-orange);
}

/* ==========================================================================
   MORE DRAWER - Slides down from banner
   ========================================================================== */

.more-drawer {
  position: absolute;
  top: calc(var(--banner-height) + 50px);
  left: 16px;
  right: 16px;
  background: linear-gradient(180deg, rgba(21, 18, 19, 0.98) 0%, rgba(30, 26, 27, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.3);
  z-index: 20;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
}

.more-drawer.open {
  max-height: 400px;
  opacity: 1;
}

.drawer-list {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.drawer-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  margin: 0 8px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.drawer-list-item:active {
  background: rgba(255, 255, 255, 0.05);
}

.drawer-list-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.drawer-list-label {
  flex: 1;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  text-align: left;
}

.drawer-list-chevron {
  font-size: 20px;
  color: var(--color-text-secondary);
  font-weight: 300;
}

/* Drawer color themes - match banner */
.more-drawer.lime {
  border-color: rgba(214, 222, 35, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(214, 222, 35, 0.15);
}
.more-drawer.lime .drawer-list-item:active {
  background: rgba(214, 222, 35, 0.1);
}

.more-drawer.orange {
  border-color: rgba(248, 160, 84, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(248, 160, 84, 0.15);
}
.more-drawer.orange .drawer-list-item:active {
  background: rgba(248, 160, 84, 0.1);
}

.more-drawer.purple {
  border-color: rgba(112, 96, 169, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(112, 96, 169, 0.15);
}
.more-drawer.purple .drawer-list-item:active {
  background: rgba(112, 96, 169, 0.1);
}

.more-drawer.red {
  border-color: rgba(240, 89, 96, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(240, 89, 96, 0.15);
}
.more-drawer.red .drawer-list-item:active {
  background: rgba(240, 89, 96, 0.1);
}

.more-drawer.teal {
  border-color: rgba(0, 178, 156, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 178, 156, 0.15);
}
.more-drawer.teal .drawer-list-item:active {
  background: rgba(0, 178, 156, 0.1);
}

/* Pull tab color themes */
.drawer-pull-tab.lime.open {
  border-color: rgba(214, 222, 35, 0.4);
}
.drawer-pull-tab.lime.open .pull-tab-line {
  background: rgba(214, 222, 35, 0.6);
}
.drawer-pull-tab.lime.open .pull-tab-chevron {
  color: var(--color-chulas-lime);
}

.drawer-pull-tab.orange.open {
  border-color: rgba(248, 160, 84, 0.4);
}
.drawer-pull-tab.orange.open .pull-tab-line {
  background: rgba(248, 160, 84, 0.6);
}
.drawer-pull-tab.orange.open .pull-tab-chevron {
  color: var(--color-chulas-orange);
}

.drawer-pull-tab.purple.open {
  border-color: rgba(112, 96, 169, 0.4);
}
.drawer-pull-tab.purple.open .pull-tab-line {
  background: rgba(112, 96, 169, 0.6);
}
.drawer-pull-tab.purple.open .pull-tab-chevron {
  color: var(--color-chulas-purple);
}

.drawer-pull-tab.red.open {
  border-color: rgba(240, 89, 96, 0.4);
}
.drawer-pull-tab.red.open .pull-tab-line {
  background: rgba(240, 89, 96, 0.6);
}
.drawer-pull-tab.red.open .pull-tab-chevron {
  color: var(--color-chulas-red);
}

.drawer-pull-tab.teal.open {
  border-color: rgba(0, 178, 156, 0.4);
}
.drawer-pull-tab.teal.open .pull-tab-line {
  background: rgba(0, 178, 156, 0.6);
}
.drawer-pull-tab.teal.open .pull-tab-chevron {
  color: var(--color-chulas-teal);
}

/* ==========================================================================
   CUSTOM TAB BAR - Refined with glow accents
   ========================================================================== */

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, var(--color-chulas-black) 0%, rgba(26, 22, 23, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-bar-border {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.08) 20%,
    rgba(255, 255, 255, 0.08) 80%,
    transparent
  );
}

.tab-bar-items {
  display: flex;
  padding-top: 6px;
  padding-bottom: env(safe-area-inset-bottom, 6px);
}

.tab-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: all var(--transition-fast);
  position: relative;
}

.tab-bar-item:active {
  transform: scale(0.9);
}

/* Glow indicator for active tab */
.tab-bar-item.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  transition: all var(--transition-normal);
}

.tab-bar-item .tab-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-bounce);
}

.tab-bar-item.active .tab-icon {
  transform: scale(1.1);
}

.tab-bar-item .tab-icon svg {
  width: 100%;
  height: 100%;
  transition: filter var(--transition-normal);
}

.tab-bar-item .tab-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  transition: color var(--transition-fast);
}

/* Tab colors when inactive */
.tab-bar-item {
  color: rgba(142, 142, 147, 0.8);
}

/* Tab colors when active - with glow effects */
.tab-bar-item.active[data-tab="home"] {
  color: var(--color-chulas-lime);
}
.tab-bar-item.active[data-tab="home"]::before {
  background: var(--color-chulas-lime);
  box-shadow: 0 0 12px var(--color-chulas-lime-glow);
}
.tab-bar-item.active[data-tab="home"] .tab-icon svg {
  filter: drop-shadow(0 0 8px var(--color-chulas-lime-glow));
}

.tab-bar-item.active[data-tab="menu"] {
  color: var(--color-chulas-orange);
}
.tab-bar-item.active[data-tab="menu"]::before {
  background: var(--color-chulas-orange);
  box-shadow: 0 0 12px var(--color-chulas-orange-glow);
}
.tab-bar-item.active[data-tab="menu"] .tab-icon svg {
  filter: drop-shadow(0 0 8px var(--color-chulas-orange-glow));
}

.tab-bar-item.active[data-tab="rewards"] {
  color: var(--color-chulas-purple);
}
.tab-bar-item.active[data-tab="rewards"]::before {
  background: var(--color-chulas-purple);
  box-shadow: 0 0 12px var(--color-chulas-purple-glow);
}
.tab-bar-item.active[data-tab="rewards"] .tab-icon svg {
  filter: drop-shadow(0 0 8px var(--color-chulas-purple-glow));
}

.tab-bar-item.active[data-tab="valet"] {
  color: var(--color-chulas-red);
}
.tab-bar-item.active[data-tab="valet"]::before {
  background: var(--color-chulas-red);
  box-shadow: 0 0 12px var(--color-chulas-red-glow);
}
.tab-bar-item.active[data-tab="valet"] .tab-icon svg {
  filter: drop-shadow(0 0 8px var(--color-chulas-red-glow));
}

.tab-bar-item.active[data-tab="events"] {
  color: var(--color-chulas-teal);
}
.tab-bar-item.active[data-tab="events"]::before {
  background: var(--color-chulas-teal);
  box-shadow: 0 0 12px var(--color-chulas-teal-glow);
}
.tab-bar-item.active[data-tab="events"] .tab-icon svg {
  filter: drop-shadow(0 0 8px var(--color-chulas-teal-glow));
}

/* ==========================================================================
   PAGE TRANSITIONS - Smoother, more refined
   ========================================================================== */

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

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

@keyframes slideInLeft {
  from {
    transform: translateX(-30%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0.8;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Page transitions */
.page-home,
.page-menu,
.page-rewards,
.page-valet,
.page-events,
.page-auth {
  animation: fadeIn 0.2s ease-out;
  transform: translateZ(0);
  will-change: opacity, transform;
}

/* ==========================================================================
   STAGGERED CONTENT ANIMATIONS
   ========================================================================== */

.stagger-item {
  opacity: 0;
  animation: fadeIn 0.4s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
