/* ==========================================================
   VARIABLES
========================================================== */

:root{

    --bg:#f8f9fb;
    --card-bg:#ffffff;

    --text-main:#111827;
    --text-muted:#6b7280;

    --accent:#2563eb;

    --border:#e5e7eb;

    --shadow:0 10px 25px rgba(0,0,0,.05);

    --radius:14px;

}


/* ==========================================================
   RESET
========================================================== */

*{

    margin:0;
    padding:0;
    box-sizing:border-box;

}

html{

    scroll-behavior:smooth;

}

body{

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;

    background:var(--bg);

    color:var(--text-main);

    line-height:1.6;

}

a{

    text-decoration:none;

    color:inherit;

}

button{

    font:inherit;

}


/* ==========================================================
   CONTAINER
========================================================== */

.container{

    max-width:1100px;

    margin:auto;

    padding:40px 24px;

}


/* ==========================================================
   TOP BAR
========================================================== */

.topbar{

    background:white;

    border-bottom:1px solid var(--border);

}

.topbar-inner{

    max-width:1100px;

    margin:auto;

    padding:16px 24px;

    display:flex;

    justify-content:space-between;

    align-items:center;

}

.brand{

    display:flex;

    align-items:center;

    gap:12px;

}

.logo{

    width:38px;

    height:38px;

    border-radius:10px;

    background:var(--accent);

    color:white;

    display:flex;

    align-items:center;

    justify-content:center;

    font-weight:700;

}

.brand-name{

    font-weight:700;

}

.nav-links{

    display:flex;

    gap:20px;

}

.nav-links a{

    color:var(--text-muted);

}

.nav-links a:hover{

    color:var(--text-main);

}


/* ==========================================================
   HERO
========================================================== */

header{

    text-align:center;

    margin-bottom:45px;

}

header h1{

    font-size:2.5rem;

    margin-bottom:15px;

}

header p{

    max-width:700px;

    margin:auto;

    color:var(--text-muted);

}


/* ==========================================================
   MARKET BAR
========================================================== */

.market-bar{

    background:white;

    border-radius:var(--radius);

    box-shadow:var(--shadow);

    overflow:hidden;

    margin-bottom:25px;

}

.market-top{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:10px 18px;

    border-bottom:1px solid var(--border);

}

.market-title{

    display:flex;

    align-items:center;

    gap:15px;

}

.market-name{

    font-weight:700;

}

.market-status{

    display:flex;

    align-items:center;

    gap:8px;

}

.live-dot{

    width:8px;

    height:8px;

    border-radius:50%;

    background:#16a34a;

}

.market-update{

    color:var(--text-muted);

    font-size:.85rem;

}

.market-tabs{

    display:flex;

    gap:8px;

}

.market-tab{

    border:none;

    background:none;

    padding:5px 10px;

    border-radius:8px;

    cursor:pointer;

}

.market-tab.active{

    background:var(--accent);

    color:white;

}

.market-tab:hover{

    background:#edf4ff;

}

.market-tab.active:hover{

    background:var(--accent);

}


/* ==========================================================
   TICKER
========================================================== */

.ticker{

    overflow:hidden;

    white-space:nowrap;

    padding:10px 0;

}

.ticker-track{

    display:inline-flex;

    gap:35px;

    animation:ticker 40s linear infinite reverse;

}

.ticker:hover .ticker-track{

    animation-play-state:paused;

}

.ticker-item{

    display:flex;

    gap:8px;

    align-items:center;

}

.ticker-name{

    font-weight:600;

}

.up{

    color:#16a34a;

}

.down{

    color:#dc2626;

}

@keyframes ticker{

    from{

        transform:translateX(-50%);

    }

    to{

        transform:translateX(0);

    }

}


/* ==========================================================
   DASHBOARD
========================================================== */

.dashboard{

    display:grid;

    grid-template-columns:2fr 1fr;

    gap:24px;

    margin:32px 0;

    align-items:start;

}


/* =======================================
   Mr.G Gauge Zone Labels
======================================= */

.gauge {

    position: relative;

    width: 100%;

    max-width: 300px;

    margin: 8px auto;

}

#marketGauge {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 2;
}

.snapshot-item {
    margin-bottom: 16px;
}

.indicator-header,
.indicator-bar {
    width: 100%;
    max-width: 220px;
}

.indicator-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    max-width: 220px;
    margin-bottom: 6px;
}

.indicator-header span:first-child {
    font-weight: 500;
}

.indicator-header span:last-child {
    font-weight: 600;
    min-width: 30px;
    text-align: left;
}

.indicator-bar {
    display: block;
    width: 100%;
    max-width: 220px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.indicator-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: #111827;
    border-radius: 6px;
    transition: width 0.8s ease;
}

/* ==========================================================
   MARKET PULSE
========================================================== */

.market-pulse,
.market-snapshot{

    background:#fff;

    border-radius:16px;

    padding:22px;

    box-shadow:0 4px 12px rgba(0,0,0,.08);

}

.news-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:16px 20px;

    margin-bottom:0;

    border-bottom:1px solid var(--border);

}

.snapshot-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:16px 20px;

    border-bottom:1px solid var(--border);

}

.news-list{

    min-height:330px;

}

.news-item{

    display:block;

    padding:10px 0;

    text-decoration:none;

}

.news-item:hover{

    color:#0d6efd;

}

.news-title{

    display:block;

    font-size:15px;

    line-height:1.45;

    color:#222;

    font-weight:600;

    margin-bottom:4px;

}

.news-time{

    display:block;

    font-size:12px;

    color:#888;

}

.news-footer{

    margin-top:18px;

    padding-top:14px;

    display:flex;

    justify-content:space-between;

    align-items:center;

}

.news-footer a{

    color:var(--accent);

}


/* ==========================================================
   SNAPSHOT
========================================================== */

.market-snapshot{

    background:white;

    border-radius:var(--radius);

    box-shadow:var(--shadow);

    overflow:hidden;

}

.snapshot-content{

    padding:10px 20px;

}

.snapshot-item {
    margin-bottom: 16px;
}

.snapshot-item:last-child{

    border:none;

}


/* ==========================================================
   TOOLS
========================================================== */

.grid{

    display:grid;

    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));

    gap:24px;

}

.card{

    background:white;

    border-radius:var(--radius);

    padding:28px;

    box-shadow:var(--shadow);

    transition:.2s;

}

.card:hover{

    transform:translateY(-4px);

}

.card h3{

    margin-bottom:10px;

}

.card p{

    color:var(--text-muted);

}


/* ==========================================================
   FOOTER
========================================================== */

footer{

    margin-top:70px;

    padding-top:25px;

    border-top:1px solid var(--border);

    color:var(--text-muted);

}


/* ==========================================================
   RESPONSIVE
========================================================== */

@media(max-width:900px){

    .dashboard{

        grid-template-columns:1fr;

    }

    .market-top{

        flex-direction:column;

        align-items:flex-start;

        gap:12px;

    }

    .market-tabs{

        flex-wrap:wrap;

    }

}

@media(max-width:700px){

    .topbar-inner{

        flex-direction:column;

        gap:15px;

    }

    header h1{

        font-size:2rem;

    }

}


/* =======================================
   Mr.G Market Gauge
======================================= */

.gauge {

    position: relative;

    width: 100%;

    max-width: 300px;

    margin: 8px auto;

}


/* Main gauge layout */

.market-gauge {

    display: flex;

    align-items: center;

    justify-content: flex-start;

    gap: 14px;

    margin: 12px 0;

    min-height: 200px;

}


/* Five sentiment labels */

.gauge-labels {

    width: 75px;

    height: 200px;

    display: flex;

    flex-direction: column;

    justify-content: space-between;

    text-align: right;

    font-size: 12px;

    line-height: 1;

}


/* Thermometer */

.gauge-chart {

    width: 45px;

    height: 200px;

    position: relative;

}


/* Chart.js canvas */

.gauge-chart canvas {

    width: 45px !important;

    height: 200px !important;

}


/* Score + sentiment */

.gauge-center {

    position: relative;

    width: 90px;

    min-width: 90px;

    margin-left: 4px;

    transform: translateY(-10px);

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    text-align: center;

    pointer-events: none;

}


/* Score */

#gauge-score {

    margin: 0 0 6px 0;

    font-size: 2.2rem;

    font-weight: 700;

    line-height: 1;

}


/* Sentiment */

#gauge-label {

    margin: 0;

    font-size: 1rem;

    font-weight: 600;

    white-space: nowrap;

}


/* Chart.js canvas positioning */

#marketGauge {

    position: absolute;

    inset: 0;

    width: 100% !important;

    height: 100% !important;

    z-index: 2;

}


/* =======================================
   Snapshot Indicators
======================================= */

.snapshot-item {

    margin-bottom: 16px;

}

.indicator-header,
.indicator-bar {

    width: 100%;

    max-width: 220px;

}

.indicator-header {

    display: flex;

    align-items: center;

    justify-content: flex-start;

    gap: 12px;

    margin-bottom: 6px;

}

.indicator-header span:first-child {

    font-weight: 500;

}

.indicator-header span:last-child {

    font-weight: 600;

    min-width: 30px;

    text-align: left;

}

.indicator-bar {

    display: block;

    height: 6px;

    background: #e5e7eb;

    border-radius: 6px;

    overflow: hidden;

}

.indicator-fill {

    display: block;

    height: 100%;

    width: 0%;

    background: #111827;

    border-radius: 6px;

    transition: width 0.8s ease;

}

.gauge-chart canvas {

    width: 45px !important;

    height: 200px !important;

}

/* ==========================================================
   FINANCIAL LITERACY PAGE
   ----------------------------------------------------------
   Styles for: financial-literacy.html

   BOOK COVER VERSION
   ----------------------------------------------------------
   Add this block at the VERY BOTTOM of style.css.
   If an older FINANCIAL LITERACY PAGE block exists,
   replace that block with this one.
   ========================================================== */


/* ==========================================================
   HERO
   ========================================================== */

.literacy-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 20px 35px;
  text-align: center;
}

.literacy-hero .section-label {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.literacy-hero h1 {
  margin: 0 0 14px;
  color: var(--text-main);
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.literacy-hero p {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.65;
}


/* ==========================================================
   INTRO
   ========================================================== */

.learning-intro {
  max-width: 760px;
  margin: 0 auto;
  padding: 15px 20px 38px;
  text-align: center;
}

.learning-intro h2 {
  margin: 0 0 10px;
  color: var(--text-main);
  font-size: 27px;
  letter-spacing: -0.02em;
}

.learning-intro p {
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
}


/* ==========================================================
   LEARNING PATH
   ========================================================== */

.learning-path {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 25px;
}


/* Vertical connecting line */

.learning-path::before {
  content: "";
  position: absolute;

  left: 51px;
  top: 32px;
  bottom: 32px;

  width: 2px;

  background: #dbe7f8;
}


/* ==========================================================
   LEARNING CARD
   ========================================================== */

.learning-card {
  position: relative;

  display: grid;

  /*
     Number | Book Cover | Main Content
  */
  grid-template-columns: 64px 112px minmax(0, 1fr);

  gap: 20px;

  align-items: start;

  margin-bottom: 16px;
  padding: 16px 14px 16px 0;

  background: var(--card-bg);

  border: 1px solid var(--border);
  border-radius: var(--radius);

  box-shadow: var(--shadow);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.learning-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.07);
}


/* ==========================================================
   LEVEL NUMBER
   ========================================================== */

.level-number {
  position: relative;
  z-index: 2;

  width: 40px;
  height: 40px;

  margin-left: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 2px solid var(--accent);
  border-radius: 50%;

  background: var(--card-bg);

  color: var(--accent);

  font-size: 13px;
  font-weight: 800;
}


/* ==========================================================
   BOOK COVER
   ========================================================== */

.book-cover {
  width: 100%;
  max-width: 112px;

  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.book-cover img {
  display: block;

  width: 100%;
  height: 140px;

  object-fit: cover;

  border-radius: 3px;

  background: #f3f4f6;

  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.08);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.learning-card:hover .book-cover img {
  transform: translateY(-2px);

  box-shadow:
    0 7px 16px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.08);
}


/* ==========================================================
   MAIN BOOK CONTENT
   ========================================================== */

.learning-content {
  min-width: 0;
}

.learning-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;

  margin-bottom: 8px;
}

.level-icon {
  font-size: 16px;
  line-height: 1;
}

.level-name {
  color: var(--accent);

  font-size: 10px;
  font-weight: 800;

  letter-spacing: 0.06em;
}

.difficulty {
  display: inline-flex;
  align-items: center;

  padding: 4px 9px;

  border-radius: 999px;

  background: #eef3f9;

  color: #526174;

  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}


/* ==========================================================
   BOOK TITLE
   ========================================================== */

.learning-content h2 {
  margin: 0 0 3px;

  color: var(--text-main);

  font-size: 17px;
  line-height: 1.3;

  letter-spacing: -0.015em;
}

.author {
  margin-bottom: 9px;

  color: #718096;

  font-size: 13px;
  font-style: italic;
}

.book-intro {
  max-width: 520px;

  margin: 0 0 14px;

  color: var(--text-muted);

  font-size: 13px;
  line-height: 1.55;
}


/* ==========================================================
   LEARNING DETAILS
   ========================================================== */

.learning-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);

  gap: 12px;

  margin-top: 10px;
}

.detail-box {
  padding: 14px 16px;

  background: #f6f9fd;

  border-radius: 9px;
}

.detail-box h3 {
  margin: 0 0 8px;

  color: var(--text-main);

  font-size: 13px;
  font-weight: 800;
}

.detail-box p {
  margin: 0;

  color: #5d6878;

  font-size: 13px;
  line-height: 1.55;
}

.detail-box ul {
  margin: 0;
  padding-left: 17px;

  color: #5d6878;

  font-size: 13px;
  line-height: 1.55;
}

.detail-box li {
  margin-bottom: 3px;
}


/* ==========================================================
   BOOK FOOTER
   ========================================================== */

.book-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;

  gap: 10px;

  margin-top: 10px;
}

.book-focus {
  color: #526174;

  font-size: 11px;
  font-weight: 600;
}

.tool-link {
  color: var(--accent);

  font-size: 11px;
  font-weight: 700;

  text-decoration: none;
}

.tool-link:hover {
  text-decoration: underline;
}


/* ==========================================================
   WHERE SHOULD I START?
   ========================================================== */

.start-section {
  max-width: 1120px;

  margin: 5px auto 0;

  padding: 0 20px 16px;
}

.start-card {
  display: grid;

  grid-template-columns: 70px minmax(0, 1fr) minmax(220px, 0.8fr);

  align-items: center;

  gap: 22px;

  padding: 24px;

  background: #f3f8ff;

  border: 1px solid #dceafa;
  border-radius: var(--radius);
}

.start-icon {
  width: 58px;
  height: 58px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #ffffff;

  font-size: 27px;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.start-card h2 {
  margin: 0 0 7px;

  color: var(--text-main);

  font-size: 18px;
}

.start-card p {
  margin: 0;

  color: var(--text-muted);

  font-size: 12px;
  line-height: 1.55;
}

.start-checklist {
  display: flex;
  flex-direction: column;

  gap: 8px;

  color: #526174;

  font-size: 12px;
  font-weight: 600;
}

.start-checklist div::first-letter {
  color: var(--accent);
}


/* ==========================================================
   FINAL NOTE
   ========================================================== */

.literacy-note {
  max-width: 1120px;

  margin: 0 auto;

  padding: 20px;

  text-align: center;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: #fbfcfe;
}

.literacy-note-icon {
  margin-bottom: 4px;

  font-size: 21px;
}

.literacy-note h3 {
  margin: 0 0 5px;

  color: var(--text-main);

  font-size: 14px;
}

.literacy-note p {
  max-width: 650px;

  margin: 0 auto;

  color: var(--text-muted);

  font-size: 11px;
  line-height: 1.55;
}


/* ==========================================================
   NAVIGATION ACTIVE STATE
   ========================================================== */

.nav-links a.active {
  color: var(--accent);
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 850px) {

  .learning-card {
    grid-template-columns: 54px 100px minmax(0, 1fr);
    gap: 15px;
  }

  .book-cover {
    max-width: 100px;
  }

  .book-cover img {
    height: 126px;
  }

  .start-card {
    grid-template-columns: 60px 1fr;
  }

  .start-checklist {
    grid-column: 2;
  }

}


/* ==========================================================
   TABLET / MOBILE
   ========================================================== */

@media (max-width: 700px) {

  .literacy-hero {
    padding-top: 50px;
  }

  .literacy-hero h1 {
    font-size: 36px;
  }

  .literacy-hero p {
    font-size: 15px;
  }


  /* Hide the connecting line on small screens */

  .learning-path::before {
    display: none;
  }


  .learning-card {
    grid-template-columns: 50px 90px minmax(0, 1fr);

    gap: 13px;

    padding: 14px 12px 14px 0;
  }

  .level-number {
    width: 36px;
    height: 36px;

    font-size: 12px;
  }

  .book-cover {
    max-width: 90px;
  }

  .book-cover img {
    height: 118px;
  }

  .learning-details {
    grid-template-columns: 1fr;
  }

  .start-card {
    grid-template-columns: 1fr;

    text-align: center;
  }

  .start-icon {
    margin: 0 auto;
  }

  .start-checklist {
    grid-column: auto;

    align-items: center;
  }

}


/* ==========================================================
   SMALL MOBILE
   ========================================================== */

@media (max-width: 500px) {

  .literacy-hero {
    padding: 42px 18px 28px;
  }

  .literacy-hero h1 {
    font-size: 32px;
  }


  .learning-intro {
    padding-left: 18px;
    padding-right: 18px;
  }


  .learning-path {
    padding-left: 14px;
    padding-right: 14px;
  }


  /*
     On very small screens we use:

     Number
     Cover + content

     This keeps the cards compact.
  */

  .learning-card {
    grid-template-columns: 42px 78px minmax(0, 1fr);

    gap: 10px;

    padding-right: 9px;
  }

  .level-number {
    width: 34px;
    height: 34px;
  }

  .book-cover {
    max-width: 78px;
  }

  .book-cover img {
    height: 104px;
  }

  .learning-meta {
    gap: 5px;
  }

  .level-name {
    font-size: 9px;
  }

  .difficulty {
    padding: 3px 7px;
    font-size: 9px;
  }

  .learning-content h2 {
    font-size: 15px;
  }

  .author {
    font-size: 12px;
  }

  .book-intro {
    font-size: 11px;
    line-height: 1.45;
  }

  .detail-box {
    padding: 10px 11px;
  }

  .detail-box h3 {
    font-size: 10px;
  }

  .detail-box p,
  .detail-box ul {
    font-size: 10px;
  }

  .book-footer {
    display: block;
  }

  .tool-link {
    display: inline-block;
    margin-top: 5px;
  }

  .start-section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .start-card {
    padding: 20px 16px;
  }

  .literacy-note {
    margin-left: 14px;
    margin-right: 14px;
  }

}