* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: #253248;
    background:
        linear-gradient(
            rgba(20, 20, 20, 0.76),
            rgba(20, 20, 20, 0.76)
        ),
        url("germany-bg.jpg") center center / cover fixed no-repeat;
}

.header {
    width: 100%;
    height: 70px;
    background: #e60000;
    position: relative;
    z-index: 10;
}

.header-inner {
    width: min(1400px, 100%);
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.logo {
    width: 210px;
    padding-left: 20px;
    font-size: 25px;
    font-weight: 900;
    font-style: italic;
    color: #111111;
    text-decoration: none;
    white-space: nowrap;
}

.nav {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 38px;
}

.nav a {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.nav a:hover {
    opacity: 0.8;
}

.reserve-btn {
    height: 38px;
    min-width: 130px;
    margin-right: 18px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffcc00;
    color: #9d0000;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.page-wrapper {
    width: min(1140px, calc(100% - 40px));
    min-height: calc(100vh - 70px);
    margin: 0 auto;
    padding: 10px 10px 140px;
    background: #ffffff;
}

.germany-banner {
    width: 100%;
    margin-bottom: 25px;
}

.germany-banner div {
    width: 100%;
    height: 46px;
}

.germany-banner .black {
    background: #050505;
}

.germany-banner .red {
    background: #e00000;
}

.germany-banner .gold {
    background: #ffcc00;
}

.market-section {
    padding: 0 20px;
}

.market-title {
    margin: 0 0 25px;
    font-size: 22px;
    color: #344055;
    font-weight: 700;
}

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

.sgx-current-price {
    margin-bottom: 8px;
    font-size: 32px;
    line-height: 1;
    color: #ff3333;
    font-weight: 700;
}

.sgx-change {
    margin-bottom: 28px;
    font-size: 12px;
    color: #ff3333;
    font-weight: 600;
}

.data-table {
    width: 100%;
}

.data-row {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #dedede;
    color: #777777;
    font-size: 11px;
}

.data-row strong {
    color: #5b6370;
    font-weight: 400;
}

.chart-area {
    min-width: 0;
}

.chart-controls {
    min-height: 32px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.chart-controls button {
    min-width: 58px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #999999;
    border-right: 0;
    background: #ffffff;
    color: #555555;
    font-size: 9px;
    cursor: pointer;
}

.chart-controls button:last-child {
    border-right: 1px solid #999999;
}

.chart-controls button.active {
    border: 2px solid #23a339;
    color: #18882b;
}

#chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

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

.result-row {
    width: 100%;
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    border: 1px solid #aeb4bc;
}

.result-close,
.result-number {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #aeb4bc;
    font-size: 10px;
    color: #354052;
}

.result-number {
    justify-content: space-around;
    gap: 15px;
}

.result-number strong {
    font-size: 11px;
}

.result-row > div:last-child {
    border-right: 0;
}

.update-date {
    margin-top: 22px;
    text-align: right;
    color: #a0a0a0;
    font-size: 9px;
}

.history-section {
    margin-top: 95px;
    padding: 0 0 20px;
}

.sgx-history-title {
    position: relative;
    margin: 0 0 16px;
    padding-left: 12px;
    font-size: 17px;
    line-height: 24px;
    color: #1a1a1a;
    font-weight: 600;
}

.sgx-history-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    background: #002b66;
    border-radius: 2px;
}

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

.sgx-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    border: 1px solid #c8d0db;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.sgx-history-table th,
.sgx-history-table td {
    height: 48px;
    padding: 10px;
    text-align: center;
    border-right: 1px solid #e2e7ed;
    border-bottom: 1px solid #d5dce5;
}

.sgx-history-table th:last-child,
.sgx-history-table td:last-child {
    border-right: 0;
}

.sgx-history-table th {
    background: #f7f8fa;
    color: #344055;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sgx-history-table td {
    color: #002b66;
    font-size: 12px;
    font-weight: 600;
}

.sgx-history-table tbody tr:last-child td {
    border-bottom: 0;
}

.sgx-history-table tbody tr:hover td {
    background: #fafcff;
}

.loading-text,
.no-data-text {
    color: #64748b !important;
    font-style: italic;
    font-weight: 400 !important;
}

.error-text {
    color: #ef4444 !important;
    font-weight: 500 !important;
}

.footer {
    width: 100%;
    height: 50px;
    background: #ffcc00;
}

@media (max-width: 1050px) {
    .nav {
        gap: 18px;
    }

    .nav a {
        font-size: 10px;
    }

    .market-grid {
        grid-template-columns: 250px minmax(0, 1fr);
        gap: 25px;
    }
}

@media (max-width: 800px) {
    .header {
        height: auto;
    }

    .header-inner {
        min-height: 60px;
        padding: 0 15px;
    }

    .logo {
        width: auto;
        padding: 0;
    }

    .nav,
    .reserve-btn {
        display: none;
    }

    .page-wrapper {
        width: calc(100% - 20px);
        padding: 10px 10px 80px;
    }

    .germany-banner div {
        height: 35px;
    }

    .market-section {
        padding: 0 5px;
    }

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

    .market-data {
        width: 100%;
    }

    #chart-container {
        height: 270px;
    }

    .history-section {
        margin-top: 60px;
    }
}

@media (max-width: 550px) {
    body {
        background: #ffffff;
    }

    .page-wrapper {
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    .germany-banner {
        margin-bottom: 20px;
    }

    .germany-banner div {
        height: 28px;
    }

    .market-title {
        font-size: 18px;
    }

    .sgx-current-price {
        font-size: 28px;
    }

    .chart-controls {
        justify-content: stretch;
    }

    .chart-controls button {
        min-width: 0;
        flex: 1;
        padding: 0 3px;
        font-size: 8px;
    }

    #chart-container {
        height: 230px;
    }

    .result-row {
        grid-template-columns: 1.2fr 1fr 1fr;
    }

    .result-close,
    .result-number {
        min-height: 36px;
        font-size: 9px;
    }

    .sgx-history-table th,
    .sgx-history-table td {
        height: 40px;
        padding: 7px 4px;
        font-size: 11px;
    }
}