/* Modern FinSense AI Styles */
* {
  box-sizing: border-box;
}

/* Glass morphism and modern components */
.glass-card {
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(99, 102, 241, 0.3);
}

.glass-button {
  background: rgba(75, 85, 99, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 8px;
  padding: 8px;
  color: #9CA3AF;
  transition: all 0.2s ease;
}

.glass-button:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  color: #E5E7EB;
}

/* Status indicators */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid rgba(75, 85, 99, 0.2);
}

.status-indicator.connected .w-2 {
  background-color: #10B981 !important;
  animation: pulse 2s infinite;
}

/* Modern ticker */
.ticker-container {
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(75, 85, 99, 0.2);
  border-radius: 12px;
  overflow: hidden;
  padding: 16px 0;
  margin-top: 24px;
}

.ticker-track {
  display: flex;
  animation: scroll 30s linear infinite;
  gap: 32px;
  white-space: nowrap;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(31, 41, 55, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(75, 85, 99, 0.2);
  min-width: 200px;
  transition: all 0.3s ease;
}

.ticker-item:hover {
  transform: scale(1.05);
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.ticker-symbol {
  font-weight: 600;
  font-size: 14px;
  color: #E5E7EB;
}

.ticker-price {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: #F3F4F6;
}

.ticker-change {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
}

.ticker-positive {
  color: #10B981;
  background: rgba(16, 185, 129, 0.1);
}

.ticker-negative {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Stats cards */
.stat-card {
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(75, 85, 99, 0.2);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-label {
  font-size: 12px;
  color: #9CA3AF;
  margin-bottom: 4px;
  font-weight: 500;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #F3F4F6;
}

/* Card headers */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0 24px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #F3F4F6;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
}

/* Enhanced Chat Interface */
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  color: #93C5FD;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-action-btn:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(99, 102, 241, 0.2));
  border-color: rgba(59, 130, 246, 0.5);
  color: #DBEAFE;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.chat-form {
  margin-bottom: 20px;
  position: relative;
}

.chat-form.focused {
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

.chat-input {
  width: 100%;
  background: rgba(31, 41, 55, 0.8);
  border: 2px solid rgba(75, 85, 99, 0.4);
  border-radius: 16px;
  padding: 16px 56px 16px 20px;
  color: #F3F4F6;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  resize: none;
  min-height: 52px;
  line-height: 1.4;
}

.chat-input:focus {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 8px 24px rgba(0, 0, 0, 0.2);
  background: rgba(31, 41, 55, 0.9);
}

.chat-input::placeholder {
  color: #9CA3AF;
  font-weight: 400;
}

.chat-send-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  border: none;
  border-radius: 12px;
  padding: 12px;
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.chat-send-btn:hover {
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.chat-send-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 400px; /* Match live-feed height */
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
  margin-bottom: 16px;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(31, 41, 55, 0.3);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.6);
}

.chat-message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: slideIn 0.3s ease-out;
}

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

.chat-message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-message.assistant .message-avatar {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.2));
  color: #C7D2FE;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.chat-message.user .message-avatar {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(34, 197, 94, 0.2));
  color: #86EFAC;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.message-content {
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 16px;
  padding: 16px 20px;
  max-width: 75%;
  font-size: 14px;
  line-height: 1.6;
  color: #F3F4F6;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
}

.message-content::before {
  content: '';
  position: absolute;
  top: 16px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.chat-message.assistant .message-content::before {
  left: -16px;
  border-right-color: rgba(31, 41, 55, 0.8);
}

.chat-message.user .message-content {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border-color: rgba(99, 102, 241, 0.3);
  color: #E0E7FF;
}

.chat-message.user .message-content::before {
  right: -16px;
  border-left-color: rgba(99, 102, 241, 0.15);
}

/* Enhanced Chat Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 16px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.typing-indicator.show {
  opacity: 1;
  transform: translateY(0);
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #6366F1;
  border-radius: 50%;
  animation: typing 1.4s infinite both;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: scale(1);
    opacity: 0.4;
  }
  30% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Chat Error State */
.chat-error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  color: #FCA5A5;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Enhanced Chat Formatting */
.message-content .section-header {
  margin: 16px 0 8px 0;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border-left: 3px solid #6366F1;
  border-radius: 6px;
  font-size: 15px;
}

.message-content .section-header .emoji {
  font-size: 16px;
  margin-right: 8px;
}

.message-content .section-header strong {
  color: #C7D2FE;
  font-weight: 600;
}

.message-content .bullet-point {
  color: #60A5FA;
  font-weight: bold;
  margin-right: 8px;
}

.message-content .check-mark {
  color: #34D399;
  font-weight: bold;
  margin-right: 8px;
}

.message-content .cross-mark {
  color: #F87171;
  font-weight: bold;
  margin-right: 8px;
}

.message-content .status-indicator {
  font-size: 14px;
  margin-right: 6px;
}

.message-content p {
  margin: 8px 0;
  line-height: 1.6;
}

.message-content p:first-child {
  margin-top: 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

/* Chat Welcome Message Enhancement */
.chat-welcome {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.chat-welcome h3 {
  color: #C7D2FE;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.chat-welcome p {
  color: #9CA3AF;
  font-size: 14px;
  line-height: 1.5;
}

/* Symbol selector enhancement */
.symbol-selector {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 8px;
  padding: 6px 12px;
  color: #E5E7EB;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.symbol-selector:focus {
  border-color: rgba(99, 102, 241, 0.5);
}

/* Feed controls */
.feed-controls {
  display: flex;
  gap: 8px;
}

.feed-filter {
  padding: 6px 12px;
  background: rgba(31, 41, 55, 0.4);
  border: 1px solid rgba(75, 85, 99, 0.2);
  border-radius: 6px;
  color: #9CA3AF;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.feed-filter.active,
.feed-filter:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.3);
  color: #C7D2FE;
}

/* Live feed */
.live-feed {
  max-height: 400px;
  overflow-y: auto;
}

.feed-item {
  background: rgba(31, 41, 55, 0.4);
  border: 1px solid rgba(75, 85, 99, 0.2);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  animation: slideIn 0.3s ease-out;
}

.feed-item:hover {
  background: rgba(31, 41, 55, 0.6);
  border-color: rgba(75, 85, 99, 0.4);
}

.feed-item.price {
  border-left: 3px solid #10B981;
}

.feed-item.news {
  border-left: 3px solid #3B82F6;
}

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

/* Upload zone */
.upload-zone {
  border: 2px dashed rgba(75, 85, 99, 0.3);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  transition: all 0.3s ease;
}

.upload-zone:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.05);
}

.upload-btn {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 8px 16px;
  color: #C7D2FE;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.upload-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #E0E7FF;
}

.demo-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 8px 16px;
  color: #FCD34D;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
}

.demo-btn:hover {
  background: rgba(245, 158, 11, 0.3);
  color: #FEF3C7;
}

/* Alert badge */
.alert-badge {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 4px 8px;
  color: #FCA5A5;
  font-size: 12px;
  font-weight: 600;
}

/* Alerts list */
.alerts-list {
  max-height: 300px;
  overflow-y: auto;
}

.empty-state {
  text-align: center;
  padding: 32px;
  color: #6B7280;
}

.alert-item {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  animation: slideIn 0.3s ease-out;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(31, 41, 55, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.7);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ticker-container {
    margin: 16px -24px 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .glass-card {
    border-radius: 12px;
  }
  
  .card-header {
    padding: 20px 20px 0 20px;
  }
}

/* Loading states */
.loading-skeleton {
  background: linear-gradient(90deg, rgba(75, 85, 99, 0.1) 0%, rgba(75, 85, 99, 0.2) 50%, rgba(75, 85, 99, 0.1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Payment Guard & Behavior Watchdog Styles */
.stat-item {
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid rgba(75, 85, 99, 0.2);
  border-radius: 8px;
  padding: 12px;
  transition: all 0.2s ease;
}

.stat-item:hover {
  background: rgba(31, 41, 55, 0.7);
  border-color: rgba(99, 102, 241, 0.3);
}

.payment-monitor, .behavior-monitor {
  background: rgba(31, 41, 55, 0.3);
  border: 1px solid rgba(75, 85, 99, 0.2);
  border-radius: 8px;
  padding: 12px;
}

.payment-feed, .customer-baselines {
  max-height: 120px;
  overflow-y: auto;
}

.payment-item, .customer-baseline {
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid rgba(75, 85, 99, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

.payment-item:hover, .customer-baseline:hover {
  background: rgba(17, 24, 39, 0.7);
  border-color: rgba(99, 102, 241, 0.3);
}

.payment-item.fraud {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
}

.payment-item.sanctions {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
}

/* Small circular status dot (renamed to avoid conflict with flex container version at top) */
.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.demo-btn {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #E5E7EB;
  padding: 8px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  justify-content: center;
}

.demo-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: #6B7280;
}

/* Trading specific styles */
.feed-item.trade {
  background: rgba(139, 92, 246, 0.1);
  border-left: 3px solid #8B5CF6;
}

.trade-action-btn {
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.trade-action-btn:focus {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.portfolio-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(75, 85, 99, 0.2);
}

.portfolio-item:last-child {
  border-bottom: none;
}

.portfolio-symbol {
  font-weight: 600;
  color: #E5E7EB;
  font-size: 14px;
}

.portfolio-quantity {
  color: #9CA3AF;
  font-size: 12px;
}

.portfolio-value {
  text-align: right;
}

.portfolio-price {
  font-weight: 600;
  color: #E5E7EB;
  font-size: 14px;
}

.portfolio-percentage {
  color: #9CA3AF;
  font-size: 12px;
}

.market-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.market-symbol {
  font-weight: 500;
  color: #E5E7EB;
  font-size: 14px;
}

.market-price {
  font-weight: 600;
  color: #E5E7EB;
  font-size: 14px;
}

.market-change {
  font-size: 12px;
}

.trade-form input:focus,
.trade-form select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.trade-summary {
  background: rgba(31, 41, 55, 0.7);
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 8px;
  padding: 16px;
}

.execute-trade-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.execute-trade-btn:disabled:hover {
  transform: none;
}

/* Trade confirmation animations */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out;
}

/* Better trade form styling */
.trade-form {
  background: rgba(31, 41, 55, 0.7);
  border-radius: 8px;
}

.trade-button-group {
  display: flex;
  gap: 8px;
}

.trade-action-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.trade-action-btn:hover {
  transform: translateY(-1px);
}

.trade-action-btn:active {
  transform: translateY(0);
}
