/* Animation Bot Styles - OneRupeeTraders Trading Bot */

/* Bot Container */
.bot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Bot Character */
.bot-character {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #00d4aa, #0099ff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,212,170,0.4);
  transition: transform 0.2s;
  user-select: none;
}
.bot-character:hover { transform: scale(1.05); }
.bot-character:active { transform: scale(0.95); }

/* Bot Face */
.bot-face {
  font-size: 2rem;
  animation: bot-idle 3s ease-in-out infinite;
}
@keyframes bot-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Bot Glow Rings */
.bot-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(0,212,170,0.3);
  animation: ring-expand 2s ease-out infinite;
}
.bot-ring:nth-child(1) { width: 80px; height: 80px; animation-delay: 0s; }
.bot-ring:nth-child(2) { width: 95px; height: 95px; animation-delay: 0.5s; }
@keyframes ring-expand {
  0% { opacity: 0.8; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.3); }
}

/* Notification Bubble */
.bot-notification {
  background: #1a1f2e;
  border: 1px solid #21273a;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  max-width: 320px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: notification-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}
@keyframes notification-in {
  from { opacity: 0; transform: scale(0.6) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.bot-notification.slide-out {
  animation: notification-out 0.3s ease-in forwards;
}
@keyframes notification-out {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to { opacity: 0; transform: scale(0.8) translateY(10px); }
}

/* Notification types */
.bot-notification.type-ORDER_EXECUTED {
  border-color: rgba(0,212,170,0.5);
  background: linear-gradient(135deg, #0d1117, #0f1f1a);
}
.bot-notification.type-TRADE_CLOSED.profit {
  border-color: rgba(0,212,170,0.6);
  background: linear-gradient(135deg, #0d1117, #0e1e15);
}
.bot-notification.type-TRADE_CLOSED.loss {
  border-color: rgba(248,81,73,0.5);
  background: linear-gradient(135deg, #0d1117, #1e0e0e);
}
.bot-notification.type-SIGNAL {
  border-color: rgba(56,139,253,0.5);
  background: linear-gradient(135deg, #0d1117, #0e1220);
}
.bot-notification.type-SL_UPDATE {
  border-color: rgba(227,179,65,0.4);
  background: linear-gradient(135deg, #0d1117, #1c1805);
}

/* Notification Header */
.notif-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.notif-icon { font-size: 1.4rem; }
.notif-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e6edf3;
  flex: 1;
}
.notif-close {
  background: none;
  border: none;
  color: #7d8590;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  line-height: 1;
}
.notif-close:hover { background: rgba(255,255,255,0.1); color: #e6edf3; }

/* Notification Body */
.notif-body {
  font-size: 0.82rem;
  color: #7d8590;
  line-height: 1.5;
}

/* P&L Amount */
.notif-pnl {
  font-size: 1.3rem;
  font-weight: 800;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.notif-pnl.profit { color: #00d4aa; }
.notif-pnl.loss { color: #f85149; }

/* Confetti for profit */
.confetti-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -10px;
  border-radius: 2px;
  animation: confetti-fall var(--fall-dur) var(--fall-delay) linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Crying animation for loss */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-3deg); }
  40% { transform: translateX(5px) rotate(3deg); }
  60% { transform: translateX(-3px) rotate(-2deg); }
  80% { transform: translateX(3px) rotate(2deg); }
}

/* Signal pulse for new signals */
@keyframes signal-pulse {
  0% { box-shadow: 0 0 0 0 rgba(56,139,253,0.7); }
  70% { box-shadow: 0 0 0 12px rgba(56,139,253,0); }
  100% { box-shadow: 0 0 0 0 rgba(56,139,253,0); }
}
.bot-notification.type-SIGNAL { animation: notification-in 0.4s cubic-bezier(0.34,1.56,0.64,1), signal-pulse 1s 0.5s; }

/* Bot Emotion States */
.bot-character.emotion-happy .bot-face::after { content: '✨'; position: absolute; font-size: 0.8rem; top: -5px; right: -5px; }
.bot-character.emotion-excited { animation: bot-excited 0.5s ease-in-out 3; }
@keyframes bot-excited {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(-10deg); }
  75% { transform: scale(1.1) rotate(10deg); }
}
.bot-character.emotion-sad { animation: bot-sad 1s ease-in-out; }
@keyframes bot-sad {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
.bot-character.emotion-celebrating { animation: bot-celebrate 0.3s ease-in-out 5; }
@keyframes bot-celebrate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(5deg); }
}
.bot-character.emotion-thinking .bot-face { animation: thinking-blink 2s infinite; }
@keyframes thinking-blink {
  0%, 90%, 100% { opacity: 1; }
  95% { opacity: 0.5; }
}
.bot-character.emotion-alert { animation: alert-bounce 0.4s ease-in-out 3; }
@keyframes alert-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Notification Queue (multiple stacked) */
.bot-notifications-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

/* Order Details Grid */
.order-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(33,39,58,0.6);
}
.order-detail-item { font-size: 0.75rem; }
.order-detail-label { color: #7d8590; display: block; }
.order-detail-value { color: #e6edf3; font-weight: 600; }

/* Progress bar (for SL distance) */
.sl-progress {
  height: 3px;
  background: rgba(33,39,58,0.8);
  border-radius: 2px;
  margin-top: 0.6rem;
  overflow: hidden;
}
.sl-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #00d4aa, #e3b341);
  transition: width 0.5s ease;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .bot-container { bottom: 16px; right: 16px; }
  .bot-notification { max-width: 280px; }
}
