/* =========================================================
   DATA SGP / DATA HK - RESPONSIVE CENTERED WEBSITE
   Replace the existing /assets/style.css with this file.
   ========================================================= */

/* ---------- Base ---------- */
:root {
    --hk-primary: #087bfa;
    --hk-primary-dark: #0056b3;
    --hk-primary-soft: #eaf4ff;
    --hk-body-bg: #3b3b3b;
    --hk-surface: #ffffff;
    --hk-text: #252525;
    --hk-muted: #6c757d;
    --hk-border: #dee2e6;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 15px;
}

body {
    margin: 0;
    padding: 0 0 120px;
    overflow-x: hidden;
    background: var(--hk-body-bg);
    color: var(--hk-text);
    font-family: "Roboto", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.7;
}

a {
    color: var(--hk-primary);
}

a:hover {
    color: var(--hk-primary-dark);
    text-decoration: none;
}

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

/* ---------- Main centered page ---------- */
.site-wrapper {
    width: 100%;
    max-width: 1168px;
    min-height: 100vh;
    margin: 0 auto;
    overflow: hidden;
    background: var(--hk-surface);
    border-right: 2px solid #111111;
    border-left: 2px solid #111111;
    border-radius: 0;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
}

/* ---------- Navigation ---------- */
.site-wrapper .navbar {
    width: 100%;
    min-height: 70px;
    padding: 8px 18px;
    background: var(--hk-primary) !important;
}

.navbar-brand {
    margin-right: 20px;
    font-family: "Yellowtail", cursive;
    font-size: 30px;
    line-height: 1;
    white-space: nowrap;
}

.navbar-brand img {
    display: block;
    width: auto;
    max-width: 200px;
    height: 45px;
    object-fit: contain;
}

.navbar-dark .navbar-nav {
    align-items: center;
}

.navbar-dark .navbar-nav .nav-link {
    padding: 12px 13px !important;
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .active > .nav-link {
    color: #ffe08a;
}

.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ---------- Top banner ---------- */
.banner-top {
    width: 100%;
    max-width: 850px;
    margin: 10px auto 8px !important;
    padding: 0;
    text-align: center;
}

.banner-top a {
    display: block;
    width: 100%;
    margin: 0 auto;
}

.banner-top img {
    display: block;
    width: 100%;
    max-width: 850px;
    height: auto;
    margin: 0 auto;
    border: 0;
    object-fit: contain;
}

/* ---------- Content ---------- */
.content-section {
    width: 100%;
    max-width: 100%;
    padding: 25px 30px !important;
    background: #ffffff;
}

.content-section img {
    max-width: 100%;
    height: auto;
}

.page-title {
    color: #222222;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
}

.section-title {
    color: var(--hk-primary-dark);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
}

.lead-copy {
    font-size: 16px;
}

.content-section p {
    font-size: 15px;
    line-height: 1.75;
}

.content-section a {
    overflow-wrap: anywhere;
}

/* ---------- Year / archive navigation ----------
   Supports both the SGP and HK IDs. */
#listdatasgp,
#listdatahk,
.listpasaran {
    width: 100%;
    padding: 10px;
    background: #f5f5f5;
}

#listdatasgp .btn,
#listdatahk .btn,
.listpasaran .btn {
    display: block;
    margin-bottom: 8px;
    padding: 10px 34px 10px 12px;
    position: relative;
    text-align: left;
    white-space: normal;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

#listdatasgp .btn:last-child,
#listdatahk .btn:last-child,
.listpasaran .btn:last-child {
    margin-bottom: 0;
}

#listdatasgp a.btn::after,
#listdatahk a.btn::after {
    content: "\25BE";
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
}

#listdatasgp a.btn:hover,
#listdatasgp a.btn:focus,
#listdatahk a.btn:hover,
#listdatahk a.btn:focus {
    text-decoration: none;
}

.year-anchor-target {
    scroll-margin-top: 15px;
}

/* ---------- Loading state ---------- */
.data-loading {
    padding: 3rem 1rem;
    text-align: center;
}

.data-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ---------- Data tables ----------
   Tables can scroll horizontally on narrow screens. */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    width: 100%;
    min-width: 500px;
}

.table-responsive th,
.table-responsive td {
    padding: 9px 10px;
    white-space: nowrap;
    vertical-align: middle;
}

#dataSgpContent .table,
#dataHkContent .table {
    margin-bottom: 0;
}

#dataSgpContent .table th,
#dataHkContent .table th {
    color: #ffffff;
    text-align: center;
    vertical-align: middle;
    background: var(--hk-primary);
    border-color: #006fe6;
    font-weight: 700;
}

#dataSgpContent .table td,
#dataHkContent .table td {
    text-align: center;
    vertical-align: middle;
    border-color: var(--hk-border);
}

#dataSgpContent .tahun th,
#dataHkContent .tahun th {
    color: #ffffff;
    text-transform: uppercase;
    background: var(--hk-primary-dark);
}

/* ---------- FAQ ---------- */
#dataSgpFaqAccordion,
#dataHkFaqAccordion {
    width: 100%;
}

#dataSgpFaqAccordion .card,
#dataHkFaqAccordion .card,
.faq-card {
    width: 100%;
    border: 1px solid var(--hk-border);
}

#dataSgpFaqAccordion .card + .card,
#dataHkFaqAccordion .card + .card,
.faq-card + .faq-card {
    margin-top: 0;
}

#dataSgpFaqAccordion .card-header,
#dataHkFaqAccordion .card-header,
.faq-card .card-header {
    padding: 0;
}

#dataSgpFaqAccordion .btn,
#dataHkFaqAccordion .btn,
.faq-card .btn-link {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    white-space: normal;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
}

#dataSgpFaqAccordion .btn-link,
#dataHkFaqAccordion .btn-link {
    color: #252525;
}

#dataSgpFaqAccordion .btn-link:hover,
#dataSgpFaqAccordion .btn-link:focus,
#dataHkFaqAccordion .btn-link:hover,
#dataHkFaqAccordion .btn-link:focus {
    text-decoration: none;
}

#dataHkFaqAccordion .faq-arrow {
    transition: transform 0.25s ease;
}

#dataHkFaqAccordion .btn-link:not(.collapsed) .faq-arrow {
    transform: rotate(180deg);
}

/* ---------- Footer ---------- */
.site-footer {
    width: 100%;
    overflow-wrap: anywhere;
    background: var(--hk-primary) !important;
    font-size: 13px;
}

.site-footer nav {
    line-height: 2;
}

.site-footer a {
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* ---------- Floating bottom banner ---------- */
.floating-top,
.floating-bottom {
    position: fixed;
    z-index: 1001;
    left: 0;
    width: 100%;
    padding: 0;
    background: transparent;
    text-align: center;
}

.floating-top {
    top: 0;
}

.floating-bottom {
    bottom: 8px;
    left: 2%;
    width: 96%;
    max-width: 1850px;
}

.floating-bottom .btn-close {
    position: absolute;
    top: -42px;
    right: 5px;
    z-index: 10;
}

.floating-bottom img,
.banner-float img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

.banner-float {
    width: 100%;
}

.banner img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
}

/* ---------- Tablet ---------- */
@media (max-width: 991.98px) {
    .site-wrapper {
        max-width: 100%;
    }

    .site-wrapper .navbar {
        padding: 10px 15px;
    }

    .navbar-dark .navbar-nav {
        align-items: stretch;
    }

    .navbar-dark .navbar-nav .nav-link {
        padding: 9px 5px !important;
        white-space: normal;
    }

    .content-section {
        padding: 22px 20px !important;
    }

    .banner-top {
        width: 92%;
    }
}

/* ---------- Mobile ---------- */
@media (max-width: 767.98px) {
    body {
        padding-bottom: 85px;
        font-size: 13px;
        background: #3b3b3b;
    }

    .site-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        border-right: 2px solid #111111;
        border-left: 2px solid #111111;
        box-shadow: none;
    }

    .site-wrapper .navbar {
        min-height: 60px;
        padding: 8px 12px;
    }

    .navbar-brand {
        margin-right: 5px;
        font-size: 25px;
    }

    .navbar-brand img {
        max-width: 175px;
        height: 38px;
    }

    .navbar-toggler {
        padding: 5px 9px;
    }

    .site-wrapper .navbar-collapse {
        width: 100%;
        background: var(--hk-primary);
    }

    .navbar-dark .navbar-nav {
        width: 100%;
        align-items: stretch;
        padding: 8px 0;
    }

    .navbar-dark .navbar-nav .nav-link {
        display: block;
        padding: 10px 12px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        font-size: 14px;
        white-space: normal;
    }

    .banner-top {
        width: 94%;
        margin: 8px auto !important;
    }

    .banner-top a,
    .banner-top img {
        max-width: 100%;
    }

    .content-section {
        padding: 18px 12px !important;
    }

    .page-title {
        font-size: 22px;
    }

    .section-title {
        font-size: 19px;
    }

    .lead-copy {
        font-size: 14px;
    }

    .content-section p {
        font-size: 14px;
        line-height: 1.7;
    }

    #listdatasgp,
    #listdatahk,
    .listpasaran {
        padding: 8px !important;
    }

    #listdatasgp .btn,
    #listdatahk .btn,
    .listpasaran .btn {
        margin-bottom: 7px;
        padding: 9px 30px 9px 8px;
        font-size: 13px;
    }

    .table-responsive table {
        min-width: 500px;
        font-size: 13px;
    }

    .table-responsive th,
    .table-responsive td {
        padding: 7px 6px;
    }

    #dataSgpFaqAccordion .btn,
    #dataHkFaqAccordion .btn {
        padding: 12px !important;
        font-size: 14px;
    }

    #dataSgpFaqAccordion .card-body,
    #dataHkFaqAccordion .card-body {
        font-size: 14px;
        line-height: 1.7;
    }

    .site-footer {
        padding: 15px 8px !important;
        font-size: 11px;
    }

    .floating-bottom {
        bottom: 5px;
        left: 2%;
        width: 96%;
    }

    .floating-bottom .btn-close {
        top: -35px;
        right: 0;
        padding: 5px 8px;
        font-size: 11px;
    }

    .floating-bottom img {
        max-height: 75px;
    }
}

/* ---------- Very small mobile screens ---------- */
@media (max-width: 380px) {
    .page-title {
        font-size: 20px;
    }

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

    .navbar-brand img {
        max-width: 145px;
    }

    .content-section {
        padding: 15px 9px !important;
    }
}
