/* ================= THEME: BIRU SURATAN ==================
   Palet:
   -- Biru utama (primary): #1E88E5
   -- Biru gelap / navy:    #0B2A4A
   -- Biru langit:          #64B5F6
   -- Hover (lebih gelap):  #1565C0
   -- Ungu mendung:         #7E57C2
   -- Latar lembut:         #E7F1FF
   -- Sempadan lembut:      #C5DCFF
========================================================= */

/* ================= GLOBAL RESET & BASE ==================*/
* {
    -webkit-tap-highlight-color: transparent;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Georgia, serif;
    font-weight: 400;
    overflow-x: hidden;
    overflow-y: auto;
}

@media screen and (max-width: 768px) {
    body {
        font-family: Georgia, serif;
    }
}

* {
    -webkit-tap-highlight-color: transparent;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Georgia, serif;
    font-weight: 400;
    overflow-x: hidden;
    overflow-y: auto;
}

@media screen and (max-width: 768px) {
    body {
        font-family: Georgia, serif;
    }
}

/* ================= FONTAWESOME ICON AS LOGO ==================*/
.sn-icon-keyboard {
    color: #1E88E5;
    font-size: 1em !important;
    transition: color 0.3s ease;
}

.sn-icon-keyboard:hover {
    color: #1565C0;
}

/* ================= TOOGLE ICON ANIMATION ==================*/
.sn-toggle-icon {
    transition: transform 0.3s ease, opacity 0.3s ease;
    font-size: 1.2em;
    color: #333;
}

.sn-toggle-icon.fade-out {
    transform: scale(0.7);
    opacity: 0.2;
}

.sidebar.invisible {
    visibility: hidden;
}

/* ================= MOBILE TOP BAR ==================*/
.topbar {
    display: none;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 0.8em 1em;
    border-bottom: 1px solid #eee;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 60px;
}

.topbar-left {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

/* ================= MENU TOOGLE ==================*/
.menu-toggle {
    font-size: 1.2em;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
    cursor: pointer;
    z-index: 1001;
    position: fixed;
    top: 1em;
    right: 1em;
    display: none;
}

/* ================= LAYOUT ==================*/
.layout {
    display: flex;
    min-height: 100vh;
}

/* ================= SIDEBAR ==================*/
.sidebar {
    width: 250px;
    background: #f9f9f9;
    padding: 1.5em 1em;
    border-right: 1px solid #eee;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    transition: left 0.3s ease;
}

/* ================= PAGINATION LINKS FOR SIDEBAR ==================*/
.sidebar-pager {
    list-style: none !important;
    display: flex;
    justify-content: left !important;
    gap: 12px;
    padding-top: 8px;
}

.sidebar-pager a {
    padding: 0px 0px !important;
    border-radius: 6px;
    font-size: 12px !important;
    text-decoration: none;
    transition: background 0.3s ease;
    color: #1E88E5 !important;
}

.sidebar-pager a:hover {
    text-decoration: none;
}

/* ================= NAVIGATION ==================*/
.nav-brand {
    margin-bottom: 1em;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 1.2em;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
    display: block;
}

.nav-links a:hover {
    text-decoration: underline;
}

.brand-title,
.topbar .brand-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.brand-title img,
.topbar .brand-title img {
    width: 22px;
    height: auto;
    display: inline-block;
}

.brand-tagline,
.topbar .brand-tagline {
    font-size: 0.8em;
    color: #888;
    margin-top: 4px;
    line-height: 1.1;
}

/* ================= CONTENT ==================*/
.content {
    flex: 1;
    padding: 0;
    background-color: #fff !important;
}

section {
    padding: 2em 1em;
    max-width: 800px;
    margin: auto;
    scroll-margin-top: 80px;
    background-color: #fff;
}

body.steam-content-fix section {
    background-color: #fff !important;
    color: #000 !important;
}

.scroll-anchor {
    display: block;
    height: 80px;
    margin-top: -80px;
    visibility: hidden;
}

h2 {
    margin-bottom: 0.5em;
}

footer {
    text-align: center;
    padding: 2em 1em;
    font-size: 0.9em;
    color: #aaa;
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 768px) {
    .topbar {
        display: flex;
    }

    .menu-toggle {
        display: block;
        position: static;
        border: none;
        background: none;
        padding: 0;
        font-size: 1.2em;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        z-index: 1200;
        height: 100vh;
        transition: left 0.3s ease;
    }

    body.menu-open .sidebar {
        left: 0;
    }

    .sidebar .nav-brand {
        display: none;
    }

    body.menu-open {
        overflow: hidden;
    }
}

/* ===== Overlay ===== */
.overlay {
    display: none;
}

body.menu-open .overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1100;
}

/* ===== Sidebar Extra ===== */
.sidebar-extra {
    font-size: 0.9em;
    color: #444;
}

.sidebar-extra ul {
    list-style: none;
    padding-left: 0;
}

.sidebar-extra ul li a {
    color: #333;
    text-decoration: none;
}

.sidebar-extra ul li a:hover {
    text-decoration: underline;
}

/* ===== Miscellaneous ===== */
.novel-text {
    font-family: Georgia, serif;
    font-size: 1em;
    font-weight: 400;
    letter-spacing: 0.3px;
    white-space: pre-wrap;
    line-height: 1.8;
    margin-top: 1em;
    color: #333;
}

/* ===== Labels ===== */
.label {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
}

/* ===== Lists ===== */
.bullet-list {
    padding-left: 1em;
    list-style-type: disc;
}

.no-bullet {
    list-style-type: none;
    padding-left: 0;
}

/* ===== Custom Label ===== */
.label-sn {
    background: #D8ECFF;
    color: #1E88E5;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    font-weight: bold;
    font-size: 0.95em;
    margin-top: 15px;
}

@media (max-width: 768px) {
    header {
        margin-top: 60px;
        height: 450px;
        background-position: center 60%;
        background-size: cover;
    }

    .topbar {
        display: flex;
    }

    .topbar-left {
        display: flex;
        flex-direction: column;
        line-height: 1.2;
        gap: 2px;
    }

    .topbar .brand-title {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 1.05em;
        font-weight: bold;
        color: #333;
        margin-bottom: 0;
    }

    .topbar .brand-tagline {
        font-size: 0.75em;
        color: #888;
        margin-top: 0;
        line-height: 1.1;
    }

    .menu-toggle {
        font-size: 1.2em;
        padding: 2px 6px;
        border-radius: 6px;
        border: 1px solid #ddd;
        background: white;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 32px;
        width: 32px;
    }
}

.log-muted {
    color: #888;
    font-style: italic;
}

.nav-section-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: Georgia, sans-serif;
    font-size: 13px;
    margin: 40px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-section-link a:active {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.nav-link {
    flex: 1;
    text-align: center;
}

.nav-link.previous {
    text-align: left;
}

.nav-link.next {
    text-align: right;
}

.nav-link a {
    color: #1E88E5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link a:hover {
    color: #1565C0;
}

.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, #64B5F6, #0B2A4A, #1E88E5, #0B2A4A, #64B5F6);
    margin: 30px 0;
}

.nav-section-link.single {
    justify-content: flex-end;
}

@media (max-width: 768px) {
    body.page-inner {
        padding-top: 50px;
    }

    body.page-inner h1 {
        margin-top: 0;
    }
}

/* Loader wrapper */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s;
}

/* Hide when done */
#page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Spinner animation */
#page-loader .spinner {
    width: 40px;
    height: 40px;
    border: 5px solid #ccc;
    border-top: 5px solid #1E88E5;
    /* biru utama */
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 999;
    background: linear-gradient(to right, #64B5F6, #1E88E5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, transform 0.2s;
}

#scrollTopBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#scrollTopBtn.show {
    opacity: 1;
    visibility: visible;
}

.nav-links a.active {
    background-color: rgba(215, 236, 255, 0.92);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-weight: 500;
    border-radius: 4px;
    display: inline;
}

/* ================= ORDER CARD SECTION ==================*/
.order-grid-wrapper {
    width: 100%;
    margin: 40px auto;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

.order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding-left: 0;
    padding-right: 0;
}

.order-card {
    background: #F2F7FF;
    /* latar lembut biru */
    border: 1px solid #D6E4FF;
    /* sempadan lembut */
    border-radius: 10px;
    padding: 25px;
    font-family: Georgia, serif;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.order-card:hover {
    transform: translateY(-5px);
}

.order-title {
    color: #0B2A4A;
    /* navy */
    font-size: 1em;
    margin-bottom: 12px;
}

.order-card ul {
    list-style-type: none;
    padding-left: 0px;
    margin: 15px 0;
}

.order-card li {
    margin-bottom: 6px;
    font-size: 14px;
}

.order-note {
    font-size: 13px;
    font-style: italic;
    color: #444;
}

/* === Scrollbar Custom === (Optional kalau scroll digunakan) */
.order-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.order-scroll-container::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

.order-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

/* ================= SN HEADER OVERLAY STYLE ==================*/
/* ======= DESKTOP GRADIENT ======= */
.sn-header-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top right,
            rgba(11, 42, 74, 0.75),
            /* navy pekat */
            rgba(100, 181, 246, 0.45),
            /* biru langit */
            rgba(126, 87, 194, 0.20)
            /* ungu mendung pudar */
        );
    z-index: 1;
    pointer-events: none;
    transform: scaleX(-1);
}

/* ======= MOBILE GRADIENT (max 768px) ======= */
@media screen and (max-width: 768px) {
    .sn-header-banner::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(to top right,
                rgba(11, 42, 74, 0.70),
                rgba(100, 181, 246, 0.38),
                rgba(126, 87, 194, 0.18));
        z-index: 1;
        pointer-events: none;
        transform: scaleX(-1);
    }
}

/* Inject content inside (flex column) */
.sn-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding-left: 20px;
    padding-right: 20px;
}

/* Tajuk */
.sn-header-content h1 {
    font-size: 2.5em;
    font-family: Georgia, serif;
    margin-bottom: 16px;
}

.sn-header-content h2 {
    font-size: 2.1em;
    font-family: Georgia, serif;
    margin-bottom: 16px;
}

@media screen and (max-width: 768px) {
    .sn-header-content {
        padding-left: 24px;
        padding-right: 24px;
    }

    .sn-header-content h1 {
        font-size: 2.4em;
    }
}

.sn-subchapter-count {
    font-size: 16px;
    color: #dbd9d9;
    margin: 6px 0 20px 0;
    opacity: 0.9;
}

/* Butang di bawah tajuk */
.btn-theme-below {
    background-color: transparent;
    color: rgb(222, 217, 217);
    border: 1px solid rgb(188, 182, 182);
    padding: 6px 14px;
    font-size: 0.95em;
    font-family: Georgia, serif;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, border 0.3s;
}

.btn-theme-below:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: #fff;
}

/* === Custom Modal (No Bootstrap) === */
/* === SN.Modal Final Smooth Version === */
#themeModal {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
}

/* Open Modal */
#themeModal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Modal Box */
#themeModal .modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    width: 90%;
    max-width: 420px;
    margin: 10% auto;
    font-family: Georgia, serif;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
}

/* Animate In */
#themeModal.show .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Animate Out */
#themeModal.fade-out .modal-content {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
}

/* Close Button */
#themeModal .close-btn {
    position: absolute;
    top: 18px;
    right: 24px;
    font-size: 24px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

#themeModal .close-btn:hover {
    color: #000;
}

/* Title */
#themeModal .modal-content h5 {
    font-size: 1.2em;
    margin-bottom: 16px;
}

/* Buttons */
#themeModal .modal-content button.theme-btn {
    display: block;
    width: 100%;
    padding: 10px 0;
    margin: 8px 0;
    font-size: 0.95em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-family: Georgia, serif;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #themeModal .modal-content {
        margin-top: 25%;
        padding: 18px 16px;
    }
}

@media (max-width: 820px) {
    .layout {
        padding-bottom: max(50px, env(safe-area-inset-bottom));
    }

    .content {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .content section {
        flex: 1;
    }

    footer,
    .nav-section-link {
        padding-bottom: 30px;
    }
}

/* ================= SN HEADER PAGE WRITER - PENULIS ==================*/
.sn-writer-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top right,
            rgba(31, 64, 104, 0.75),
            /* biru gelap */
            rgba(126, 87, 194, 0.40),
            /* ungu mendung */
            rgba(144, 202, 249, 0.20)
            /* biru langit lembut */
        );
    z-index: 1;
    pointer-events: none;
    transform: scaleX(-1);
}

.sn-writer-banner h1 {
    position: relative;
    z-index: 2;
    font-size: 32px;
    font-weight: 500;
    margin: 0;
}

@media (max-width: 768px) {
    body.page-inner {
        padding-top: 50px;
    }

    body.page-inner h1 {
        margin-top: 0;
    }

    /* OVERRIDE untuk page writer — buang spacing atas */
    body.page-writer {
        padding-top: 0 !important;
    }
}

.sn-writer-overlay {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 20px;
    max-width: 800px;
}

.sn-writer-overlay h1 {
    font-size: 32px;
    font-weight: 500;
    margin: 0;
}

.writer-subdesc {
    font-size: 16px;
    color: #ffffff;
    margin-top: 12px;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInUp 0.9s ease-out forwards;
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .spacer-bottom {
        height: 120px;
    }
}