/* Custom styles and animations */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #0e121a;
}
::-webkit-scrollbar-thumb {
  background: #232a3b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #343e56;
}

.toast {
  animation: slideIn 0.25s ease-out forwards;
}

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

/* Native HTML5 Fullscreen on #chart-card */
#chart-card:fullscreen,
#chart-card:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: #0b0e14 !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 2147483647 !important;
}

#chart-card:fullscreen #tradingview-container,
#chart-card:-webkit-full-screen #tradingview-container {
  flex: 1 1 0% !important;
  height: calc(100vh - 44px) !important;
  min-height: calc(100vh - 44px) !important;
  max-height: calc(100vh - 44px) !important;
  width: 100vw !important;
}

/* Fallback In-Window Fullscreen Mode */
.chart-fullscreen-fallback {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 999999 !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  background-color: #0b0e14 !important;
  display: flex !important;
  flex-direction: column !important;
}

.chart-fullscreen-fallback #tradingview-container {
  flex: 1 1 0% !important;
  height: calc(100vh - 44px) !important;
  min-height: calc(100vh - 44px) !important;
  max-height: calc(100vh - 44px) !important;
}

/* Ensure TradingView iframe stretches properly without gaps */
#tradingview-container iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  display: block;
}

/* Resizer Handle styling */
#chart-resizer,
#positions-resizer,
#positions-top-resizer {
  touch-action: none;
  user-select: none;
}

body.resizing-chart,
body.resizing-positions {
  cursor: ns-resize !important;
  user-select: none !important;
}

body.resizing-chart #tradingview-container iframe,
body.resizing-positions #tradingview-container iframe {
  pointer-events: none !important;
}

#chart-card:fullscreen #chart-resizer,
#chart-card:-webkit-full-screen #chart-resizer,
.chart-fullscreen-fallback #chart-resizer {
  display: none !important;
}

/* ==========================================
   ANIMATED DEEPSEEK AI BADGE & GLOW EFFECTS
   ========================================== */

@keyframes ai-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4), 0 0 25px rgba(99, 102, 241, 0.25);
    border-color: rgba(168, 85, 247, 0.6);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.8), 0 0 40px rgba(6, 182, 212, 0.45);
    border-color: rgba(6, 182, 212, 0.9);
    transform: scale(1.02);
  }
}

@keyframes ai-shimmer-bg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ai-spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ai-logo-animated {
  animation: ai-glow-pulse 3s infinite ease-in-out;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-logo-animated:hover {
  transform: scale(1.05) translateY(-1px);
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.9), 0 0 50px rgba(6, 182, 212, 0.6);
}

.ai-gradient-text {
  background: linear-gradient(135deg, #e879f9, #818cf8, #38bdf8);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: ai-shimmer-bg 4s ease infinite;
}

.ai-spin-icon {
  animation: ai-spin-slow 12s linear infinite;
}
