/**
 * TradingView-Style Stock Chart Widget Styles
 *
 * Dark navy gradient theme matching BWO Webflow design.
 * Uses the TradingView color palette for consistency.
 */

/* ============================================================================
   Widget Container
   ============================================================================ */

.tv-widget {
  background: transparent;
  border-radius: 12px;
  padding: 20px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #DBDBDB;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.tv-widget *,
.tv-widget *::before,
.tv-widget *::after {
  box-sizing: border-box;
}

/* ============================================================================
   Header Section
   ============================================================================ */

.tv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.tv-company {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tv-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2a3f5f 0%, #1e2d45 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tv-logo-text {
  font-size: 18px;
  font-weight: 600;
  color: #DBDBDB;
}

.tv-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.tv-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tv-name {
  font-size: 16px;
  font-weight: 600;
  color: #DBDBDB;
  line-height: 1.3;
}

.tv-ticker-label {
  font-size: 12px;
  color: #6A6D78;
}

.tv-ticker {
  color: #8B8D97;
}

/* Price Section */
.tv-price-section {
  text-align: right;
  min-width: 120px;
}

.tv-price-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
}

.tv-current {
  font-size: 24px;
  font-weight: 600;
  color: #DBDBDB;
  line-height: 1.2;
}

.tv-currency {
  font-size: 12px;
  color: #6A6D78;
}

/* Live Update Indicator */
.tv-live-indicator {
  display: none;
  width: 8px;
  height: 8px;
  background: #22ab94;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  animation: tv-pulse 2s ease-in-out infinite;
}

.tv-live-indicator.pulse {
  animation: tv-flash 0.5s ease-out;
}

@keyframes tv-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes tv-flash {
  0% { transform: scale(1.5); opacity: 1; }
  100% { transform: scale(1); opacity: 0.6; }
}

.tv-change-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.tv-change {
  font-size: 13px;
  font-weight: 500;
}

.tv-change.positive {
  color: #22ab94;
}

.tv-change.negative {
  color: #f7525f;
}

.tv-change.error {
  color: #6A6D78;
}

.tv-period {
  font-size: 12px;
  color: #6A6D78;
}

/* ============================================================================
   Time Range Buttons
   ============================================================================ */

.tv-ranges {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tv-range-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #6A6D78;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s ease;
}

.tv-range-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: #8B8D97;
}

.tv-range-btn.active {
  background: linear-gradient(135deg, #2a3f5f 0%, #1e2d45 100%);
  border-color: rgba(255, 255, 255, 0.15);
  color: #DBDBDB;
}

/* ============================================================================
   Chart Container
   ============================================================================ */

.tv-chart-container {
  position: relative;
  height: 300px;
  margin: 0 -8px;
  overflow: hidden;
}

.tv-chart {
  width: 100%;
  height: 100%;
}

/* Loading Spinner */
.tv-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 22, 41, 0.8);
  z-index: 10;
}

.tv-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: tv-spin 0.8s linear infinite;
}

@keyframes tv-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   Responsive Adjustments
   ============================================================================ */

@media (max-width: 480px) {
  .tv-widget {
    padding: 16px;
  }

  .tv-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tv-price-section {
    text-align: left;
  }

  .tv-price-row {
    justify-content: flex-start;
  }

  .tv-change-row {
    justify-content: flex-start;
  }

  .tv-current {
    font-size: 20px;
  }

  .tv-name {
    font-size: 14px;
  }

  .tv-logo {
    width: 36px;
    height: 36px;
  }

  .tv-ranges {
    gap: 4px;
  }

  .tv-range-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .tv-chart-container {
    height: 250px;
  }
}

/* ============================================================================
   Dark Theme Override (for pages with light background)
   ============================================================================ */

.tv-widget--light {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.tv-widget--light .tv-name,
.tv-widget--light .tv-current {
  color: #1f2937;
}

.tv-widget--light .tv-ticker-label,
.tv-widget--light .tv-currency,
.tv-widget--light .tv-period {
  color: #6b7280;
}

.tv-widget--light .tv-logo {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

.tv-widget--light .tv-range-btn {
  border-color: #e5e7eb;
  color: #6b7280;
}

.tv-widget--light .tv-range-btn:hover {
  background: #f3f4f6;
}

.tv-widget--light .tv-range-btn.active {
  background: #1f2937;
  color: #ffffff;
}

/* ============================================================================
   Press Release Tooltip
   ============================================================================ */

.tv-press-tooltip {
  position: absolute;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 16px;
  max-width: 280px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  pointer-events: auto;

  /* Smooth animations */
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.tv-press-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.tv-tooltip-header {
  font-size: 14px;
  font-weight: 600;
  color: #DBDBDB;
  margin-bottom: 4px;
  line-height: 1.3;
}

.tv-tooltip-date {
  font-size: 12px;
  color: #6A6D78;
  margin-bottom: 8px;
}

.tv-tooltip-link {
  font-size: 12px;
  color: #3b82f6;
  text-decoration: none;
  display: inline-block;
  transition: color 0.15s ease;
}

.tv-tooltip-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* Light theme tooltip */
.tv-widget--light .tv-press-tooltip {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.tv-widget--light .tv-tooltip-header {
  color: #1f2937;
}

.tv-widget--light .tv-tooltip-date {
  color: #6b7280;
}

/* ============================================================================
   Press Release Timeline Strip - REMOVED
   ============================================================================ */

/* Timeline feature removed to simplify chart widget */
