/* ============================================================
   EZ Dividend Calculator – Main Stylesheet
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --blue:        #185FA5;
  --blue-light:  #e8f1fb;
  --blue-dark:   #0f4070;
  --green:       #1D9E75;
  --green-light: #e6f7f2;
  --dark:        #0f172a;
  --text:        #334155;
  --muted:       #64748b;
  --bg:          #f8fafc;
  --white:       #ffffff;
  --border:      #e2e8f0;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   20px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.07);
  --shadow:      0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.12);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w:       1140px;
  --transition:  0.2s ease;
}

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-dark); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--dark);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.4rem; margin-bottom: 1rem; }
li { margin-bottom: 0.35rem; }

strong { font-weight: 600; }

img { max-width: 100%; height: auto; display: block; }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header / Nav ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1.5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--dark);
  text-decoration: none;
  white-space: nowrap;
}
.site-logo:hover { text-decoration: none; color: var(--blue); }
.logo-icon { font-size: 1.2rem; color: var(--blue); }

.site-nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.25rem;
}

.site-nav a {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.site-nav a:hover, .site-nav a.active {
  background: var(--blue-light);
  color: var(--blue);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.125rem; }
  .site-nav a { font-size: 0.95rem; padding: 0.6rem 0.75rem; }
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, #2277c4 100%);
  color: var(--white);
  padding: 4rem 0 3.5rem;
  text-align: center;
}
.hero h1 { color: var(--white); margin-bottom: 0.75rem; }
.hero .hero-sub {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Calculator Card ────────────────────────────────────────── */
.calculator-section {
  padding: 2.5rem 0 3rem;
}

.calc-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 2.5rem;
  margin-top: -2.5rem;
  position: relative;
}

.calc-card h2 {
  font-size: 1.2rem;
  color: var(--dark);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* Form grid */
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.input-group { display: flex; flex-direction: column; gap: 6px; }

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.input-row {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-row:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24,95,165,0.12);
}

.input-row .prefix,
.input-row .suffix {
  padding: 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--border);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.input-row input,
.input-group input[type="date"] {
  flex: 1;
  padding: 0.7rem 0.85rem;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--dark);
  outline: none;
  width: 100%;
}

.input-group input[type="date"] {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-group input[type="date"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24,95,165,0.12);
  outline: none;
}

.btn-calc {
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: var(--white);
  letter-spacing: 0.02em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-bottom: 0;
}
.btn-calc:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(24,95,165,0.3);
}
.btn-calc:active { transform: translateY(0); }

/* Results */
.results-section { display: none; margin-top: 2rem; }
.results-section.visible { display: block; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
}

.metric .mlabel {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.metric .mval {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
}

.metric:nth-child(1) .mval,
.metric:nth-child(3) .mval { color: var(--blue); }
.metric:nth-child(2) .mval,
.metric:nth-child(4) .mval { color: var(--green); }

/* Tabs */
.tab-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.45rem 1rem;
  font-size: 0.83rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: all var(--transition);
}
.tab-btn:hover { border-color: var(--blue); color: var(--blue); }
.tab-btn.active { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* Chart */
.chart-wrap {
  position: relative;
  width: 100%;
  height: 320px;
  margin-bottom: 2rem;
}

/* Legend */
.legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }

th {
  text-align: right;
  padding: 0.7rem 1rem;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1.5px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}
th:first-child { text-align: left; }

td {
  text-align: right;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
td:first-child { text-align: left; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

.col-reinvest   { color: var(--blue) !important; }
.col-noreinvest { color: var(--green) !important; }

/* ── Home page content sections ─────────────────────────────── */
.home-content {
  padding: 4rem 0;
}

.section-intro {
  max-width: 760px;
  margin: 0 auto 3rem;
  text-align: center;
}

.section-intro h2 { margin-bottom: 0.75rem; }
.section-intro p { color: var(--muted); font-size: 1.05rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.icon-blue  { background: var(--blue-light);  color: var(--blue); }
.icon-green { background: var(--green-light); color: var(--green); }
.icon-gold  { background: #fff8e1; color: #c77c00; }
.icon-purple{ background: #f3eaff; color: #6d28d9; }

.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p  { font-size: 0.9rem; color: var(--muted); margin: 0; }

.feature-card a.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
}
.feature-card a.card-link:hover { text-decoration: underline; }

/* ── Content page layout ─────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
  color: var(--white);
  padding: 3.5rem 0 3rem;
}
.page-hero h1 { color: var(--white); margin-bottom: 0.6rem; }
.page-hero .hero-sub { color: rgba(255,255,255,0.85); font-size: 1.05rem; }

.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  padding: 3rem 0 4rem;
  align-items: start;
}

.content-main h2 {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.content-main h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.content-main h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; color: var(--text); }

.content-main ul, .content-main ol { margin-bottom: 1rem; }

.content-main .highlight-box {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.content-main .stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.content-main .stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: center;
}
.content-main .stat-box .stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--blue);
  display: block;
}
.content-main .stat-box .stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* Sidebar */
.content-sidebar { position: sticky; top: 80px; }

.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.sidebar-widget h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.sidebar-widget .btn-cta {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--blue);
  color: var(--white);
  text-align: center;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}
.sidebar-widget .btn-cta:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  text-decoration: none;
}

.sidebar-widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar-widget ul li { margin-bottom: 0; }
.sidebar-widget ul li a {
  display: block;
  padding: 0.45rem 0;
  font-size: 0.875rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.sidebar-widget ul li:last-child a { border-bottom: none; }
.sidebar-widget ul li a:hover { color: var(--blue); text-decoration: none; }

/* FAQ */
.faq-list { margin-top: 1rem; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-q {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  transition: background var(--transition);
}
.faq-q:hover { background: var(--bg); }
.faq-q .faq-arrow { transition: transform var(--transition); font-size: 0.75rem; color: var(--muted); }
.faq-item.open .faq-q .faq-arrow { transform: rotate(180deg); }
.faq-a {
  display: none;
  padding: 0 1.25rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
}
.faq-item.open .faq-a { display: block; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.75);
  padding: 3rem 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
}

.footer-brand .site-logo { color: var(--white); }
.footer-brand .site-logo:hover { color: rgba(255,255,255,0.7); }
.footer-tagline { font-size: 0.875rem; color: rgba(255,255,255,0.5); margin-top: 0.6rem; }

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 0;
}
.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  margin: 0;
  text-align: center;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 960px) {
  .content-layout { grid-template-columns: 1fr; }
  .content-sidebar { position: static; }
}

@media (max-width: 700px) {
  .calc-card { padding: 1.5rem 1.25rem; }
  .input-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-links { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr; }
  .tab-btn { font-size: 0.75rem; padding: 0.4rem 0.75rem; }
  .footer-links { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 0 2rem; }
}
