/* ==========================================================================
   SHETKARI HELPLINE — MASTER APMC MANDI TICKER & AUDIO ENGINE (v11.0.0)
   Earth Brown Theme (#3b2314) | Rich Cream (#fffbeb) | Solid Financial Colors
   ========================================================================== */

:root {
  --sh-earth-brown: #3b2314;
  --sh-earth-brown-hover: #2a180c;
  --sh-cream-text: #fffbeb;
  --sh-cream-bg: #fdfbf7;
  --sh-solid-green: #00873c;
  --sh-solid-red: #d92525;
  --sh-ticker-speed: 30s;
}

/* Master Outer Container (Ensures 100% visibility in any Theme / Header) */
.shetkari-ticker-master-container {
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  align-items: stretch !important;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  border-bottom: 2px solid #cbd5e1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  position: relative !important;
  z-index: 99;
  font-family: 'Mukta', 'Noto Sans Devanagari', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  box-sizing: border-box;
}

.shetkari-ticker-master-container * {
  box-sizing: border-box;
}

/* 1. Left-Docked Earth Brown Action Header (Speaker + Dice Badge) */
.sh-left-dock-panel {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--sh-earth-brown);
  color: var(--sh-cream-text);
  padding: 6px 12px;
  flex-shrink: 0;
  z-index: 10;
  border-right: 2px solid #2a180c;
}

/* Rotating Dice / Live Badge */
.sh-live-dice-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 251, 235, 0.15);
  border: 1px solid rgba(255, 251, 235, 0.3);
  color: var(--sh-cream-text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.sh-dice-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e;
  animation: shPulseGlow 1.5s infinite ease-in-out;
}

@keyframes shPulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Earth Brown Speaker Button with Creamish Accents */
.sh-speaker-btn-earth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 251, 235, 0.12);
  color: var(--sh-cream-text);
  border: 1px solid rgba(255, 251, 235, 0.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.sh-speaker-btn-earth:hover,
.sh-speaker-btn-earth.is-speaking {
  background: #22c55e;
  border-color: #16a34a;
  color: #ffffff;
}

.sh-audio-wave {
  display: none;
  align-items: center;
  gap: 2px;
  height: 12px;
}

.sh-audio-wave.is-active {
  display: inline-flex;
}

.sh-audio-wave .sh-wave-bar {
  width: 2px;
  height: 100%;
  background: #ffffff;
  border-radius: 1px;
  animation: shWavePulse 0.8s infinite ease-in-out alternate;
}

.sh-audio-wave .sh-wave-bar:nth-child(2) { animation-delay: 0.2s; }
.sh-audio-wave .sh-wave-bar:nth-child(3) { animation-delay: 0.4s; }
.sh-audio-wave .sh-wave-bar:nth-child(4) { animation-delay: 0.6s; }

@keyframes shWavePulse {
  0% { height: 2px; }
  100% { height: 12px; }
}

/* 2. Compact Inline Cascading District & Taluka Filter */
.sh-inline-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #f8fafc;
  border-right: 1px solid #cbd5e1;
  flex-shrink: 0;
  z-index: 5;
}

.sh-filter-select {
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  max-width: 140px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sh-filter-select:focus {
  border-color: var(--sh-earth-brown);
}

/* 3. Scrolling Train Track */
.shetkari-ticker-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  background: #ffffff;
}

.shetkari-ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  width: max-content;
  will-change: transform;
}

.shetkari-ticker-track.animate-scroll {
  animation: stockdioScroll var(--sh-ticker-speed, 30s) linear infinite;
}

.shetkari-ticker-track.animate-scroll:hover {
  animation-play-state: paused;
}

@keyframes stockdioScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Status Direction Indicators */
.stockdio-trend-up {
  color: var(--sh-solid-green) !important;
  font-weight: 700;
}

.stockdio-trend-down {
  color: var(--sh-solid-red) !important;
  font-weight: 700;
}

/* 16 Layout Patterns (Optimized) */
.stockdio-layout-1 .stockdio-item { display: inline-flex; align-items: center; padding: 0 16px; border-right: 1px solid #cbd5e1; gap: 8px; }
.stockdio-layout-1 .mandi-name { font-size: 11px; font-weight: 700; color: #475569; background: #f1f5f9; padding: 2px 6px; border-radius: 3px; }
.stockdio-layout-1 .crop-name { font-size: 13px; font-weight: 700; color: #0f172a; }
.stockdio-layout-1 .modal-price { font-size: 14px; font-weight: 800; color: #0f172a; }

.stockdio-layout-2 .stockdio-item { display: inline-flex; align-items: center; padding: 0 14px; gap: 8px; }
.stockdio-layout-2 .crop-name { font-size: 13px; font-weight: 700; color: #0f172a; }
.stockdio-layout-2 .modal-price { font-size: 14px; font-weight: 800; color: #0f172a; }
.stockdio-layout-2 .badge-pill-up { background: var(--sh-solid-green); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 12px; }
.stockdio-layout-2 .badge-pill-down { background: var(--sh-solid-red); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 12px; }

.stockdio-layout-3 .stockdio-item { display: inline-flex; flex-direction: column; justify-content: center; padding: 4px 14px; margin: 0 4px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; min-width: 140px; }
.stockdio-layout-3 .item-row-top { display: flex; justify-content: space-between; gap: 6px; }
.stockdio-layout-3 .crop-name { font-size: 12px; font-weight: 700; color: #0f172a; }
.stockdio-layout-3 .mandi-name { font-size: 10px; font-weight: 600; color: #64748b; }
.stockdio-layout-3 .modal-price { font-size: 14px; font-weight: 800; color: #0f172a; }

.stockdio-layout-4 .stockdio-item { display: inline-flex; flex-direction: column; padding: 6px 12px; margin: 0 4px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; }
.stockdio-layout-4 .item-category { font-size: 10px; font-weight: 700; color: #64748b; }
.stockdio-layout-4 .item-main { display: flex; align-items: center; gap: 8px; }
.stockdio-layout-4 .crop-title { font-size: 13px; font-weight: 700; color: #0f172a; }
.stockdio-layout-4 .modal-price { font-size: 14px; font-weight: 800; color: #0f172a; }

.stockdio-layout-5 .stockdio-item { display: inline-flex; align-items: center; padding: 4px 12px; margin: 0 4px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; gap: 10px; }
.stockdio-layout-5 .data-col { display: flex; flex-direction: column; }
.stockdio-layout-5 .crop-name { font-size: 12px; font-weight: 700; color: #0f172a; }
.stockdio-layout-5 .modal-price { font-size: 14px; font-weight: 800; color: #0f172a; }
.stockdio-layout-5 .sparkline-svg { width: 50px; height: 20px; fill: none; stroke-width: 2; }
.stockdio-layout-5 .sparkline-up { stroke: var(--sh-solid-green); }
.stockdio-layout-5 .sparkline-down { stroke: var(--sh-solid-red); }

.stockdio-layout-6 .stockdio-item { display: inline-flex; align-items: center; padding: 6px 14px; margin: 0 4px; background: #fff; border: 1px solid #e2e8f0; border-radius: 4px; gap: 10px; }
.stockdio-layout-6 .gain-ribbon { border-left: 4px solid var(--sh-solid-green); }
.stockdio-layout-6 .loss-ribbon { border-left: 4px solid var(--sh-solid-red); }
.stockdio-layout-6 .crop-name { font-size: 13px; font-weight: 700; color: #0f172a; }
.stockdio-layout-6 .modal-price { font-size: 14px; font-weight: 800; }

.stockdio-layout-7 .stockdio-item { display: inline-flex; align-items: center; padding: 4px 14px; margin: 0 4px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px; gap: 12px; }
.stockdio-layout-7 .cell-field { display: flex; flex-direction: column; }
.stockdio-layout-7 .cell-label { font-size: 9px; font-weight: 700; color: #64748b; text-transform: uppercase; }
.stockdio-layout-7 .cell-value { font-size: 13px; font-weight: 700; color: #0f172a; }

.stockdio-layout-8 { background: #0f172a; color: #fff; }
.stockdio-layout-8 .stockdio-item { display: inline-flex; flex-direction: column; padding: 6px 14px; margin: 0 4px; background: #1e293b; border: 1px solid #334155; border-radius: 6px; min-width: 130px; }
.stockdio-layout-8 .crop-name { font-size: 13px; font-weight: 700; color: #f8fafc; }
.stockdio-layout-8 .mandi-name { font-size: 10px; color: #94a3b8; }
.stockdio-layout-8 .modal-price { font-size: 14px; font-weight: 800; color: #38bdf8; }

.stockdio-layout-9 .stockdio-item { display: inline-flex; flex-direction: column; padding: 6px 14px; margin: 0 4px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; min-width: 170px; }
.stockdio-layout-9 .header-row { display: flex; justify-content: space-between; align-items: center; }
.stockdio-layout-9 .crop-name { font-size: 12px; font-weight: 700; color: #0f172a; }
.stockdio-layout-9 .modal-price { font-size: 13px; font-weight: 800; color: #0284c7; }
.stockdio-layout-9 .range-track { width: 100%; height: 4px; background: #e2e8f0; border-radius: 2px; position: relative; margin: 3px 0; }
.stockdio-layout-9 .range-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--sh-solid-green); border-radius: 2px; }
.stockdio-layout-9 .range-marker { position: absolute; top: -3px; width: 10px; height: 10px; background: #0284c7; border: 2px solid #fff; border-radius: 50%; }
.stockdio-layout-9 .range-labels { display: flex; justify-content: space-between; font-size: 10px; color: #64748b; font-weight: 600; }

.stockdio-layout-10 .stockdio-item { display: inline-flex; align-items: center; padding: 4px 12px; margin: 0 4px; background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; gap: 8px; }
.stockdio-layout-10 .avatar-emblem { width: 28px; height: 28px; border-radius: 50%; background: #1e293b; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.stockdio-layout-10 .crop-title { font-size: 12px; font-weight: 700; color: #0f172a; }
.stockdio-layout-10 .modal-price { font-size: 13px; font-weight: 800; color: #0f172a; }

.stockdio-layout-11 .stockdio-item { display: inline-flex; align-items: center; padding: 6px 14px; margin: 0 4px; background: linear-gradient(135deg, #fff 0%, #f1f5f9 100%); border: 1px solid #e2e8f0; border-radius: 6px; gap: 12px; }
.stockdio-layout-11 .crop-name { font-size: 12px; font-weight: 700; color: #0f172a; }
.stockdio-layout-11 .modal-price { font-size: 14px; font-weight: 800; color: #0f172a; }

.stockdio-layout-12 .stockdio-item { display: inline-flex; align-items: stretch; margin: 0 4px; border: 1px solid #cbd5e1; border-radius: 4px; overflow: hidden; }
.stockdio-layout-12 .pane-left { background: #f8fafc; padding: 4px 10px; display: flex; flex-direction: column; justify-content: center; }
.stockdio-layout-12 .crop-name { font-size: 12px; font-weight: 700; color: #0f172a; }
.stockdio-layout-12 .pane-right { padding: 4px 10px; display: flex; flex-direction: column; justify-content: center; color: #fff; }
.stockdio-layout-12 .bg-gain { background: var(--sh-solid-green); }
.stockdio-layout-12 .bg-loss { background: var(--sh-solid-red); }

.stockdio-layout-13 .stockdio-item { display: inline-flex; align-items: center; padding: 6px 14px; margin: 0 4px; background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(203, 213, 225, 0.8); border-radius: 8px; gap: 10px; }
.stockdio-layout-13 .crop-name { font-size: 13px; font-weight: 700; color: #0f172a; }
.stockdio-layout-13 .modal-price { font-size: 14px; font-weight: 800; color: var(--sh-solid-green); }

.stockdio-layout-14 .static-prefix-header { background: #0f172a; color: #fff; font-size: 12px; font-weight: 800; padding: 10px 16px; flex-shrink: 0; z-index: 2; }
.stockdio-layout-14 .stockdio-item { display: inline-flex; align-items: center; padding: 0 16px; border-right: 1px solid #e2e8f0; gap: 8px; }
.stockdio-layout-14 .crop-name { font-size: 13px; font-weight: 700; color: #0f172a; }
.stockdio-layout-14 .modal-price { font-size: 14px; font-weight: 800; color: #0f172a; }

.stockdio-layout-15 .stockdio-item { display: inline-flex; flex-direction: column; padding: 6px 14px; margin: 0 4px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; min-width: 150px; }
.stockdio-layout-15 .crop-name { font-size: 12px; font-weight: 700; color: #0f172a; }
.stockdio-layout-15 .primary-price { font-size: 15px; font-weight: 800; color: #0f172a; }

.stockdio-layout-16 .stockdio-item { display: inline-flex; flex-direction: column; padding: 4px 14px; margin: 0 4px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px; min-width: 140px; }

/* Responsive Adjustments */
@media (max-width: 768px) {
  .sh-inline-filter-group {
    display: none !important; /* Hide bulky filters inside scrolling bar on small mobiles */
  }
  .sh-left-dock-panel {
    padding: 4px 8px;
  }
  .sh-speaker-btn-text {
    display: none; /* Icon only on mobile */
  }
}
