/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  line-height: 1.7;
}
a { color: #0057b8; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ===== VARIABLES ===== */
:root {
  --primary: #0a2c6e;
  --primary-light: #1a4a9e;
  --accent: #e8a020;
  --accent-dark: #c78010;
  --text: #1a1a2e;
  --text-muted: #5a6a7a;
  --bg: #f5f7fa;
  --bg-white: #ffffff;
  --border: #e0e6ef;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(10,44,110,0.10);
  --shadow-sm: 0 2px 8px rgba(10,44,110,0.07);
}

/* ===== HEADER & NAV ===== */
header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }
nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}
nav ul li a {
  color: rgba(255,255,255,0.85);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
nav ul li a:hover, nav ul li a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 0.2rem;
  gap: 0.1rem;
  margin-left: 0.5rem;
}
.lang-switcher a,
.lang-switcher .lang-active {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: 16px;
  transition: all 0.2s;
  line-height: 1;
}
.lang-switcher a {
  color: rgba(255,255,255,0.85);
}
.lang-switcher a:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
  text-decoration: none;
}
.lang-switcher .lang-active {
  background: rgba(255,255,255,0.15);
  color: var(--accent);
  pointer-events: none;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: 0.3s;
}
.nav-mobile {
  display: none;
  background: var(--primary);
  padding: 1rem 1.5rem;
}
.nav-mobile.open { display: block; }
.nav-mobile ul { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-mobile ul li a {
  display: block;
  color: rgba(255,255,255,0.9);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-mobile ul li a:hover { background: rgba(255,255,255,0.12); text-decoration: none; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1a4a9e 100%);
  color: #fff;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.82);
  max-width: 540px;
  margin: 0 auto 2rem;
}
.rate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 100px;
  padding: 0.4rem 1.2rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 2rem;
}
.rate-badge .dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== CALCULATOR ===== */
.calc-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem;
}
.calc-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}
.calc-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.calc-field input, .calc-field select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.calc-field input:focus, .calc-field select:focus {
  outline: none;
  border-color: var(--primary-light);
  background: #fff;
}
.calc-arrow {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.85rem;
}
#swap-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
#swap-btn:hover {
  background: var(--primary-light);
  transform: scale(1.1);
}
#swap-btn.spinning {
  animation: spin 0.4s ease;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(180deg); }
}
.calc-result {
  background: #f0f6ff;
  border: 2px solid #d0e4ff;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  text-align: center;
  margin-bottom: 1rem;
}
.calc-result .result-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.calc-result .result-rate {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.calc-result .result-rate span { color: var(--primary); font-weight: 600; }
.calc-updated {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.calc-updated a { color: var(--primary); }

/* ===== MAIN CONTENT ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0;
}
.main-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}
.main-content h2:first-child { margin-top: 0; }
.main-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}
.main-content p { margin-bottom: 1rem; color: #2a3a4a; }

/* ===== CONVERSION TABLE ===== */
.conv-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.conv-table th {
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
}
.conv-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}
.conv-table tr:nth-child(even) td { background: #f8fafc; }
.conv-table tr:hover td { background: #f0f6ff; }

/* ===== FAQ ===== */
.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: var(--bg-white);
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.faq-question:hover { background: #f0f6ff; }
.faq-question .icon {
  font-size: 1.2rem;
  color: var(--primary);
  transition: transform 0.3s;
  flex-shrink: 0;
}
.faq-question.open .icon { transform: rotate(45deg); }
.faq-answer {
  display: none;
  padding: 0 1.25rem 1rem;
  font-size: 0.92rem;
  color: #3a4a5a;
  line-height: 1.6;
}
.faq-answer.open { display: block; }

/* ===== SIDEBAR ===== */
.sidebar {}
.sidebar-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.sidebar-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}
.quick-links { list-style: none; }
.quick-links li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.quick-links li:last-child { border: none; }
.quick-links li a { color: var(--text); font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.quick-links li a:hover { color: var(--primary); text-decoration: none; }

/* ===== AFFILIATE CTA ===== */
.affiliate-cta {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 2px solid #86efac;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.affiliate-cta-text h3 { font-size: 1.05rem; font-weight: 700; color: #14532d; margin-bottom: 0.3rem; }
.affiliate-cta-text p { font-size: 0.88rem; color: #166534; margin: 0; }
.affiliate-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #16a34a;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.affiliate-cta-btn:hover { background: #15803d; transform: translateY(-1px); text-decoration: none; color: #fff; }

/* ===== ARTICLES GRID ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}
.article-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.article-card-body { padding: 1.5rem; }
.article-tag {
  display: inline-block;
  background: #e8f0fe;
  color: var(--primary-light);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
.article-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.4; }
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--primary); text-decoration: none; }
.article-card p { font-size: 0.88rem; color: var(--text-muted); margin: 0 0 1rem; }
.read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.read-more:hover { text-decoration: none; color: var(--primary-light); }

/* ===== ARTICLE PAGE ===== */
.article-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 3rem 1.5rem 2rem;
}
.article-header h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.3;
  max-width: 800px;
}
.article-meta {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
.article-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}
.article-body h3 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.article-body p { margin-bottom: 1rem; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}
.article-body table th {
  background: var(--primary);
  color: #fff;
  padding: 0.7rem 1rem;
  text-align: left;
}
.article-body table td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); }
.article-body table tr:nth-child(even) td { background: #f8fafc; }

/* ===== HIGHLIGHT BOX ===== */
.highlight-box {
  background: #fff8e6;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  font-size: 0.82rem;
}
.breadcrumb ol li { color: var(--text-muted); }
.breadcrumb ol li a { color: var(--primary); }
.breadcrumb ol li::after { content: '/'; margin-left: 0.25rem; }
.breadcrumb ol li:last-child::after { display: none; }

/* ===== SECTION TITLES ===== */
.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.section-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* ===== FOOTER ===== */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.75);
  padding: 3rem 1.5rem 2rem;
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand .logo { display: block; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.87rem; line-height: 1.6; max-width: 280px; }
footer h4 { color: #fff; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.75rem; }
footer ul { list-style: none; }
footer ul li { margin-bottom: 0.4rem; }
footer ul li a { color: rgba(255,255,255,0.7); font-size: 0.87rem; }
footer ul li a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.page-section { padding: 2.5rem 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  nav ul { display: none; }
  .hamburger { display: flex; }
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .sidebar-card { display: none; }
  .sidebar-card.mobile-show { display: block; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-brand p { max-width: 100%; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .calc-row { grid-template-columns: 1fr; gap: 0.75rem; }
  .calc-arrow { padding: 0; justify-content: center; }
  .articles-grid { grid-template-columns: 1fr; }
  .article-meta { flex-direction: column; gap: 0.4rem; }
}
@media (max-width: 480px) {
  .hero { padding: 2.5rem 1rem 2rem; }
  .calc-card { padding: 1.5rem 1rem; }
  .calc-result .result-amount { font-size: 1.6rem; }
}


/* ===== HERO CHART ===== */
.hero-chart-wrap {
  max-width: 760px;
  margin: 0 auto 1.75rem;
  width: 100%;
}
.hero-chart-stats {
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}
.hero-stat { text-align: center; }
.hero-stat-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  font-weight: 700;
}
.hero-stat-val {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  margin-top: 0.1rem;
}
.hero-stat-val.positive { color: #4ade80; }
.hero-stat-val.negative { color: #f87171; }
#rate-chart {
  display: block;
  width: 100%;
  height: 110px;
}
.chart-loading {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.35rem;
  min-height: 1em;
}
@media (max-width: 600px) {
  .hero-chart-stats { gap: 1rem; }
  #rate-chart { height: 90px; }
}


/* ===== NEWSLETTER SIGNUP ===== */
.newsletter-box {
  background: linear-gradient(135deg, #1e3a5f, #2d5a87);
  border-radius: var(--radius, 12px);
  padding: 2rem 1.75rem;
  margin: 2rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.newsletter-box::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
}
.newsletter-box h3 {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.newsletter-box p {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 440px;
  margin: 0 auto;
}
.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,0.5); }
.newsletter-form input[type="email"]:focus { border-color: rgba(255,255,255,0.5); }
.newsletter-form button {
  padding: 0.75rem 1.5rem;
  background: #e8a020;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}
.newsletter-form button:hover { background: #d4911a; transform: translateY(-1px); }
.newsletter-msg { color: #86efac; font-size: 0.85rem; margin-top: 0.75rem; display: none; }
.newsletter-msg.error { color: #fca5a5; }
.newsletter-privacy { color: rgba(255,255,255,0.4); font-size: 0.72rem; margin-top: 0.75rem; }
@media (max-width: 600px) {
  .newsletter-form { flex-direction: column; }
  .newsletter-form button { width: 100%; }
}
