:root {
    --primary: #e91e63;
    --bg-dark: #0f0f13;
    --bg-card: #1e1e24;
    --text-white: #ffffff;
    --text-gray: #a0a0a0;
    --shadow: 0 10px 30px rgba(0,0,0,0.5);
    --radius: 12px;
}

body {
    background-color: var(--bg-dark);
    font-family: 'Poppins', sans-serif;
    color: var(--text-white);
    margin: 0;
    padding-bottom: 100px; /* Space for fixed bottom nav */
    overflow-x: hidden;
    min-height: 100vh;
}

html {
    background-color: var(--bg-dark);
    height: 100%;
}

/* --- FLOATING BUTTONS --- */
.floating-btn {
    width: 45px;
    height: 45px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
}
.floating-btn:active { transform: scale(0.9); background: var(--primary); }

/* --- SEARCH OVERLAY --- */
.search-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 15, 19, 0.98);
    backdrop-filter: blur(10px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}
.search-overlay.active { opacity: 1; pointer-events: auto; }

.search-container {
    max-width: 800px;
    margin: 60px auto 0 auto;
    text-align: center;
    padding: 0 15px; /* Tambah padding samping */
}

#search-input {
    width: 85%; /* Biar ga mentok kanan kiri */
    max-width: 500px; /* Batas maksimal lebar */
    margin: 0 auto; /* Rata tengah */
    display: block; /* Pastikan blok biar margin auto jalan */
    background: transparent;
    border: none;
    border-bottom: 2px solid #333;
    color: white;
    font-size: 1.5rem;
    padding: 15px 10px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}
#search-input:focus { border-color: var(--primary); }

/* --- GENRE BADGES --- */
.genre-pill {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: #eee;
    text-decoration: none;
    font-size: 0.85rem;
    font-family: inherit; /* Reset font button */
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 5px; 
    white-space: nowrap;
}
.genre-pill:hover {
    background: rgba(233, 30, 99, 0.5);
    border-color: var(--primary);
    transform: translateY(-2px);
    color: white;
}
.genre-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.4);
}
.genre-pill:active { transform: scale(0.95); }

/* --- HERO CAROUSEL --- */
.hero-section {
    position: relative;
    width: 100%;
    height: 40vh; /* Diperbesar dikit dari 35vh */
    min-height: 300px; /* Diperbesar dari 250px */
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.4);
    transition: background-image 0.5s ease-in-out;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(15,15,19,0.3), var(--bg-dark));
    z-index: 1;
}

.hero-slider-container {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    margin-top: 15px;
}

.hero-slide {
    display: none;
    flex-direction: row;
    align-items: center; 
    width: 100%;
    max-width: 1000px;
    gap: 20px;
    animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-slide.active { display: flex; }

.hero-poster {
    width: 130px; /* Diperbesar kembali dari 100px */
    aspect-ratio: 2/3;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    object-fit: cover;
    flex-shrink: 0;
    transform: rotate(-2deg);
    border: 2px solid rgba(255,255,255,0.1);
}

.hero-info {
    flex: 1;
    margin-bottom: 0; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.hero-badge {
    background: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem; /* Diperbesar */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: inline-block;
}

.hero-title {
    font-size: 1.5rem; /* Diperbesar dari 1.1rem */
    font-weight: 800;
    line-height: 1.2;
    margin: 5px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    font-size: 0.85rem; /* Diperbesar */
    color: #ddd;
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.hero-btn {
    display: inline-block;
    padding: 8px 20px;
    background: white;
    color: black;
    text-decoration: none;
    font-weight: 700;
    border-radius: 30px;
    font-size: 0.85rem;
    transition: transform 0.2s;
}
.hero-btn:active { transform: scale(0.95); }

/* --- SECTIONS --- */
.section-wrapper {
    margin-bottom: 2rem;
    padding-left: 1.5rem; /* Left align title */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-right: 1.5rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    position: relative;
    padding-left: 12px;
    color: #eee;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 20px;
    background: var(--primary);
    border-radius: 4px;
}

/* --- HORIZONTAL SCROLL LIST --- */
.horizontal-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    padding-right: 1.5rem; /* End padding */
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.horizontal-list::-webkit-scrollbar { display: none; }

.h-item {
    min-width: 140px; 
    width: 140px;
    flex-shrink: 0;
    text-decoration: none !important; 
    color: inherit; 
    display: block; 
    transition: transform 0.2s;
    position: relative; /* Untuk positioning read btn */
}
.h-item:active { transform: scale(0.95); }

/* Class khusus untuk item di dalam Grid */
.grid-item {
    text-decoration: none !important;
    color: inherit;
    display: block;
    transition: transform 0.2s;
    position: relative;
    /* Reset width agar diatur oleh Grid */
    width: auto; 
    min-width: 0;
}
.grid-item:hover { transform: translateY(-5px); z-index: 2; }
.grid-item:active { transform: scale(0.95); }

/* --- GRID LIST (LATEST) --- */
.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px; 
    padding-right: 1.5rem;
    width: 100%; 
}

/* --- COMMON CARD STYLES --- */
.card-poster-box {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: var(--bg-card);
    margin-bottom: 10px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.card-poster-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
    display: block; 
}

.h-item:hover img, .grid-item:hover img { transform: scale(1.1); } 

.card-overlay {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 25px 8px 8px 8px; 
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    pointer-events: none; 
}

/* --- READ BUTTON ON CARD --- */
.card-read-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 5;
    transition: transform 0.2s, background 0.2s;
    pointer-events: auto; 
}

.h-item:hover .card-read-btn, .grid-item:hover .card-read-btn { 
    transform: scale(1.1);
    background: white;
    color: var(--primary);
}

.card-badge {
    font-size: 0.75rem; 
    color: #ffc107;
    font-weight: 600;
    text-shadow: 0 1px 2px black;
}

.card-title {
    font-size: 0.95rem; 
    font-weight: 500;
    color: #eee;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none !important; /* Pastikan tidak ada underline */
}

/* --- SKELETON LOADING --- */
.skeleton {
    background: #1e1e24;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0.1) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
}

.skeleton-card {
    border-radius: var(--radius);
    aspect-ratio: 2/3;
    background: #222;
    margin-bottom: 10px;
}

.skeleton-text {
    height: 15px;
    width: 80%;
    background: #222;
    border-radius: 4px;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* --- ANIMATIONS --- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- MEDIA QUERY FOR MOBILE & TABLET --- */
@media (max-width: 768px) {
    /* Search */
    .search-container { margin-top: 80px; }
    #search-input { font-size: 1.1rem; padding: 10px 5px; }
    .close-btn { 
        top: 25px !important; 
        right: 80px !important; /* Geser lebih jauh dengan !important */
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Hero */
    .hero-section { height: 300px; min-height: auto; }
    .hero-poster { width: 110px; }
    .hero-title { font-size: 1.3rem; }
    
    /* Layout */
    .section-wrapper { padding-left: 1rem; }
    .section-header, .horizontal-list, .manga-grid { padding-right: 1rem; }
}
