/* Import Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    background-color: #343541; /* Default night mode */
    color: #ffffff;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Day Mode */
body.day-mode {
    background-color: #f7f7f8;
    color: #343541;
}

/* Header dengan Sidebar */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #2a2b32;
    border-bottom: 1px solid #444;
    z-index: 1000;
    transition: background-color 0.3s;
}

body.day-mode .header {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 24px;
    color: #00CEC8; /* Cyan color */
}

body.day-mode .logo h1 {
    color: #00CEC8; /* Tetap cyan */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-banner {
    font-weight: bold;
    background-color: #00CEC8; /* Cyan color */
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cart-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.cart-banner:hover::before {
    left: 100%;
}

.cart-banner:hover {
    transform: scale(1.05);
    background-color: #00b4b4;
    box-shadow: 0 5px 15px rgba(0, 206, 200, 0.4);
}

.settings-icon {
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.settings-icon:hover {
    transform: scale(1.1);
}

/* Grid Produk */
.products-container {
    margin-top: 80px;
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default mobile: 1 produk per baris */
    gap: 20px;
}

/* Desktop: 4 produk per baris */
@media (min-width: 769px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.product-card {
    background-color: #40414f;
    border: 1px solid #555;
    border-radius: 15px; /* Border lebih bulat */
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    overflow: hidden;
}

body.day-mode .product-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
}

.product-card:hover {
    transform: scale(1.05);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px; /* Border gambar lebih bulat */
}

.product-card h3 {
    margin: 10px 0;
    font-size: 18px;
}

.product-card p {
    font-size: 16px;
    color: #00CEC8; /* Cyan color */
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background-color: #40414f;
    padding: 20px;
    border-radius: 15px; /* Border modal lebih bulat */
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: zoomIn 0.3s ease;
}

body.day-mode .modal-content {
    background-color: #ffffff;
    color: #343541;
}

.cancel-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #ff4444;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cancel-btn:hover {
    background-color: #ff4444;
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 3px 10px rgba(255, 68, 68, 0.4);
}

#modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px; /* Border gambar modal lebih bulat */
}

#modal-title {
    margin: 10px 0;
    font-size: 24px;
}

#modal-price {
    font-size: 20px;
    color: #00CEC8; /* Cyan color */
}

#modal-description {
    margin: 10px 0;
}

#modal-purchases {
    font-size: 14px;
    color: #ccc;
}

body.day-mode #modal-purchases {
    color: #666;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.save-btn {
    background-color: #00CEC8; /* Cyan color */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.save-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.save-btn:hover::before {
    left: 100%;
}

.save-btn:hover {
    background-color: #00b4b4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 206, 200, 0.4);
}

.buy-now-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.buy-now-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.buy-now-btn:hover::before {
    left: 100%;
}

.buy-now-btn:hover {
    background-color: #e55a5a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Saved Items Modal Styles */
#saved-items {
    max-height: 300px;
    overflow-y: auto;
    margin: 20px 0;
}

.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #555;
    border-radius: 8px; /* Border saved item lebih bulat */
    padding: 10px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

body.day-mode .saved-item {
    border-bottom: 1px solid #e0e0e0;
}

.saved-item.removing {
    transform: translateX(100%);
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.saved-item button {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

.saved-item button:hover {
    transform: scale(1.1);
    background-color: rgba(255, 68, 68, 0.1);
}

.buy-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.buy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.buy-btn:hover::before {
    left: 100%;
}

.buy-btn:hover {
    background-color: #e55a5a;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.4);
}

/* Custom Alert Styles */
.custom-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #00CEC8; /* Cyan color */
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 300px;
}

.custom-alert.show {
    transform: translateX(0);
    opacity: 1;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-message {
    font-weight: 600;
}

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

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Blur untuk produk lain saat modal aktif */
.product-grid.blur .product-card {
    filter: blur(5px);
    pointer-events: none;
}