/* Basic Setup */
@font-face {
    font-family: "Montserrat";
    src: url("/fonts/Montserrat-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    /* variable range */
    font-style: normal;
}

@font-face {
    font-family: "Montserrat";
    src: url("/fonts/Montserrat-Italic-VariableFont_wght.ttf")
        format("truetype");
    font-weight: 100 900;
    font-style: italic;
}

:root {
    --primary-color: #fff;
    --secondary-color: #20409a;
    --secondary-color-hover: #142e6c;
    --background-color: #e6ecf8;
    --footer-background-color: #ececec;
    --dark-text: #2e2e2e;
    --dark-highlight-text: #142e6c;
    --footer-text: #2b2a2a;
    --accent-red: #c01d1d;
    --accent-green: #298e29;
    --light-blue: #3c5bb0;
    --border-grey: #b8b8b8;
}

body {
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    color: var(--dark-text);
}

body.modal-open {
    overflow: hidden;
}

body * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
}

body h1 {
    font-size: 36px;
    line-height: 40px;
    font-weight: 700;
}

body h2 {
    font-size: 30px;
    line-height: 34px;
    font-weight: 700;
}

body h3 {
    font-size: 24px;
    line-height: 28px;
    font-weight: 600;
}

body h4 {
    font-size: 20px;
    font-weight: 600;
}

body .cta-text {
    font-size: 18px;
    font-weight: 500;
}

body a {
    color: var(--dark-text);
    text-decoration: none;
}

body footer,
.footer-text,
.footer-text-ojk {
    font-size: 12px;
}

/* Navbar Styling */
.navbar {
    padding: 20px 140px;
    background-color: var(--background-color);
    margin-bottom: 100px;
    position: fixed;
    z-index: 90;
    top: 0;
    left: 0;
    right: 0;
}

.navbar-logo {
    display: block;
}

.navbar-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 48px;
}

.navbar-menu * {
    flex: 1;
    white-space: nowrap;
}

.navbar-menu a,
.navbar-menu .dropdown-wrapper {
    color: var(--secondary-color);
}

.navbar-menu .dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.navbar-menu .dropdown-trigger {
    cursor: pointer;
}

.navbar-menu .dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--background-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 1000;
    min-width: 200px;
}

.navbar-menu .dropdown-content a {
    display: block;
    padding: 6px 0;
    text-decoration: none;
}

.navbar-menu .dropdown-content a:hover {
    font-weight: bold;
}

.navbar-menu a.active,
.sidebar-menu a.active {
    font-weight: bold;
}

.logout-menu {
    display: flex;
    gap: 5px;
    align-items: center;
}

.logout-menu button {
    color: var(--accent-red);
    display: flex;
    align-items: center;
    background-color: transparent;
    border: none;
    outline: none;
}

.logout-menu .logout-icon {
    margin-right: 15px;
}

/* Footer Styling */
footer {
    padding: 20px 140px;
}

#logo_footer {
    margin-left: -16px;
}

/* Page content styling */
#page-content-wrapper {
    width: 100%;
    transition: margin-left 0.3s ease-in-out;
    position: relative;
}

/* Content Body styling */
div#content-body,
footer {
    padding: 0 100px !important;
}

div#content-body {
    margin-top: 180px;
}

.btn-primary {
    background-color: var(--secondary-color) !important;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-top: 0 !important;
}

.btn-primary:hover {
    background-color: var(--secondary-color-hover) !important;
}

.page-title {
    margin-bottom: 100px;
    text-align: center;
    position: relative;
    display: grid;
    justify-content: center;
    align-items: center;
}

.page-title .back-btn {
    justify-self: flex-start;
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    position: absolute;
    cursor: pointer;
    color: black;
}

.custom-card {
    padding: 24px;
    box-shadow: 0 0 6px 0px rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    margin-top: 24px;
    margin-bottom: 58px;
}

/* Modal Styling */
div.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5); /* semi-transparent black */
    z-index: 99;
    display: none;
}
div.custom-modal {
    position: fixed;
    left: 100px;
    right: 100px;
    top: calc(50vh - 180px);
    padding: 24px;
    background-color: var(--primary-color);
    display: none;
    z-index: 100;
    border-radius: 12px;
}

.custom-modal .modal-title {
    color: var(--secondary-color);
    text-align: center;
}

.custom-modal > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 30px;
}

.custom-modal table tr td:first-child {
    padding-right: 36px;
}

.custom-modal-base-modal .custom-table-wrapper {
    max-height: 150px;
    overflow-y: auto;
}

.custom-modal .voucher-code {
    background-color: var(--background-color);
    width: 100%;
    text-align: center;
    padding: 10px;
}

.custom-modal .voucher-code h2 {
    color: var(--secondary-color);
    font-weight: normal;
}

.custom-modal #redeem-date-tr {
    display: none;
}

.logout-modal {
    z-index: 9999;
    width: 500px;
    height: 500px;
    display: block;
}

.hidden {
    display: none !important;
}

/* Logout Modal Styling */
#logout-modal {
    max-width: 400px;
    padding: 25px 0;
    margin: auto;
    border-radius: 12px;
}

#logout-modal .action {
    display: flex;
    column-gap: 20px;
}

#logout-modal .action .logout-btn {
    background-color: var(--accent-red) !important;
    opacity: 90%;
}

#logout-modal .action .logout-btn:hover {
    opacity: 100%;
}

#logout-modal #cancel-logout {
    background-color: transparent !important;
    color: var(--accent-red) !important;
    border: 1px solid var(--accent-red);
}

.modal-content .logout-content {
    display: flex;
    flex-direction: column;
    row-gap: 5px;
    align-items: center;
}

/* CSS For Panduan */
.opsi-panduan {
    width: 100%;
    display: flex;
    gap: 24px;
}

/* .opsi-panduan div:first-of-type {
    background-image: url("/images/panduan/apa_itu_ks_poin.png");
}

.opsi-panduan div:nth-of-type(2) {
    background-image: url("/images/panduan/cara_collect_poin.png");
}
.opsi-panduan div:nth-of-type(3) {
    background-image: url("/images/panduan/cek_poin.png");
} */
/* .opsi-panduan div:nth-of-type(4) {
    background-image: url("/images/panduan/cara_tukar_poin.png");
} */

.opsi-panduan div {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    /* background-color: yellow; */
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    aspect-ratio: 270 / 155;
    transition: transform 0.3s ease;
}

.opsi-panduan div img {
    width: 100%;
}

.opsi-panduan div:hover {
    transform: scale(1.05);
}

.section-panduan h2 {
    text-align: center;
    margin-bottom: 60px;
    color: var(--secondary-color);
}

.section-panduan {
    margin-bottom: 175px;
}

/* CSS for Popup Panduan */
#modal-panduan {
    padding: 0;
    overflow: hidden;
    left: 400px;
    right: 400px;
    top: calc(50vh - 280px);
}

#modal-panduan > div {
    row-gap: 0px;
}

#modal-panduan .modal-panduan-header {
    background: linear-gradient(to top, #20409a 0%, #0286cb 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 24px 48px;
}

#modal-panduan .modal-panduan-header * {
    color: var(--primary-color);
}

#modal-panduan .modal-description {
    padding: 48px;
    display: flex;
    flex-direction: column;
    row-gap: 24px;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
}

.modal-description li {
    margin-left: 20px;
}

.custom-modal-cara-collect-poin .modal-description {
    max-height: 600px !important;
}

#modal-panduan .modal-description table th {
    text-align: center;
}

#modal-panduan a {
    color: var(--secondary-color);
    font-weight: bold;
}

.dataTables_scrollBody {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    overflow: hidden;
}

.dataTables_scrollHeadInner table {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    overflow: hidden;
}

.table-responsive table {
    text-align: center;
    vertical-align: middle;
    border-collapse: collapse;
    width: 100% !important;
}

/* .table-responsive #DataTables_Table_0_wrapper .row:first-child,
.table-responsive #DataTables_Table_0_wrapper .row:last-child {
    display: none !important;
} */

.table-responsive .row:first-child,
.table-responsive .row:last-child,
.table-responsive .row:first-child,
.table-responsive .row:last-child {
    display: none !important;
}

.dataTables_scrollHeadInner {
    width: 100% !important;
}

.table-responsive table thead th {
    background-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
    vertical-align: middle;
}

.table-responsive table tr:nth-of-type(even) {
    background-color: var(--background-color);
}

.table-responsive-riwayat-poin {
    margin-bottom: 100px;
}

.mutasi-container {
    border-radius: 12px;
    overflow: hidden;
}

/* CSS for Responsive Navbar */
/* Hide sidebar by default */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 45vw;
    height: 100%;
    background-color: var(--primary-color);
    transition: right 0.3s ease;
    z-index: 100;
}

/* Show it when toggled */
.mobile-sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 17px 36px;
}

.sidebar-close-btn,
.modal-panduan-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
}

.sidebar-menu a,
.sidebar-menu #hubungiDropdown {
    display: block;
    text-decoration: none;
    padding: 24px 36px;
    text-align: right;
}

.sidebar-menu a.active,
.sidebar-menu a:hover,
.sidebar-menu #hubungiDropdown:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.hamburger {
    font-size: 1.8rem;
    background: none;
    border: none;
    display: none;
    cursor: pointer;
}

/* Styling for pagination */
.pagination-container {
    margin-bottom: 100px;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
}

.page-item {
    margin: 0 4px;
    border-radius: 4px;
}

.page-link {
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    outline: none;
    color: #333;
    text-decoration: none;
}

.page-item.active .page-link {
    background-color: var(--secondary-color);
    color: white;
}

.page-item.disabled .page-link {
    pointer-events: none;
    color: #888;
    background: transparent;
    border: none;
}

/* CSS for Input Date */
.date-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.date-filter-form .form-group {
    display: flex;
    flex-direction: column;
}

.date-filter-form label {
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.date-filter-form input[type="date"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}

.date-filter-form .btn {
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    margin-top: auto;
}

.empty-state {
    margin-bottom: 100px;
}

@media (max-width: 908px) {
    .kembali-rp-history,
    .kembali-mutasi-history {
        display: none;
    }
}

@media (max-width: 618px) {
    .kembali {
        display: none;
    }

    .rp-title,
    .mutasi-title {
        display: flex;
        flex-direction: column;
    }

    .custom-modal-base-modal table tr td {
        min-width: 133px;
    }
}

@media (max-width: 575px) {
    .pagination-container ul {
        font-size: 12px;
    }

    .pagination-container ul li a {
        padding: 8px;
    }

    .date-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 1400px) {
    #modal-panduan {
        left: 200px;
        right: 200px;
    }
}

/* Show hamburger only on mobile */
@media (max-width: 1024px) {
    #modal-panduan {
        left: 100px;
        right: 100px;
    }

    .hamburger {
        display: block;
    }

    .navbar-menu {
        display: none;
    }

    .sidebar-header .sidebar-logo img {
        width: 90px;
    }

    .logout-menu {
        width: 100%;
        padding: 24px 36px;
        display: flex;
        justify-content: flex-end;
        text-align: center;
    }

    .logout-menu button span:first-child {
        display: none;
    }

    .opsi-panduan {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory; /* Optional: snap to child divs */
        -webkit-overflow-scrolling: touch;
        gap: 16px; /* spacing between slides */
        padding: 12px;
    }

    .opsi-panduan > div {
        min-width: 60vw;
        scroll-snap-align: start; /* aligns with start edge */
        border-radius: 8px;
        padding: 16px;
        flex-shrink: 0;
    }
}

@media (max-width: 767px) {
    #modal-panduan {
        left: 50px;
        right: 50px;
    }

    div#content-body,
    footer {
        padding: 0 25px !important;
    }

    div#content-body {
        margin-top: 130px;
    }

    .navbar {
        padding: 20px 24px;
    }

    .navbar-logo img {
        width: 166px;
    }

    footer {
        padding: 20px 24px !important;
    }

    .opsi-panduan > div {
        min-width: 70vw;
    }
}

@media (max-width: 575px) {
    #modal-panduan {
        left: 25px;
        right: 25px;
    }

    body h1 {
        font-size: 24px;
        line-height: 32px;
    }

    body h2 {
        font-size: 20px;
        line-height: 28px;
    }

    body h3 {
        font-size: 18px;
        line-height: 24px;
    }

    /* ini tuh subtitle di figma nya */
    body h4 {
        font-size: 16px;
        line-height: 22px;
    }

    body p,
    body th,
    body td,
    body ol,
    body ul {
        font-size: 14px;
        line-height: 20px;
    }

    body .cta-text {
        font-size: 16px;
        line-height: 22px;
        padding: 10px !important;
    }

    body a {
        color: var(--dark-text);
    }

    .navbar {
        margin-bottom: 60px;
    }

    .page-title {
        margin-bottom: 50px;
    }

    div.custom-modal {
        left: 24px;
        right: 24px;
        padding: 16px;
    }

    .section-panduan h2 {
        margin-bottom: 24px;
    }

    .mobile-sidebar {
        width: 65vw;
    }

    .opsi-panduan > div {
        min-width: 80vw;
    }
}
