/* Chart Container Styles */
.chart-container {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.chart-container h5 {
  margin: 0 0 8px 0;
}

.chart-container canvas {
  display: block;
  width: 100% !important;
}

/* ====== AI Summary Chat Styles ====== */
.ai-summary-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0;
}

.ai-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.ai-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #8b5cf6;
  background: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.ai-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: #22c55e;
  border: 2px solid white;
  border-radius: 50%;
}

.ai-chat-bubble {
  position: relative;
  background: #ffffff;
  border-radius: 0 16px 16px 16px;
  padding: 14px 18px;
  flex-grow: 1;
  max-width: calc(100% - 120px);
  z-index: 1;
  cursor: pointer;
  overflow: hidden;
  /* Simple purple border with glow */
  border: 2px solid #8b5cf6;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
  transition: box-shadow 0.3s ease;
}

.ai-chat-bubble:hover {
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.5);
}

/* Chat bubble arrow */
.ai-chat-bubble::before {
  content: '';
  position: absolute;
  top: 15px;
  left: -10px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid #8b5cf6;
}

.ai-chat-bubble::after {
  content: '';
  position: absolute;
  top: 17px;
  left: -6px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid #ffffff;
}

/* Chat bubble arrow/pointer */
.ai-chat-bubble .ai-header::before {
  content: '';
  position: absolute;
  top: 12px;
  left: -6px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid #a78bfa;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ai-name {
  font-weight: 600;
  color: #6d28d9;
  font-size: 0.8rem;
}

.ai-role {
  font-size: 0.7rem;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.1);
  padding: 2px 6px;
  border-radius: 8px;
}

.ai-content-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #374151;
}

.typing-cursor::after {
  content: '|';
  animation: blink 1s step-start infinite;
  color: #8b5cf6;
  font-weight: 300;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.btn-read-more {
  display: block;
  margin-top: 10px;
  color: #8b5cf6;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-read-more:hover {
  color: #6d28d9;
  text-decoration: underline;
}

/* Tooltip Fix */
.tooltip-inner {
  color: #fff !important;
  background-color: #000 !important;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: #000 !important;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
  border-bottom-color: #000 !important;
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
  border-left-color: #000 !important;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
  border-right-color: #000 !important;
}

/* opportunity-card restructuring */
.opportunity-grid {
    margin-top: 1rem;
}

.opportunity-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    height: 100%;
    transition: all 0.3s ease-index;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.opportunity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(124, 58, 237, 0.15);
    border-color: #8b5cf6;
}

.opp-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.75rem;
}

.opp-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.opp-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1e293b;
    line-height: 1.2;
}

.opp-tickers-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.opp-ticker-badge {
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.opp-ticker-badge:hover {
    background: #f5f3ff;
    border-color: #8b5cf6;
    color: #7c3aed;
    transform: scale(1.05);
}

/* Strategy Specific Colors */
.opp-pullback .opp-icon-box { background: #f5f3ff; color: #8b5cf6; }
.opp-shark .opp-icon-box { background: #fffbeb; color: #d97706; }
.opp-bottom .opp-icon-box { background: #f0fdf4; color: #16a34a; }
.opp-breakout .opp-icon-box { background: #fef2f2; color: #dc2626; }

.blurred-ticker {
    filter: blur(2px);
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
    user-select: none;
    background: #f1f5f9;
}
/* Searchable CTCK Dropdown Styles */
.ctck-firm-filter-container .dropdown-menu {
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ctck-firm-filter-container .firm-item {
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    margin: 2px 0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ctck-firm-filter-container .firm-item:hover {
    background-color: #f3f4f6;
    color: #6d28d9;
    padding-left: 16px;
}

.ctck-firm-filter-container .firm-item.active {
    background-color: #ede9fe;
    color: #6d28d9;
    font-weight: 600;
}

.ctck-firm-filter-container .firm-search-input {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    font-size: 0.75rem;
}

.ctck-firm-filter-container .firm-search-input:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}

.ctck-firm-filter-container .firm-list-scroll::-webkit-scrollbar {
    width: 6px;
}

.ctck-firm-filter-container .firm-list-scroll::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 10px;
}

.ctck-firm-filter-container .firm-list-scroll::-webkit-scrollbar-track {
    background-color: transparent;
}

/* Performance Badge Prominent */
.perf-badge-prominent {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.perf-badge-prominent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.perf-badge-prominent.text-success {
    background-color: #f0fdf4;
    color: #16a34a !important;
    border-color: #bbf7d0;
}

.perf-badge-prominent.text-danger {
    background-color: #fef2f2;
    color: #dc2626 !important;
    border-color: #fecaca;
}

.perf-badge-prominent i {
    font-size: 0.9rem;
}

/* ===== DARK MODE OVERRIDES ===== */

/* AI Chat Bubble */
.dark .ai-chat-bubble {
    background: #1e293b !important; /* slate-800 */
    border-color: #8b5cf6 !important;
}

.dark .ai-chat-bubble::after {
    border-right-color: #1e293b !important;
}

.dark .ai-content-text {
    color: #cbd5e1 !important; /* slate-300 */
}

.dark .ai-name {
    color: #a78bfa !important;
}

/* Opportunity Cards */
.dark .opportunity-card {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

.dark .opp-card-header {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

.dark .opp-title {
    color: #f1f5f9 !important;
}

.dark .opp-ticker-badge {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}

.dark .opp-ticker-badge:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
    color: #93c5fd !important;
}

/* Strategy specific icon boxes */
.dark .opp-pullback .opp-icon-box { background: rgba(59, 130, 246, 0.12); color: #93c5fd; }
.dark .opp-shark .opp-icon-box { background: rgba(217, 119, 6, 0.12); color: #fcd34d; }
.dark .opp-bottom .opp-icon-box { background: rgba(22, 163, 74, 0.12); color: #86efac; }
.dark .opp-breakout .opp-icon-box { background: rgba(220, 38, 38, 0.12); color: #fca5a5; }

/* Blurred tickers */
.dark .blurred-ticker {
    background: rgba(255, 255, 255, 0.04) !important;
}

/* CTCK Dropdown */
.dark .ctck-firm-filter-container .dropdown-menu {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.dark .ctck-firm-filter-container .firm-item:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #a78bfa !important;
}

.dark .ctck-firm-filter-container .firm-item.active {
    background-color: rgba(109, 40, 217, 0.2) !important;
    color: #a78bfa !important;
}

.dark .ctck-firm-filter-container .firm-search-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

/* Performance badges */
.dark .perf-badge-prominent.text-success {
    background-color: rgba(22, 163, 74, 0.12) !important;
    color: #4ade80 !important;
    border-color: rgba(74, 222, 128, 0.2) !important;
}

.dark .perf-badge-prominent.text-danger {
    background-color: rgba(220, 38, 38, 0.12) !important;
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.2) !important;
}

/* Nav Pills (Tabs) */
.dark .nav-pills .nav-link {
    color: #94a3b8 !important;
}

.dark .nav-pills .nav-link:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f1f5f9 !important;
}

.dark .nav-pills .nav-link.active {
    background: #7c3aed !important;
    color: white !important;
}

/* Modal (Strategy Preview) */
.dark #modalStrategyPreview .modal-content,
.dark #summaryModal .modal-content {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}

.dark #modalStrategyPreview .modal-header,
.dark #summaryModal .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.dark #modalStrategyPreview .modal-title,
.dark #summaryModal .modal-title {
    color: #f1f5f9 !important;
}

.dark #modalStrategyPreview .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

.dark #modalStrategyPreview .btn-close,
.dark #summaryModal .btn-close {
    filter: invert(1);
}
