* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f5f7fa;
    color: #172033;
    font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.site-width {
    width: min(1420px, calc(100% - 40px));
    margin: 0 auto;
}


/* =========================
   HEADER
========================= */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e6eaf0;
}

.header-inner {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            #0874bd,
            #09a2d5
        );
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 27px;
    font-weight: 800;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text strong {
    color: #066bb1;
    font-size: 24px;
    letter-spacing: -.5px;
}

.brand-text strong span {
    color: #f3a100;
}

.brand-text small {
    color: #8d98a8;
    letter-spacing: 3px;
    font-size: 9px;
}

.menu-button {
    display: none;
    border: 0;
    background: transparent;
    color: #172033;
    font-size: 26px;
}


/* =========================
   NAV
========================= */

.main-nav {
    background: #0879bc;
}

.nav-inner {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-inner a {
    min-height: 58px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    transition: .2s ease;
}

.nav-inner a:hover,
.nav-inner a.active {
    background: rgba(255,255,255,.11);
}


/* =========================
   MARKET SECTION
========================= */

.market-section {
    padding: 46px 0 34px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.heading-line {
    width: 4px;
    height: 42px;
    background: #0879bc;
    border-radius: 10px;
}

.eyebrow {
    display: block;
    color: #0780c7;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.3px;
    margin-bottom: 6px;
}

.section-heading h1,
.card-heading h2,
.stock-card-header h2,
.result-heading h2,
.history-heading h2 {
    margin: 0;
}

.section-heading h1 {
    font-size: 26px;
}

.market-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 10px;
}

.market-tabs button {
    white-space: nowrap;
    border: 1px solid #e1e6ec;
    background: #ffffff;
    color: #556174;
    border-radius: 8px;
    padding: 10px 17px;
}

.market-tabs button.active {
    color: #ffffff;
    background: #0879bc;
    border-color: #0879bc;
}

.market-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
}

.market-table-card,
.market-movers,
.stock-card,
.history-card {
    background: #ffffff;
    border: 1px solid #e3e8ee;
    border-radius: 14px;
    box-shadow: 0 5px 25px rgba(27,45,75,.045);
}

.market-table-card {
    padding: 22px;
}

.market-movers {
    padding: 22px;
}

.card-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.card-heading h2 {
    font-size: 20px;
}

.card-heading.compact {
    margin-bottom: 10px;
}

.live-pill,
.market-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #149448;
    background: #effbf3;
    border: 1px solid #d7f1df;
    border-radius: 30px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
}

.live-pill i,
.market-status i {
    width: 7px;
    height: 7px;
    background: #19a653;
    border-radius: 50%;
}


/* =========================
   TABLE
========================= */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.overview-table,
.stock-table,
.result-table,
.history-table {
    width: 100%;
    border-collapse: collapse;
}

.overview-table th {
    color: #788497;
    font-size: 12px;
    text-align: right;
    padding: 13px 12px;
    border-bottom: 1px solid #e5e9ef;
    background: #f8fafc;
}

.overview-table th:first-child {
    text-align: left;
}

.overview-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #edf0f4;
    text-align: right;
    white-space: nowrap;
    font-size: 13px;
}

.overview-table td:first-child {
    text-align: left;
    font-weight: 700;
}

.overview-table tbody tr:hover {
    background: #f8fbfd;
}

.flag {
    margin-right: 7px;
}

.up {
    color: #0b9f42 !important;
}

.down {
    color: #f03535 !important;
}


/* =========================
   MARKET MOVERS
========================= */

.mover-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #edf0f4;
}

.mover-item:last-child {
    border-bottom: 0;
}

.mover-item > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mover-item > div:last-child {
    text-align: right;
}

.mover-item strong {
    font-size: 13px;
}

.mover-item span {
    color: #7d8797;
    font-size: 12px;
}


/* =========================
   STOCK
========================= */

.stock-section {
    padding: 10px 0 35px;
}

.stock-card {
    overflow: hidden;
}

.stock-card-header {
    padding: 24px 26px;
    border-bottom: 1px solid #e7ebf0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.stock-card-header h2 {
    font-size: 22px;
}

.stock-card-header p {
    color: #7d8797;
    margin: 8px 0 0;
    font-size: 13px;
}

.stock-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
}

.stock-info-container {
    padding: 28px 25px;
    border-right: 1px solid #e7ebf0;
}

.main-price {
    color: #0879bc;
    font-size: 38px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -1.3px;
}

.realtime-text {
    color: #149448;
    font-size: 12px;
    font-weight: 700;
    margin: 10px 0 20px;
}

.stock-table td {
    border-bottom: 1px solid #e7ebf0;
    padding: 11px 2px;
    font-size: 13px;
}

.stock-table td:first-child {
    color: #758195;
}

.stock-table td:last-child {
    text-align: right;
    font-weight: 700;
    color: #172033;
}

.stock-chart {
    padding: 22px 24px 24px;
    min-width: 0;
}

.chart-top {
    min-height: 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chart-top > div:first-child {
    display: flex;
    gap: 18px;
    align-items: center;
}

.chart-live {
    color: #e73737;
    font-size: 12px;
    font-weight: 700;
}

#current-date {
    color: #7b8797;
    font-size: 12px;
}

.time-tabs {
    display: flex;
    gap: 4px;
}

.time-tabs button {
    border: 0;
    background: transparent;
    color: #7a8597;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 11px;
}

.time-tabs button.active {
    background: #0879bc;
    color: #fff;
}

.chart-area {
    width: 100%;
    height: 400px;
}

#myChart {
    width: 100% !important;
    height: 100% !important;
}


/* =========================
   RESULT TODAY
========================= */

.today-result {
    border-top: 1px solid #e7ebf0;
    padding: 25px;
}

.result-heading {
    margin-bottom: 17px;
}

.result-heading h2 {
    font-size: 20px;
}

.result-table {
    min-width: 650px;
}

.result-table th {
    padding: 12px 10px;
    background: #0879bc;
    color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    font-size: 13px;
}

.result-table td {
    padding: 17px 10px;
    text-align: center;
    border: 1px solid #dfe5ec;
    font-size: 14px;
}

.result-number {
    font-size: 20px !important;
    font-weight: 800;
    color: #0879bc;
}


/* =========================
   HISTORY
========================= */

.history-section {
    padding: 0 0 60px;
}

.history-card {
    padding: 25px;
}

.history-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-heading h2 {
    font-size: 21px;
}

.history-note {
    color: #8791a1;
    font-size: 12px;
}

.history-table {
    min-width: 760px;
}

.history-table th {
    background: #f4f8fb;
    color: #566275;
    padding: 13px 10px;
    border: 1px solid #e0e6ed;
    font-size: 12px;
}

.history-table td {
    padding: 12px 10px;
    text-align: center;
    border: 1px solid #e3e8ee;
    font-size: 13px;
}

.history-table tbody tr:nth-child(even) {
    background: #fafbfd;
}

.history-table tbody tr:hover {
    background: #f1f8fc;
}


/* =========================
   FOOTER
========================= */

.footer {
    background: #111b29;
    color: #ffffff;
    padding: 35px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    align-items: center;
}

.footer strong {
    font-size: 18px;
}

.footer p,
.footer span {
    color: #9ca8b8;
    font-size: 12px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1050px) {

    .market-grid {
        grid-template-columns: 1fr;
    }

    .stock-layout {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .nav-inner a {
        padding: 0 18px;
    }

}


@media (max-width: 768px) {

    .site-width {
        width: min(100% - 24px, 1420px);
    }

    .header-inner {
        min-height: 72px;
    }

    .menu-button {
        display: block;
    }

    .main-nav {
        display: none;
    }

    .main-nav.open {
        display: block;
    }

    .nav-inner {
        display: block;
        padding: 10px 0;
    }

    .nav-inner a {
        min-height: 45px;
        justify-content: flex-start;
        padding: 0 15px;
    }

    .market-section {
        padding-top: 25px;
    }

    .stock-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .stock-layout {
        grid-template-columns: 1fr;
    }

    .stock-info-container {
        border-right: 0;
        border-bottom: 1px solid #e7ebf0;
    }

    .chart-area {
        height: 320px;
    }

    .history-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

}


@media (max-width: 480px) {

    .brand-text strong {
        font-size: 19px;
    }

    .brand-icon {
        width: 42px;
        height: 42px;
    }

    .section-heading h1 {
        font-size: 22px;
    }

    .market-table-card,
    .market-movers,
    .history-card {
        padding: 16px;
    }

    .stock-card-header,
    .stock-info-container,
    .stock-chart,
    .today-result {
        padding: 18px;
    }

    .main-price {
        font-size: 32px;
    }

    .chart-top {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .chart-area {
        height: 270px;
    }

}