/* Reset khusus front-end */
* {
    box-sizing: border-box;
}

body {
    background-color: #0f172a !important; /* Dark Mode Canvas */
    color: #f8fafc !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a {
    color: #38bdf8;
    text-decoration: none;
}

/* Header Navbar */
.site-header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.site-title a {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f43f5e;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* Header Right Wrapper (Nav + Search Bar) */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Header Nav (Genre / Tipe Komik) */
.header-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.header-nav::-webkit-scrollbar {
    height: 4px;
}

.header-nav::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.nav-item {
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: #f8fafc;
    background: #334155;
}

/* Search Bar Styling */
.search-form {
    display: flex;
    align-items: center;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 2px 6px 2px 12px;
    transition: border-color 0.2s ease;
}

.search-form:focus-within {
    border-color: #f43f5e;
}

.search-field {
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-size: 0.85rem;
    width: 130px;
}

.search-field::placeholder {
    color: #64748b;
}

.search-button {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.85rem;
}

.search-button:hover {
    color: #f43f5e;
}

/* Container Reader & Layout Wrapper */
.reader-wrapper {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 10px;
}

.reader-header {
    background: #1e293b;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #334155;
    text-align: center;
}

.reader-header h1 {
    font-size: 1.6rem;
    color: #f8fafc;
    margin-bottom: 10px;
}

/* Comic Grid & Card Styling */
.comic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.comic-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.comic-card:hover {
    transform: translateY(-4px);
    border-color: #f43f5e;
}

/* Chapter List Area */
.chapter-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid #334155;
    color: #f8fafc;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.chapter-list a:hover {
    background: #1e293b;
    border-color: #f43f5e;
}

/* Reader Container */
.comic-reader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
}

.comic-reader-container p {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
}

.comic-reader-container img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: none;
}

/* Footer & Button */
.reader-footer {
    background: #1e293b;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    margin-bottom: 40px;
    border: 1px solid #334155;
    text-align: center;
}

.nav-links-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.btn-nav {
    background: #f43f5e;
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s ease;
    text-align: center;
}

.btn-nav:hover {
    background: #e11d48;
}

/* Responsif Mobile */
@media (max-width: 768px) {
    .site-header {
        padding: 12px 15px;
    }

    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .header-right {
        width: 100%;
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 10px;
    }

    .header-nav {
        width: 100%;
        gap: 6px;
    }

    .nav-item {
        font-size: 0.85rem;
        padding: 5px 12px;
        background: #0f172a;
        border: 1px solid #334155;
    }

    .search-form {
        width: 100%;
    }

    .search-field {
        width: 100%;
    }

    .reader-wrapper {
        padding: 0 10px;
        margin: 0 auto;
    }

    .comic-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .reader-header, .reader-footer {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .reader-header h1 {
        font-size: 1.2rem;
    }
}