:root {
  --app-bg-top: #000000;
  --app-bg-bottom: #000000;
  
  --card-bg-gradient-start: #f8480a;
  --card-bg-gradient-end: #3b050d;
  
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.1);
  --glass-bg-active: rgba(255, 255, 255, 0.15);
  
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-light: rgba(255, 255, 255, 0.2);
  
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  
  --accent-blue: #3b82f6;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  
  --shadow-main: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --shadow-glass: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 8px 32px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  height: 100%;
  background-color: var(--app-bg-bottom);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: transparent;
  overflow: hidden;
  overscroll-behavior-y: none;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Background Setup */
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--app-bg-top) 0%, var(--app-bg-bottom) 100%);
  z-index: -2;
}

.noise-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  z-index: -1;
  mix-blend-mode: overlay;
}

/* Layout */
#app {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ui-container {
  width: 100%;
  max-width: 428px; /* Mobile max width */
  height: 100%;
  max-height: 926px; /* Mobile max height */
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 20px; /* Base horizontal padding */
}

/* Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  z-index: 10;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

.glass-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-glass);
}

.glass-button:active {
  transform: scale(0.95);
  background: var(--glass-bg-active);
}

.header-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-spacer {
  width: 40px;
}

/* Card Stack */
/* Full Screen Chart Area */
.fullscreen-chart-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #101014;
  background: radial-gradient(circle at center, rgba(30,30,35,0.5) 0%, #101014 100%);
  overflow: hidden;
}

.candlestick-chart {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Signal Badges */

@keyframes smoothVibrate {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(1px); }
  75% { transform: translateX(-1px); }
}

.candle.bullish.animating {
  animation: smoothVibrate 0.15s ease-in-out infinite;
}

.candle.bullish .body {
  fill: #00ff66; /* Neon Green */
  filter: drop-shadow(0 0 10px rgba(0, 255, 102, 0.7)) drop-shadow(0 0 20px rgba(0, 255, 102, 0.4));
}
.candle.bullish .wick {
  stroke: #00ff66;
  filter: drop-shadow(0 0 5px #00ff66);
}
.candle.bullish .glow-ball {
  fill: #ffffff;
  filter: drop-shadow(0 0 8px #ffffff) drop-shadow(0 0 15px #00ff66);
}

.candle.bearish .body {
  fill: #ff2a2a; /* Neon Red */
  filter: drop-shadow(0 0 10px rgba(255, 42, 42, 0.7)) drop-shadow(0 0 20px rgba(255, 42, 42, 0.4));
}
.candle.bearish .wick {
  stroke: #ff2a2a;
  filter: drop-shadow(0 0 5px #ff2a2a);
}
.candle.bearish .glow-ball {
  fill: #ffffff;
  filter: drop-shadow(0 0 8px #ffffff) drop-shadow(0 0 15px #ff2a2a);
}

/* Signal Badges */
.signal-badge {
  position: absolute;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #111;
  transform: translate(-50%, -50%) scale(0);
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  pointer-events: none;
}

.signal-badge.anim-badge {
  animation: badge-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.signal-badge::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
}

/* Buy */
.signal-b {
  background: var(--accent-green);
}
.signal-b::after {
  top: -8px;
  border-color: transparent transparent var(--accent-green) transparent;
}

/* Sell */
.signal-s {
  background: var(--accent-red);
  color: white;
}
.signal-s::after {
  bottom: -8px;
  border-color: var(--accent-red) transparent transparent transparent;
}

/* Deep Buy / Deep Sell (from screenshot) */
.signal-db {
  background: #c084fc; /* Purple */
}
.signal-db::after {
  top: -8px;
  border-color: transparent transparent #c084fc transparent;
}

.signal-ds {
  background: #fde047; /* Yellow */
}
.signal-ds::after {
  bottom: -8px;
  border-color: #fde047 transparent transparent transparent;
}

/* Floating Action Bar */
.action-bar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.glass-panel {
  background: rgba(20, 10, 12, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 40px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.1), 0 10px 30px rgba(0,0,0,0.5);
}

.action-bar {
  display: flex;
  gap: 20px;
  padding: 10px 30px;
}

.action-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-btn i {
  font-size: 1.8rem;
  color: white;
}

.action-btn:active {
  transform: scale(0.9);
}

.action-btn.dislike:active { background: rgba(239, 68, 68, 0.2); }
.action-btn.dislike:active i { color: var(--accent-red); }

.action-btn.like:active { background: rgba(34, 197, 94, 0.2); }
.action-btn.like:active i { color: var(--accent-green); }

/* Bottom Nav */
.bottom-nav-container {
  padding-bottom: env(safe-area-inset-bottom, 10px);
}

.bottom-nav {
  display: flex;
  justify-content: space-between;
  padding: 12px 24px;
  border-radius: 30px;
}

.nav-btn {
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-btn i {
  font-size: 1.6rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.nav-btn.active {
  background: var(--accent-blue);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.nav-btn.active i {
  color: white;
}

/* Animations */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%) rotate(10deg); }
  to { opacity: 1; transform: translateX(0) rotate(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-100%) rotate(-10deg); }
  to { opacity: 1; transform: translateX(0) rotate(0); }
}

.card-enter {
  animation: slideInRight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Logo & Mini Chart Custom Adjustments */
.t-card-chart-container {
  position: absolute;
  bottom: 12px;
  left: 5%;
  width: 90%;
  height: 60px;
  opacity: 0.9;
  pointer-events: none;
  z-index: 3;
}

.t-card-chart {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-path {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawChart 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  filter: drop-shadow(0 2px 8px rgba(34, 197, 94, 0.5));
}

@keyframes drawChart {
  to {
    stroke-dashoffset: 0;
  }
}

/* Header logo styles */
.header-logo-container {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  padding: 0 !important; /* Override standard glass-button padding */
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.app-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transform: scale(0.9);
}

/* Stack Cards (Tinder Pile Effect) */
.stack-card-0 {
  z-index: 3;
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.stack-card-1 {
  z-index: 2;
  transform: scale(0.94) translateY(14px);
  opacity: 0.85;
  pointer-events: none;
  filter: blur(0.3px);
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.15) !important;
}

.stack-card-2 {
  z-index: 1;
  transform: scale(0.88) translateY(28px);
  opacity: 0.55;
  pointer-events: none;
  filter: blur(0.8px);
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
}

/* Enhancing general liquid glass shadows & glows */
.glass-panel {
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.2), 
    0 12px 40px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.t-card {
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.25), 
    0 20px 45px rgba(0, 0, 0, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.action-btn {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
}

/* Premium Liquid Glass Profile Widget */
.profile-preview-glass {
  position: absolute;
  right: 24px;
  bottom: calc(105px + env(safe-area-inset-bottom, 24px)); /* Float above the bottom nav */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 8px;
  border-radius: 40px;
  background: rgba(20, 10, 12, 0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.25), 
    0 12px 30px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(255, 255, 255, 0.03);
  z-index: 20;
  animation: floatProfile 6s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-preview-glass:active {
  transform: scale(0.92);
}

.profile-avatar-wrapper {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #ff4b4b, #f8480a);
  box-shadow: 0 4px 15px rgba(248, 72, 10, 0.4);
}

.profile-avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #1a0b0d;
}

.profile-status-dot {
  position: absolute;
  bottom: 0px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00ff66;
  border: 2px solid #1a0b0d;
  box-shadow: 0 0 8px rgba(0, 255, 102, 0.6);
}

.profile-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.profile-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}

.tinder-icon {
  color: #ff4b4b;
  font-size: 1.15rem;
  filter: drop-shadow(0 2px 4px rgba(255, 75, 75, 0.5));
  animation: pulseFire 2s infinite;
}

.profile-desc {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@keyframes floatProfile {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulseFire {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 2px 4px rgba(255, 75, 75, 0.5)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 4px 10px rgba(255, 75, 75, 0.8)); }
}
