/* style.css */

:root {
    --primary-gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --shopee-color: #ff5722;
    --shopee-light: #ff8a65;
    --tokopedia-color: #42b549;
    --tokopedia-light: #76c579;
    --tiktok-color: #000000;
    --tiktok-light: #ff0050;
    --other-color: #9c27b0;
    --other-light: #ba68c8;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f9f9f9;
    margin: 0;
    padding: 0;
}

header {
    text-align: center;
    padding: 30px 15px 15px;
    background: var(--primary-gradient);
    color: white;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='0.1' d='M0,128L48,117.3C96,107,192,85,288,112C384,139,480,213,576,218.7C672,224,768,160,864,138.7C960,117,1056,139,1152,149.3C1248,160,1344,160,1392,160L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-position: center bottom;
}

header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    position: relative;
}

header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    position: relative;
}

.search-box {
    max-width: 400px;
    margin: 15px auto 0;
    display: flex;
    position: relative;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    outline: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-box input:focus {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    padding: 25px;
    max-width: 1200px;
    margin: auto;
}

.card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.platform-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 2;
    color: white;
}

.card.shopee .platform-badge {
    background: var(--shopee-color);
}

.card.tokopedia .platform-badge {
    background: var(--tokopedia-color);
}

.card.tiktok .platform-badge {
    background: var(--tiktok-color);
}

.card.other .platform-badge {
    background: var(--other-color);
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #eee;
    transition: transform 0.5s ease;
}

.card:hover img {
    transform: scale(1.05);
}

.card-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.4;
}

.card a {
    text-decoration: none;
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    border-radius: 8px;
    display: block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.card a.shopee-btn {
    background: var(--shopee-color);
}

.card a.shopee-btn:hover {
    background: #e64a19;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 87, 34, 0.3);
}

.card a.tokopedia-btn {
    background: var(--tokopedia-color);
}

.card a.tokopedia-btn:hover {
    background: #36923c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 181, 73, 0.3);
}

.card a.tiktok-btn {
    background: var(--tiktok-color);
}

.card a.tiktok-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.card a.other-btn {
    background: var(--other-color);
}

.card a.other-btn:hover {
    background: #7b1fa2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(156, 39, 176, 0.3);
}

.pagination {
    text-align: center;
    padding: 20px;
}

.pagination button {
    background: #6a11cb;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: #2575fc;
    transform: translateY(-2px);
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Tambahkan ini ke file style.css */

.image-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f5f5f5;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease, transform 0.5s ease;
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-container img[src$="placeholder.com"]~.image-placeholder,
.image-container img:not([src])~.image-placeholder {
    opacity: 1;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.image-container img.loaded {
    opacity: 1;
}

/* Perbaikan tambahan untuk tampilan yang lebih halus */
.card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.12);
}

/* Style untuk error message */
.error-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    flex-direction: column;
}

.error-content {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 400px;
}

.error-content i {
    font-size: 50px;
    color: #ff4757;
    margin-bottom: 15px;
}

.error-content h3 {
    margin: 0 0 10px;
    color: #333;
}

.error-content p {
    margin: 0 0 20px;
    color: #666;
}

.error-content button {
    background: #6a11cb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.error-content button:hover {
    background: #2575fc;
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    color: #6a11cb;
    font-size: 16px;
}

.shopping-icon {
    width: 70px;
    height: 70px;
    fill: #6a11cb;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-results i {
    font-size: 50px;
    margin-bottom: 15px;
    color: #ccc;
}

footer {
    background: #e2e8f0;
    padding: 20px;
    text-align: center;
    color: #4a5568;
    margin-top: 40px;
}

/* Responsiveness */
@media (max-width: 768px) {
    .container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        padding: 15px;
    }

    header {
        padding: 20px 15px 15px;
    }

    header h1 {
        font-size: 24px;
    }
}