/* -- VARIBLES DASAR -- */
:root {
    --header-bg: #1B263B;
    --header-text: #FFFFFF;
    --main-bg: #F8F8F8;
    --card-bg: #FFFFFF;
    --card-border: #CCCCCC;
    --link-color: #007BFF;
    --button-primary: #DC3545; 
    --button-secondary: #AAAAAA; 
}

/* -- RESET & BASE -- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--main-bg);
    color: #333;
}

/* -- HEADER -- */
.catalog-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 10px 50px;
    font-size: 1.2em;
    font-weight: bold;
    display: flex;
    align-items: center;
    border-bottom: 4px solid #0056b3;
}

/* -- MAIN CONTENT & SEARCH AREA -- */
.catalog-main {
    padding: 20px 50px;
}

/* --- Tombol Kembali ke Homepage --- */
.back-home-btn-catalog {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: white;
    background-color: var(--header-bg);
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 20px;
    transition: background-color 0.2s;
}

.back-home-btn-catalog i {
    margin-right: 8px;
}

.back-home-btn-catalog:hover {
    background-color: #384A64; 
}
/* ------------------------------------- */

.search-area {
    display: block; 
    margin-bottom: 30px;
}

.search-box {
    width: 100%;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 20px;
    box-sizing: border-box;
}

.search-box p:first-child {
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 10px;
}

.search-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #DDDDDD;
    box-sizing: border-box;
}

/* -- CATALOG GRID & ITEMS -- */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 30px;
    margin-top: 40px;
}

.catalog-item {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.item-cover-area {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.item-cover-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details {
    padding: 15px;
    text-align: center;
}

.item-meta {
    margin: 2px 0;
    font-size: 0.9em;
    color: #666;
}

.item-links {
    margin: 10px 0;
}

.item-links a {
    color: var(--link-color);
    margin: 0 5px;
    font-size: 1.2em;
}

/* -- BUTTONS (Samplework) -- */
.samplework-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    border-radius: 4px;
    transition: background-color 0.2s;
    background-color: var(--button-secondary);
    color: white;
    border: none;
    cursor: pointer;
    margin-bottom: 5px; 
}

.samplework-btn:hover {
    background-color: #999999;
}

/* -- BUTTONS (Jastip Now) -- */
.jastip-now-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 5px; /* Memberi jarak di bawah Samplework Button */
    margin-bottom: 0;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    border-radius: 4px;
    transition: background-color 0.2s;
    background-color: var(--button-primary); /* Menggunakan warna merah (DC3545) */
    color: white;
    border: none;
    cursor: pointer;
}

.jastip-now-btn:hover {
    background-color: #C82333; /* Sedikit lebih gelap saat hover */
}



/* ------------------- MODAL (POP-UP) STYLING (Satu Gambar) ------------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    max-width: 800px; 
    width: 90%;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--card-bg);
    border-bottom: 1px solid #EEEEEE;
}

#modalTitle {
    font-weight: bold;
    font-size: 1.2em;
}

.close-btn {
    background-color: var(--button-primary);
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    border-radius: 4px;
}

/* Styling Modal Body untuk Satu Gambar */
.modal-body-single {
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Styling untuk gambar yang dimasukkan melalui JS */
.modal-single-img {
    max-width: 100%; 
    height: auto; 
    border-radius: 5px; 
    margin-top: 10px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border: 1px solid #DDD;
}

/* Menyembunyikan placeholder yang tidak lagi digunakan */
.modal-single-placeholder {
    display: none; 
}


.rank-tag {
    position: absolute;
    padding: 5px 10px;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    border-radius: 3px;
    top: 30px; 
    left: 30px;
    z-index: 10;
}
.rank-tag.SSR { 
    background-color: #DC3545;
    transform: none;
    top: 30px;
    left: 30px;
}

/* Media Queries (Responsif Dasar) */
@media (max-width: 768px) {
    .catalog-header, .catalog-main {
        padding: 10px 20px;
    }
    .search-area {
        flex-direction: column;
    }
    .search-box {
        width: 100%;
        margin-bottom: 15px;
    }
    .modal-content {
        margin: 10% auto;
    }
    .rank-tag {
        top: 20px;
        left: 20px;
    }
}