:root {
    /* 🎨 Root Variabel Warna Utama */
    --color-dark: #0b0b0b;
    --color-shine: #ffffff;
    --color-gold: #d4af37;
    --color-red-crimson: #8b0000;

    /* 🌈 Warna Tambahan */
    --color-bg: var(--color-dark);
    --color-text: var(--color-shine);
    --color-border-gold: rgba(212, 175, 55, 0.3);
    --color-border-red: rgba(139, 0, 0, 0.3);
    --color-bg-red-soft: rgba(139, 0, 0, 0.2);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

h1 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-gold);
}

.tiktok-profile {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--color-gold);
    text-decoration: none;
    padding: 5px 12px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 20px;
    border: 1px solid var(--color-border-gold);
    transition: all 0.3s;
}

.tiktok-profile:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: scale(1.05);
}

.search-filter-section {
    background: var(--color-bg-red-soft);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--color-border-red);
}

.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.search-box input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--color-text);
    font-size: 0.8rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.search-box input::placeholder {
    color: rgba(212, 175, 55, 0.5);
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-gold);
}

.genre-slider {
    margin-bottom: 15px;
}

.genre-slider h2 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-gold);
}

.genre-tags {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 5px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--color-red-crimson) transparent;
}

.genre-tags::-webkit-scrollbar {
    height: 4px;
}

.genre-tags::-webkit-scrollbar-thumb {
    background: var(--color-red-crimson);
    border-radius: 2px;
}

.genre-tag {
    padding: 6px 12px;
    background: rgba(139, 0, 0, 0.3);
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    border: 1px solid transparent;
    font-size: 0.75rem;
}

.genre-tag:hover {
    background: rgba(139, 0, 0, 0.5);
}

.genre-tag.active {
    background: var(--color-red-crimson);
    border-color: var(--color-gold);
}

.filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 12px;
    background: rgba(139, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 6px;
    color: var(--color-gold);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.75rem;
}

.filter-btn:hover {
    background: rgba(139, 0, 0, 0.5);
    border-color: var(--color-gold);
}

.manga-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--color-gold);
}

.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.manga-card {
    background: var(--color-bg-red-soft);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--color-border-red);
}

.manga-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(139, 0, 0, 0.5);
    border-color: var(--color-gold);
}

.mangabox {
    position: relative;
}

.manga-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--color-red-crimson) 0%, #5a0000 100%);
    display: block;
}

.manga-status {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--color-gold);
}

.manga-info {
    padding: 8px;
}

.manga-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

.manga-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.meta-tag {
    padding: 2px 6px;
    background: rgba(139, 0, 0, 0.4);
    border-radius: 4px;
    font-size: 0.6rem;
    color: var(--color-gold);
}

.manga-code {
    color: var(--color-gold);
    font-size: 0.65rem;
    margin-bottom: 4px;
    font-family: monospace;
}

.manga-synopsis {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    margin-bottom: 6px;
}

.manga-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: var(--color-gold);
}

.alphabetical-section {
    margin-bottom: 15px;
}

.alpha-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--color-bg-red-soft);
    border: 1px solid var(--color-border-red);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 8px;
}

.alpha-toggle h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-gold);
}

.alpha-toggle-icon {
    color: var(--color-gold);
    transition: transform 0.3s;
}

.alpha-toggle-icon.expanded {
    transform: rotate(180deg);
}

.alphabetical-nav {
    display: none;
    gap: 5px;
    flex-wrap: wrap;
    padding: 8px;
    background: rgba(139, 0, 0, 0.1);
    border-radius: 6px;
}

.alphabetical-nav.show {
    display: flex;
}

.alpha-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(139, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--color-gold);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.3s;
}

.alpha-btn:hover,
.alpha-btn.active {
    background: var(--color-red-crimson);
    border-color: var(--color-gold);
    transform: scale(1.05);
}

.no-results {
    text-align: center;
    padding: 30px 10px;
    color: rgba(212, 175, 55, 0.6);
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    overflow-y: auto;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px;
}

.modal-content {
    background: linear-gradient(135deg, #1a0000 0%, #0b0b0b 100%);
    border: 2px solid var(--color-gold);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    position: relative;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: var(--color-red-crimson);
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    color: var(--color-gold);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    transform: rotate(90deg);
    color: var(--color-shine);
}

.modal-body {
    padding: 20px;
}

.modal-cover-container {
    text-align: center;
    margin-bottom: 15px;
}

.modal-cover {
    max-width: 120px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid var(--color-gold);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: 10px;
    text-align: center;
}

.modal-info-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.modal-info-item {
    display: flex;
    gap: 10px;
}

.modal-label {
    font-weight: 600;
    color: var(--color-gold);
    min-width: 80px;
}

.modal-value {
    color: var(--color-text);
    flex: 1;
}

.modal-synopsis {
    background: var(--color-bg-red-soft);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border-red);
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 0.85rem;

    max-height: 140px;       /* batas tinggi area */
    overflow-y: auto;        /* aktifkan scroll vertikal */
    scrollbar-width: thin;   /* untuk browser yang mendukung */
}

/* Language Buttons Container */
.modal-language-buttons {
    display: flex;
    gap: 10px;
}

.modal-lang-btn {
    width: 100%;
    padding: 12px;
    background: var(--color-red-crimson);
    color: var(--color-gold);
    border: 2px solid var(--color-gold);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-lang-btn:hover {
    background: var(--color-gold);
    color: var(--color-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

.modal-lang-btn.raw {
    background: linear-gradient(135deg, #8b0000 0%, #a01010 100%);
}

.modal-lang-btn.raw:hover {
    background: linear-gradient(135deg, #c41e3a 0%, #d4af37 100%);
}

.modal-lang-btn.english {
    background: linear-gradient(135deg, #1a3a52 0%, #2d5a7b 100%);
}

.modal-lang-btn.english:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #d4af37 100%);
}

.modal-lang-btn.indonesia {
    background: linear-gradient(135deg, #c41e3a 0%, #ffffff 50%, #ffffff 100%);
    color: #000;
    border-color: #8b0000;
}

.modal-lang-btn.indonesia:hover {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: var(--color-dark);
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination button {
    padding: 8px 12px;
    background: rgba(139, 0, 0, 0.3);
    border: 1px solid var(--color-border-gold);
    border-radius: 6px;
    color: var(--color-gold);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.8rem;
    min-width: 35px;
}

.pagination button:hover:not(:disabled) {
    background: rgba(139, 0, 0, 0.5);
    border-color: var(--color-gold);
}

.pagination button.active {
    background: var(--color-red-crimson);
    border-color: var(--color-gold);
    font-weight: 600;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--color-gold);
    font-size: 0.8rem;
}

/* 📱 Responsif */
@media (max-width: 768px) {
    h1 {
        font-size: 1.1rem;
    }

    .manga-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .manga-cover {
        height: 170px;
    }

    .search-box input {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .tiktok-profile {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .modal-content {
        margin: 10px;
    }

    .modal-cover {
        max-width: 80px;
    }

    .modal-title {
        font-size: 1rem;
    }

    .modal-lang-btn {
        font-size: 0.9rem;
        padding: 10px;
    }
}

@media (max-width: 360px) {
    .manga-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .manga-cover {
        height: 150px;
    }

    .modal-lang-btn {
        font-size: 0.85rem;
        padding: 8px;
    }
}