/* BB Chronicle 2025 - Craft Beer Theme (Light) */

:root {
  --bg-dark: #faf6f0;
  --bg-card: #ffffff;
  --bg-card-hover: #fff8e7;
  --amber: #c4853c;
  --amber-light: #d4a574;
  --amber-dark: #a06830;
  --cream: #fff8e7;
  --copper: #b87333;
  --foam: rgba(255, 248, 231, 0.9);
  --text-primary: #3d2e1f;
  --text-secondary: #6b5847;
  --text-muted: #9a8a7a;
  --gold: #d4a020;
  --shadow: rgba(139, 90, 43, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: linear-gradient(180deg, #faf6f0 0%, #f5ede0 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Bubble Animation */
.bubbles {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bubble {
  position: absolute;
  bottom: -100px;
  background: radial-gradient(circle at 30% 30%, rgba(212, 165, 116, 0.6), rgba(184, 115, 51, 0.2));
  border-radius: 50%;
  opacity: 0;
  animation: rise 8s infinite ease-in;
}

.bubble:nth-child(1) { left: 10%; width: 20px; height: 20px; animation-delay: 0s; }
.bubble:nth-child(2) { left: 20%; width: 15px; height: 15px; animation-delay: 1s; }
.bubble:nth-child(3) { left: 35%; width: 25px; height: 25px; animation-delay: 2s; }
.bubble:nth-child(4) { left: 50%; width: 18px; height: 18px; animation-delay: 3s; }
.bubble:nth-child(5) { left: 65%; width: 22px; height: 22px; animation-delay: 4s; }
.bubble:nth-child(6) { left: 75%; width: 12px; height: 12px; animation-delay: 5s; }
.bubble:nth-child(7) { left: 85%; width: 20px; height: 20px; animation-delay: 6s; }
.bubble:nth-child(8) { left: 95%; width: 16px; height: 16px; animation-delay: 7s; }

@keyframes rise {
  0% {
    bottom: -100px;
    opacity: 0;
    transform: translateX(0);
  }
  10% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    bottom: 100vh;
    opacity: 0;
    transform: translateX(20px);
  }
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Section */
.section {
  padding: 80px 0;
}

.section-title {
  font-family: 'Kaisei Decol', serif;
  font-size: 2rem;
  color: var(--amber);
  text-align: center;
  margin-bottom: 50px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--copper), var(--amber));
  margin: 15px auto 0;
  border-radius: 2px;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(ellipse at center bottom, rgba(212, 165, 116, 0.25) 0%, transparent 60%);
}

.hero-title {
  font-family: 'Kaisei Decol', serif;
  font-size: 3.5rem;
  color: var(--amber-dark);
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(212, 165, 116, 0.2);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.hero-period {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 60px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: 16px;
  padding: 30px 40px;
  min-width: 180px;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 20px var(--shadow);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(184, 115, 51, 0.2);
}

.stat-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 10px;
}

.stat-value {
  display: block;
  font-family: 'Kaisei Decol', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--amber-dark);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

.hero-averages {
  display: flex;
  justify-content: center;
  gap: 60px;
}

.avg-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.avg-value {
  font-family: 'Kaisei Decol', serif;
  font-size: 1.8rem;
  color: var(--amber);
}

.avg-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Chart Grid */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 4px 20px var(--shadow);
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card h3 {
  font-size: 1rem;
  color: var(--amber-dark);
  margin-bottom: 20px;
  font-weight: 600;
}

/* Insight Cards */
.insight-cards {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.insight-card {
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.15), rgba(255, 248, 231, 0.5));
  border: 1px solid rgba(212, 165, 116, 0.4);
  border-radius: 12px;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: 500px;
}

.insight-icon {
  font-size: 1.5rem;
}

.insight-text {
  color: var(--text-primary);
  font-size: 1rem;
}

/* Stat Highlight */
.stat-highlight {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 40px;
}

.highlight-item {
  text-align: center;
}

.highlight-value {
  display: block;
  font-family: 'Kaisei Decol', serif;
  font-size: 2.5rem;
  color: var(--amber);
}

.highlight-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* Discovery Grid */
.discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 25px;
}

.discovery-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 4px 20px var(--shadow);
}

.discovery-card h3 {
  font-size: 1rem;
  color: var(--amber-dark);
  margin-bottom: 20px;
  font-weight: 600;
}

.discovery-content {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.discovery-content .highlight {
  color: var(--amber);
  font-weight: 600;
}

.discovery-content .compare {
  display: flex;
  justify-content: space-around;
  margin: 15px 0;
  padding: 15px;
  background: rgba(212, 165, 116, 0.1);
  border-radius: 8px;
}

.discovery-content .compare-item {
  text-align: center;
}

.discovery-content .compare-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--amber-dark);
}

.discovery-content .compare-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Co-occurrence Matrix */
#cooccurrence-matrix {
  overflow-x: auto;
}

#cooccurrence-matrix table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

#cooccurrence-matrix th,
#cooccurrence-matrix td {
  padding: 8px 4px;
  text-align: center;
  border: 1px solid rgba(212, 165, 116, 0.1);
}

#cooccurrence-matrix th {
  color: var(--amber-light);
  font-weight: 600;
}

#cooccurrence-matrix .beer-name {
  text-align: left;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#cooccurrence-matrix .cell {
  min-width: 30px;
}

/* Footer */
.footer {
  background: linear-gradient(180deg, var(--cream), #f5ede0);
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid rgba(212, 165, 116, 0.3);
}

.footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-thanks {
  color: var(--amber);
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-stats {
    gap: 20px;
  }

  .stat-card {
    padding: 20px 25px;
    min-width: 140px;
  }

  .stat-value {
    font-size: 2rem;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .discovery-grid {
    grid-template-columns: 1fr;
  }

  .hero-averages {
    flex-direction: column;
    gap: 20px;
  }

  .stat-highlight {
    flex-direction: column;
    gap: 30px;
  }
}

/* Chart.js Theme Override */
canvas {
  max-width: 100%;
}
