:root {
  --card-bg: #ffffff;
  --card-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  --accent-color: #f39c12;
  --border-color: #e6edf5;
  --market-text: #172033;
  --market-muted: #687385;
  --market-soft: #f7f9fc;
  --market-danger: #e74c3c;
}

body.dark-mode {
  --card-bg: #2c2c2c;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.18);
  --border-color: #444;
  --market-text: #f3f6fb;
  --market-muted: #b9c0cc;
  --market-soft: #333842;
}

.market-container {
  padding: 20px 20px 36px;
  max-width: 1200px;
  margin: 0 auto;
}

.market-header {
  margin-bottom: 30px;
  text-align: center;
}

.market-header h1 {
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 10px;
}

.market-header p {
  color: var(--market-muted);
}

.market-data-note {
  margin: 6px 0 0;
  color: rgba(104, 115, 133, 0.72);
  font-size: 0.78rem;
  line-height: 1.35;
}

/* Whiskey Forecast Section */
.whiskey-impact-section {
  position: relative;
  margin-bottom: 44px;
  border: 1px solid rgba(243, 156, 18, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.98), rgba(255, 255, 255, 0.98) 58%),
    var(--card-bg);
  box-shadow: 0 16px 36px rgba(151, 93, 0, 0.1);
  overflow: hidden;
}

.whiskey-impact-section h2 {
  margin: 0 0 12px;
  color: #d98200;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.35;
  min-width: max-content;
}

.impact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) 236px minmax(0, 1.12fr);
  gap: 28px;
  align-items: center;
}

.impact-copy p {
  max-width: 370px;
  margin: 0;
  color: var(--market-text);
  font-size: 0.98rem;
  line-height: 1.72;
}

.impact-meter {
  position: relative;
  display: flex;
  width: 220px;
  min-height: 196px;
  margin: 0 auto;
  padding: 22px 18px;
  border: 1px solid rgba(231, 76, 60, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 245, 0.96)),
    var(--card-bg);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75), 0 12px 30px rgba(231, 76, 60, 0.12);
}

.impact-meter::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 8px;
  background: conic-gradient(from 215deg, rgba(231, 76, 60, 0.18) 0 78%, rgba(230, 237, 245, 0.84) 78% 100%);
  opacity: 0.68;
}

.impact-meter::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.meter-label,
.meter-value,
.meter-state {
  position: relative;
  z-index: 1;
}

.meter-label {
  margin-bottom: 8px;
  color: var(--market-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.meter-value {
  color: var(--market-danger);
  font-size: 2.35rem;
  line-height: 1.08;
  font-weight: 800;
}

.meter-state {
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(231, 76, 60, 0.1);
  color: #a83227;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.impact-factors {
  align-self: stretch;
  display: flex;
  align-items: center;
}

.impact-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--market-text);
  font-size: 0.94rem;
  line-height: 1.6;
}

.impact-list li {
  position: relative;
  padding-left: 15px;
}

.impact-list li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-color);
}

.impact-list li + li {
  margin-top: 7px;
}

.impact-list strong {
  color: #1e293b;
}

body.dark-mode .whiskey-impact-section {
  background:
    linear-gradient(135deg, rgba(46, 40, 30, 0.98), rgba(44, 44, 44, 0.98) 58%),
    var(--card-bg);
}

body.dark-mode .impact-meter {
  background:
    linear-gradient(180deg, rgba(52, 50, 48, 0.98), rgba(47, 42, 41, 0.98)),
    var(--card-bg);
}

body.dark-mode .impact-meter::after {
  background: rgba(44, 44, 44, 0.96);
}

body.dark-mode .impact-list strong {
  color: #f3f6fb;
}

/* Category Title */
.category-title {
  margin: 30px 0 15px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 5px;
  font-weight: 700;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.market-card {
  background: var(--card-bg);
  border: 1px solid rgba(216, 226, 239, 0.85);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease;
}

.market-card:hover {
  transform: translateY(-5px);
}

.market-card.whiskey-impact-section {
  border-radius: 8px;
}

.market-card.whiskey-impact-section:hover {
  transform: none;
}

.market-card h3 {
  margin: 0 0 9px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--market-text);
  line-height: 1.35;
}

.indicator-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--market-soft);
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.12rem;
}

.indicator-description {
  margin: 0 0 9px;
  color: var(--market-muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.price-row {
  display: flex;
  margin: 8px 0 3px;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
}

.market-card .price-value {
  color: var(--market-text);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  white-space: nowrap;
}

.market-card .price-value small {
  color: var(--market-muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.unit-note {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin: 3px 0 9px;
  color: #746350;
  font-size: 0.78rem;
  line-height: 1.45;
}

.unit-note::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--accent-color);
  flex: 0 0 auto;
  opacity: 0.72;
}

.market-card .price-change {
  display: inline-flex;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(108, 119, 134, 0.08);
  align-items: center;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.price-up {
  color: #e74c3c;
}

.price-down {
  color: #3498db;
}

.price-flat {
  color: #6c7786;
}

.featured-market-card {
  border-color: rgba(231, 76, 60, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 247, 245, 0.88), rgba(255, 255, 255, 0.98)),
    var(--card-bg);
}

.featured-market-card .indicator-icon {
  background: rgba(231, 76, 60, 0.1);
}

.market-ad-card {
  display: flex;
  flex-direction: column;
  border-style: dashed;
  border-color: rgba(20, 62, 141, 0.2);
  background:
    linear-gradient(180deg, rgba(20, 62, 141, 0.03), rgba(255, 255, 255, 0.98)),
    var(--card-bg);
}

.market-ad-card .indicator-icon {
  background: rgba(20, 62, 141, 0.08);
  color: #143e8d;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.market-ad-body {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(216, 226, 239, 0.85);
}

.market-ad-body .google-adsense {
  width: 100%;
  max-width: none;
  margin: 0 !important;
}

.market-inline-display-ad {
  width: 100%;
  min-height: 250px;
  margin: 0 auto;
}

.chart-container {
  position: relative;
  height: 122px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.78), rgba(255, 255, 255, 0.7));
}

.chart-watermark {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 1;
  color: rgba(23, 32, 51, 0.16);
  font-size: 1.65rem;
  line-height: 1;
  pointer-events: none;
}

.chart-container canvas {
  position: relative;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
}

body.dark-mode .unit-note {
  color: #cdbb9e;
}

body.dark-mode .market-ad-card {
  border-color: rgba(91, 168, 224, 0.28);
  background:
    linear-gradient(180deg, rgba(91, 168, 224, 0.08), rgba(44, 44, 44, 0.96)),
    var(--card-bg);
}

body.dark-mode .market-ad-card .indicator-icon {
  background: rgba(91, 168, 224, 0.18);
  color: #dbeeff;
}

body.dark-mode .chart-container {
  background: linear-gradient(180deg, rgba(51, 56, 66, 0.76), rgba(44, 44, 44, 0.72));
}

body.dark-mode .chart-watermark {
  color: rgba(243, 246, 251, 0.18);
}

.info-section {
  background: rgba(243, 156, 18, 0.1);
  border-left: 5px solid var(--accent-color);
  padding: 15px;
  border-radius: 4px;
  margin-top: 40px;
  font-size: 0.9rem;
}

.info-section h4 {
  margin-top: 0;
  color: var(--accent-color);
}

/* Premium Chart Loading Spinner Styles */
.chart-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(1px);
  gap: 6px;
  border-radius: 8px;
  transition: opacity 0.3s ease;
}

body.dark-mode .chart-loading-overlay {
  background: rgba(44, 44, 44, 0.72);
}

.spinner-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--accent-color);
  animation: spinner-bounce 1.4s infinite ease-in-out both;
}

.spinner-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.spinner-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes spinner-bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.spinner-error {
  font-size: 0.8rem;
  color: var(--market-danger);
  font-weight: 600;
}

