/* ==========================================================================
   GigVibe - Nocturne Stage Design System & Custom Interactions
   Style: Electric Midnight Glass
   ========================================================================== */

:root {
  --color-surface: #131317;
  --color-surface-dim: #131317;
  --color-surface-bright: #39393d;
  --color-surface-container-lowest: #0e0e12;
  --color-surface-container-low: #1b1b1f;
  --color-surface-container: #1f1f23;
  --color-surface-container-high: #2a292e;
  --color-surface-container-highest: #353439;
  --color-primary: #d2bbff;
  --color-primary-container: #7c3aed;
  --color-on-primary-container: #ede0ff;
  --color-secondary: #4edea3;
  --color-secondary-container: #00a572;
  --color-tertiary: #ffb784;
  --color-error: #ffb4ab;
  --border-ghost: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.16);
  --glass-bg: rgba(26, 26, 32, 0.85);
  --glass-header: rgba(19, 19, 23, 0.88);
}

/* Base resets & typography */
html, body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--color-surface);
  color: #e4e1e7;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Smooth Scrolling & Custom Glass Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

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

/* Glassmorphism Classes */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-ghost);
}

.glass-header {
  background: var(--glass-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-ghost);
}

.glass-nav {
  background: rgba(27, 27, 31, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-ghost);
}

.glass-card {
  background: rgba(31, 31, 35, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-ghost);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.glass-card-interactive {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.glass-card-interactive:hover {
  transform: translateY(-2px);
  border-color: rgba(210, 187, 255, 0.3);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
}

/* Tabular Figures for currency & metrics */
.tabular-numbers {
  font-variant-numeric: tabular-nums;
}

/* Safe Area Insets for iOS Home Indicator and Status Bar */
.pb-safe {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 16px);
}
.pt-safe {
  padding-top: max(env(safe-area-inset-top, 0px), 8px);
}

/* ==========================================================================
   Simulator Frame Mode (Realistic iPhone Frame Toggle)
   ========================================================================== */
.simulator-wrapper {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0.5rem 0;
  height: calc(100vh - 44px);
  max-height: calc(100vh - 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.simulator-frame {
  width: 100%;
  max-width: 412px;
  height: 100%;
  max-height: min(820px, calc(100vh - 60px));
  border-radius: 44px;
  border: 10px solid #26262e;
  box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
  background-color: var(--color-surface);
  display: flex;
  flex-direction: column;
}

/* Dynamic Island Simulation in phone frame */
.dynamic-island {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 116px;
  height: 28px;
  background-color: #000;
  border-radius: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.dynamic-island .camera {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}
.dynamic-island .sensor {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #09131d;
}

/* Fluid responsive layout mode */
.fluid-frame {
  max-width: 520px;
  width: 100%;
  height: calc(100vh - 44px);
  margin: 0 auto;
  border-radius: 0;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Header & Nav inside frames */
.app-header {
  width: 100%;
  flex-shrink: 0;
  z-index: 40;
}

.simulator-frame .app-header {
  padding-top: 32px; /* space for dynamic island */
}

.app-nav {
  width: 100%;
  flex-shrink: 0;
  z-index: 40;
}

.app-main {
  flex: 1 1 0%;
  overflow-y: auto;
  position: relative;
  width: 100%;
  scroll-behavior: smooth;
}

/* Modals inside frame */
.simulator-frame .modal-backdrop,
.fluid-frame .modal-backdrop {
  position: absolute;
}
.simulator-frame .toast-notice,
.fluid-frame .toast-notice {
  position: absolute;
}


/* ==========================================================================
   Card Swipe & Gestures
   ========================================================================== */
.swipe-card-container {
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

#swipeCard {
  transform-origin: 50% 100%;
  cursor: grab;
}
#swipeCard:active {
  cursor: grabbing;
}

/* Dynamic stamps for Match screen */
.stamp {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: scale(0.9);
}
.stamp.active {
  opacity: 1;
  transform: scale(1.05);
}

/* Waveform Bar Equalizer */
.equalizer-bar {
  transition: height 0.15s ease;
  min-height: 4px;
}

/* Ambient Glow Pulsing */
@keyframes violetGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
  }
  50% {
    box-shadow: 0 0 28px rgba(124, 58, 237, 0.85);
  }
}
.glow-pulse {
  animation: violetGlow 2.8s infinite ease-in-out;
}

@keyframes greenGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(78, 222, 163, 0.4);
  }
  50% {
    box-shadow: 0 0 18px rgba(78, 222, 163, 0.85);
  }
}
.glow-pulse-green {
  animation: greenGlow 2.4s infinite ease-in-out;
}

/* Modal Bottom Sheet Animations */
.modal-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-backdrop.open .modal-sheet {
  transform: translateY(0);
}

/* Toast Notifications */
.toast-notice {
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* Screen Transitions */
.screen-view {
  display: none;
  opacity: 0;
  animation: fadeInView 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.screen-view.active-screen {
  display: flex;
}

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