/* Myanmar Inflation Tracker - Paper & Ink Theme */

/* === DESIGN TOKENS === */
:root {
  /* Paper colors */
  --paper-cream: #f9f7f4;
  --paper-beige: #ede8e0;
  --paper-aged: #e8e3d8;

  /* Ink colors */
  --ink-black: #2b2520;
  --ink-dark: #3d3530;
  --ink-medium: #5c554d;
  --ink-light: #8a8175;

  /* Accent colors */
  --sepia-brown: #8b7355;
  --sepia-light: #a89176;
  --accent-gold: #c9a961;

  /* Status colors */
  --status-up: #c05746;
  /* Rust red for increases */
  --status-down: #4a7c59;
  /* Forest green for decreases */
  --status-stable: var(--ink-medium);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  /* Typography */
  --font-serif: 'Crimson Text', 'Georgia', serif;
  --font-sans: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--paper-cream) 0%, var(--paper-beige) 100%);
  color: var(--ink-black);
  line-height: 1.6;
  min-height: 100vh;
  padding: var(--space-md);
}

/* Paper texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

/* === TYPOGRAPHY === */
h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
  color: var(--ink-black);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
  font-size: 1.25rem;
  color: var(--ink-dark);
  margin-bottom: var(--space-xs);
}

.subtitle {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink-medium);
  font-style: italic;
}

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

header {
  text-align: center;
  padding: var(--space-lg) 0;
  border-bottom: 2px solid var(--paper-aged);
  margin-bottom: var(--space-lg);
}

.last-updated {
  font-size: 0.875rem;
  color: var(--ink-light);
  margin-top: var(--space-xs);
}

/* === TAB NAVIGATION === */
.tabs {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--paper-aged);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab {
  flex-shrink: 0;
  padding: var(--space-xs) var(--space-md);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-light);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink-black);
  background: rgba(255, 255, 255, 0.5);
}

.tab.active {
  color: var(--ink-black);
  background: white;
  border-color: var(--paper-aged);
  border-bottom-color: white;
  position: relative;
  bottom: -2px;
}

.tab-icon {
  font-style: normal;
  margin-right: var(--space-xs);
}

/* === QUICK STATS BAR === */
.quick-stats {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(232, 227, 216, 0.4);
  border-radius: 6px;
  margin-bottom: var(--space-md);
  overflow-x: auto;
  font-size: 0.85rem;
}

.quick-stat {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  white-space: nowrap;
}

.quick-stat-label {
  color: var(--ink-medium);
  font-weight: 500;
}

.quick-stat-value {
  font-family: var(--font-mono);
  color: var(--ink-black);
  font-weight: 600;
}

/* === PRICE GRID === */
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* === PRICE CARD === */
.price-card {
  background: white;
  border: 1px solid var(--paper-aged);
  border-radius: 8px;
  padding: var(--space-md);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.price-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-gold);
  opacity: 0.4;
}

.price-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.price-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.price-card__title {
  font-size: 0.95rem;
  color: var(--ink-medium);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price-card__value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink-black);
  margin-bottom: var(--space-xs);
}

.price-card__unit {
  font-size: 0.875rem;
  color: var(--ink-light);
  font-family: var(--font-sans);
  margin-left: var(--space-xs);
}

.price-card__delta {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  font-weight: 600;
}

.price-card__sparkline {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--paper-aged);
}

/* Delta indicators */
.delta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.delta--up {
  background: rgba(192, 87, 70, 0.1);
  color: var(--status-up);
}

.delta--down {
  background: rgba(74, 124, 89, 0.1);
  color: var(--status-down);
}

.delta--stable {
  background: rgba(92, 85, 77, 0.1);
  color: var(--status-stable);
}

.delta__arrow {
  font-size: 1rem;
  font-weight: bold;
}

/* === SPARKLINE === */
.sparkline {
  width: 100%;
  height: 60px;
  margin-top: var(--space-xs);
}

.sparkline__path {
  fill: none;
  stroke: var(--sepia-brown);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline__area {
  fill: var(--sepia-brown);
  opacity: 0.1;
}

/* === FOOTER === */
footer {
  text-align: center;
  padding: var(--space-lg) 0;
  border-top: 2px solid var(--paper-aged);
  margin-top: var(--space-xl);
  color: var(--ink-light);
}

.sources {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
}

.source-link {
  color: var(--sepia-brown);
  text-decoration: none;
  border-bottom: 1px dotted var(--sepia-brown);
  transition: color 0.2s ease;
}

.source-link:hover {
  color: var(--ink-black);
  border-bottom-style: solid;
}

.disclaimer {
  font-size: 0.8rem;
  color: var(--ink-light);
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
}

/* === LOADING STATE === */
.loading {
  text-align: center;
  padding: var(--space-xl);
  color: var(--ink-medium);
}

.loading::after {
  content: '...';
  animation: loading 1.5s infinite;
}

@keyframes loading {

  0%,
  20% {
    content: '.';
  }

  40% {
    content: '..';
  }

  60%,
  100% {
    content: '...';
  }
}

/* === ERROR STATE === */
.error {
  background: rgba(192, 87, 70, 0.1);
  border: 1px solid var(--status-up);
  border-radius: 8px;
  padding: var(--space-md);
  text-align: center;
  color: var(--status-up);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  .price-grid {
    grid-template-columns: 1fr;
  }

  .price-card__value {
    font-size: 1.75rem;
  }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.price-card {
  animation: fadeIn 0.5s ease backwards;
}

.price-card:nth-child(1) {
  animation-delay: 0.1s;
}

.price-card:nth-child(2) {
  animation-delay: 0.2s;
}

.price-card:nth-child(3) {
  animation-delay: 0.3s;
}

.price-card:nth-child(4) {
  animation-delay: 0.4s;
}

.price-card:nth-child(5) {
  animation-delay: 0.5s;
}