/* =====================================================
   Inflation Calculator Plugin — style.css
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --ic-bg:        #0d1117;
  --ic-card:      #161b27;
  --ic-border:    rgba(255,255,255,0.07);
  --ic-accent:    #f59e0b;
  --ic-accent2:   #ef4444;
  --ic-glow:      rgba(245,158,11,0.15);
  --ic-danger:    #ef4444;
  --ic-muted:     #6b7280;
  --ic-text:      #f1f5f9;
  --ic-subtext:   #94a3b8;
  --ic-radius:    14px;
  --ic-font:      'DM Sans', sans-serif;
  --ic-mono:      'DM Mono', monospace;
  --ic-shadow:    0 24px 64px rgba(0,0,0,0.45);
}

/* ---- Layout ---- */
.ic-wrap {
  font-family: var(--ic-font);
  max-width: 880px;
  margin: 40px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 0 16px;
}

@media (max-width: 700px) {
  .ic-wrap { grid-template-columns: 1fr; }
}

/* ---- Cards ---- */
.ic-card {
  background: var(--ic-card);
  border: 1px solid var(--ic-border);
  border-radius: var(--ic-radius);
  padding: 32px 28px;
  box-shadow: var(--ic-shadow);
}

/* ---- Header row ---- */
.ic-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.ic-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ic-text);
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.ic-subtitle {
  font-size: 0.85rem;
  color: var(--ic-subtext);
  margin: 0;
}

/* ---- Currency picker ---- */
.ic-currency-picker {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 145px;
}

.ic-currency-picker label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ic-subtext);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ic-currency-picker select {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 8px;
  padding: 8px 28px 8px 10px;
  color: var(--ic-accent);
  font-family: var(--ic-mono);
  font-size: 0.8rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23f59e0b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ic-currency-picker select:focus {
  border-color: var(--ic-accent);
  box-shadow: 0 0 0 3px var(--ic-glow);
}

/* ---- Fields ---- */
.ic-field { margin-bottom: 18px; }

.ic-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ic-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ic-subtext);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.ic-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

.ic-avg-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ic-accent);
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* ---- Input wrap (prefix) ---- */
.ic-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ic-prefix {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 0 10px;
  color: var(--ic-accent);
  font-family: var(--ic-mono);
  font-size: 0.88rem;
  font-weight: 600;
  pointer-events: none;
  background: rgba(245,158,11,0.07);
  border-right: 1px solid rgba(245,158,11,0.15);
  border-radius: 8px 0 0 8px;
  z-index: 2;
  white-space: nowrap;
}

.ic-input-wrap input { padding-left: 52px !important; }

.ic-field input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--ic-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ic-text);
  font-family: var(--ic-mono);
  font-size: 0.95rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.ic-field input:focus {
  border-color: var(--ic-accent);
  box-shadow: 0 0 0 3px var(--ic-glow);
}

.ic-field input::placeholder { color: var(--ic-muted); }

/* ---- Mode tabs ---- */
.ic-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--ic-border);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 8px;
}

.ic-tab {
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ic-subtext);
  font-family: var(--ic-font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.ic-tab--active {
  background: var(--ic-accent);
  color: #0d1117;
}

.ic-tab:not(.ic-tab--active):hover {
  background: rgba(245,158,11,0.1);
  color: var(--ic-accent);
}

.ic-mode-desc {
  font-size: 0.78rem;
  color: var(--ic-muted);
  margin: 0;
  font-style: italic;
}

/* ---- Button ---- */
.ic-btn {
  width: 100%;
  margin-top: 8px;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--ic-accent), #d97706);
  border: none;
  border-radius: 8px;
  color: #0d1117;
  font-family: var(--ic-font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.1s;
}

.ic-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.ic-btn:active { transform: translateY(0); }

.ic-btn-reset {
  background: rgba(255,255,255,0.05);
  color: var(--ic-subtext);
  border: 1px solid var(--ic-border);
  margin-top: 20px;
}

.ic-btn-reset:hover { background: rgba(255,255,255,0.09); opacity: 1; }

/* ---- Results ---- */
.ic-currency-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 10px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ic-accent);
  font-family: var(--ic-mono);
  letter-spacing: 0.04em;
}

.ic-results-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ic-text);
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

/* ---- Hero ---- */
.ic-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(245,158,11,0.05);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: 12px;
  padding: 20px 18px;
  margin-bottom: 20px;
}

.ic-hero-from,
.ic-hero-to {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ic-hero-to { align-items: flex-end; text-align: right; }

.ic-hero-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ic-subtext);
}

.ic-hero-val {
  font-family: var(--ic-mono);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ic-text);
}

.ic-hero-val--accent { color: var(--ic-accent); font-size: 1.4rem; }

.ic-hero-year {
  font-size: 0.72rem;
  color: var(--ic-muted);
  font-family: var(--ic-mono);
}

.ic-arrow {
  font-size: 1.4rem;
  color: var(--ic-accent);
  flex-shrink: 0;
  opacity: 0.6;
}

/* ---- Stats grid ---- */
.ic-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}

.ic-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--ic-border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ic-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ic-subtext);
}

.ic-stat-val {
  font-family: var(--ic-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ic-text);
}

/* ---- Timeline ---- */
.ic-timeline h4 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ic-subtext);
  margin: 0 0 12px;
}

.ic-timeline-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--ic-border);
  border-radius: 8px;
  padding: 8px 8px 0;
}

.ic-tl-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.ic-tl-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: rgba(245,158,11,0.35);
  transition: height 0.5s cubic-bezier(.4,0,.2,1);
  min-height: 4px;
}

.ic-tl-bar--start { background: rgba(245,158,11,0.25); }
.ic-tl-bar--end   { background: var(--ic-accent); }

.ic-tl-year {
  font-size: 0.6rem;
  color: var(--ic-muted);
  margin-top: 4px;
  font-family: var(--ic-mono);
  display: none;
}

.ic-timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--ic-muted);
  font-family: var(--ic-mono);
  margin-top: 6px;
  padding: 0 2px;
}

/* ---- Note ---- */
.ic-note {
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--ic-muted);
  line-height: 1.5;
  border-top: 1px solid var(--ic-border);
  padding-top: 14px;
}

/* ---- Animate in ---- */
@keyframes ic-fadein {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}
.ic-results { animation: ic-fadein 0.35s ease both; }
