/* KKC Market Intelligence Hub™ — Stylesheet v1.0
   CSS namespace: .kkc-mih-*
   Inherits design tokens from .hp2-page (Style-2 Premium Theme).
   Provider: TradingView Ticker Tape | Architecture: Plugin Runtime v1.0
*/

/* ===================================================================
   SECTION WRAPPER
   =================================================================== */

.kkc-mih-section {
  padding: 56px 0 64px;
  background: var(--hp2-bg, #ffffff);
  border-top: 1px solid var(--hp2-border, #E5E7EB);
}

/* ===================================================================
   HUB HEADER — eyebrow label + live indicator row
   =================================================================== */

.kkc-mih-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.kkc-mih-hub-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.kkc-mih-hub-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hp2-heading, #0F172A);
}

.kkc-mih-hub-desc {
  font-size: 0.75rem;
  color: var(--hp2-body, #64748B);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ===================================================================
   LIVE INDICATOR DOT
   =================================================================== */

.kkc-mih-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16A34A;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: kkc-mih-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes kkc-mih-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  60%  { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ===================================================================
   TICKER CONTAINER — the premium card that wraps TradingView
   =================================================================== */

.kkc-mih-ticker-container {
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid var(--hp2-border, #E5E7EB);
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.07), 0 1px 6px rgba(0, 0, 0, 0.06);
  background: #ffffff;
  min-height: 70px;
  position: relative;
  transition: box-shadow 250ms ease-in-out;
}

.kkc-mih-ticker-container:hover {
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ===================================================================
   TRADINGVIEW WIDGET WRAPPER (rendered by plugin)
   =================================================================== */

.kkc-mih-ticker-wrap {
  display: block;
  width: 100%;
}

.kkc-mih-ticker-wrap .tradingview-widget-container {
  width: 100%;
  display: block;
  line-height: 0;
  font-size: 0;
}

.kkc-mih-ticker-wrap .tradingview-widget-container__widget {
  min-height: 68px;
  display: block;
  line-height: 0;
  font-size: 0;
}

/* Force iframe to block — removes the inline descender gap that
   causes a phantom border line at the bottom of the ticker card */
.kkc-mih-ticker-wrap iframe {
  display: block;
}

/* ===================================================================
   SKELETON LOADER (shown while plugin initialises)
   =================================================================== */

.kkc-mih-loading {
  padding: 16px 20px;
  display: flex;
  align-items: center;
}

.kkc-mih-skeleton-bar {
  height: 38px;
  border-radius: 10px;
  width: 100%;
  background: linear-gradient(
    90deg,
    #f1f1f1 0%,
    #e4e4e4 40%,
    #f1f1f1 80%
  );
  background-size: 300% 100%;
  animation: kkc-mih-shimmer 1.6s ease-in-out infinite;
}

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

/* ===================================================================
   POWERED BY ATTRIBUTION ROW
   =================================================================== */

.kkc-mih-attribution {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 14px 0;
}

.kkc-mih-attribution-text {
  font-size: 0.68rem;
  color: var(--hp2-body, #64748B);
  font-weight: 500;
  opacity: 0.7;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */

@media (max-width: 1024px) {
  .kkc-mih-section {
    padding: 48px 0 56px;
  }
}

@media (max-width: 768px) {
  .kkc-mih-section {
    padding: 40px 0 48px;
  }

  .kkc-mih-ticker-container {
    border-radius: 14px;
  }

  .kkc-mih-hub-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .kkc-mih-section {
    padding: 32px 0 40px;
  }

  .kkc-mih-ticker-container {
    border-radius: 10px;
  }
}

/* ===================================================================
   REDUCED MOTION
   =================================================================== */

@media (prefers-reduced-motion: reduce) {
  .kkc-mih-skeleton-bar,
  .kkc-mih-live-dot {
    animation: none;
  }

  .kkc-mih-ticker-container {
    transition: none;
  }
}

/* ===================================================================
   STYLE-1 DARK THEME OVERRIDES (index.html — body has no .hp2-page)
   =================================================================== */

body:not(.hp2-page) .kkc-mih-section {
  background: var(--bg-alt, #151515);
  border-top: 1px solid var(--border, rgba(212, 175, 55, 0.25));
}

body:not(.hp2-page) .kkc-mih-hub-title {
  color: var(--text, #ffffff);
}

body:not(.hp2-page) .kkc-mih-hub-desc {
  color: var(--text-soft, #94a3b8);
}

/* Gold pulsing dot for dark theme */
body:not(.hp2-page) .kkc-mih-live-dot {
  background: var(--gold, #D4AF37);
  animation: kkc-mih-pulse-gold 2s ease-in-out infinite;
}

@keyframes kkc-mih-pulse-gold {
  0%   { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.55); }
  60%  { box-shadow: 0 0 0 6px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

body:not(.hp2-page) .kkc-mih-ticker-container {
  background: var(--surface, #15110a);
  border: 1.5px solid var(--border, rgba(212, 175, 55, 0.25));
  box-shadow: 0 4px 24px rgba(212, 175, 55, 0.06), 0 1px 6px rgba(0, 0, 0, 0.4);
}

body:not(.hp2-page) .kkc-mih-ticker-container:hover {
  box-shadow: 0 8px 32px rgba(212, 175, 55, 0.14), 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Dark skeleton shimmer */
body:not(.hp2-page) .kkc-mih-skeleton-bar {
  background: linear-gradient(
    90deg,
    #1c1c1c 0%,
    #2a2a2a 40%,
    #1c1c1c 80%
  );
  background-size: 300% 100%;
}

@media (prefers-reduced-motion: reduce) {
  body:not(.hp2-page) .kkc-mih-live-dot {
    animation: none;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.4);
  }
}
