/* ==========================================================
   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;

}