/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Variabel CSS */
:root {
    --primary: #e74c3c;
    --secondary: #2c3e50;
    --accent: #f39c12;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
}

body {
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background-color: var(--secondary);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent);
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--accent);
}

.admin-btn {
    background-color: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.admin-btn:hover {
    background-color: #e67e22;
}

.logout-btn {
    background-color: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
    display: none;
}

.logout-btn:hover {
    background-color: #c0392b;
}

.cart-btn {
    position: relative;
    color: white;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.cart-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://source.unsplash.com/random/1200x600/?food') no-repeat center center/cover;
    color: white;
    text-align: center;
    padding: 5rem 0;
    flex: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Produk Section */
.section-title {
    text-align: center;
    margin: 3rem 0 2rem;
    color: var(--secondary);
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--accent);
    margin: 0.5rem auto;
}

.section-subtitle {
    margin: 2rem 0 1rem;
    color: var(--secondary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.product-price {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Login Form */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-form {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

/* Admin Panel */
.admin-panel {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #c0392b;
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background-color: #e67e22;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #219653;
}

.btn-warning {
    background-color: var(--warning);
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.text-center {
    text-align: center;
}

.no-products {
    text-align: center;
    grid-column: 1 / -1;
    padding: 2rem;
    color: #7f8c8d;
    font-style: italic;
}

/* Footer */
footer {
    background-color: var(--secondary);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

/* Perbaikan untuk notifikasi */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    color: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 1001;
    display: none;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.show {
    display: block;
}

.notification.success {
    background-color: var(--success);
}

.notification.error {
    background-color: var(--danger);
}

/* Keranjang Belanja */
.cart-container {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.cart-table th,
.cart-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.cart-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--secondary);
}

.cart-table tbody tr:hover {
    background-color: #f8f9fa;
}

.quantity-form {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
        }
        
        .quantity-controls {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .quantity-btn {
            width: 30px;
            height: 30px;
            background-color: #4ecdc4;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 14px;
            transition: background-color 0.3s;
        }
        
        .quantity-btn:hover {
            background-color: #45b7af;
        }
        
        .quantity-btn:active {
            transform: scale(0.95);
        }
        
        .quantity-input {
            width: 50px;
            padding: 5px;
            border: 1px solid #ddd;
            border-radius: 4px;
            text-align: center;
            font-size: 14px;
            font-weight: bold;
            background-color: #f8f9fa;
        }

.remove-btn {
    background-color: var(--danger);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.remove-btn:hover {
    background-color: #c0392b;
}

.cart-total {
    text-align: right;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--secondary);
    margin-bottom: 2rem;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.empty-cart {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #bdc3c7;
}

/* Perbaikan untuk modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--danger);
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.close-modal:hover {
    background-color: #f5f5f5;
    border-radius: 50%;
}

/* Styling untuk gambar produk di keranjang */
.cart-product-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-product-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Styling untuk baris total */
.total-row {
    border-top: 2px solid #ddd;
    padding-top: 10px;
    margin-top: 10px;
}

/* Form Pembayaran */
.payment-methods {
    margin: 1.5rem 0;
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option:hover {
    border-color: var(--accent);
}

.payment-option.selected {
    border-color: var(--primary);
    background-color: #fff5f5;
}

.payment-option input {
    margin: 0;
}

.order-summary {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.summary-row:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary);
}

/* Success Animation */
.success-animation {
    text-align: center;
    padding: 2rem;
}

/* Styling untuk checkmark - SIMPAN YANG INI */
.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--success);
    margin: 0 auto 1rem;
    position: relative;
    animation: scaleIn 0.5s ease-out;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 25px;
    top: 35px;
    width: 20px;
    height: 40px;
    border: solid white;
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
}

/* @keyframes scaleIn - SIMPAN YANG INI */
@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}


.order-number {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Styling untuk badge pemesanan terbanyak */
.popular-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--accent);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.product-card {
    position: relative;
}

.product-purchase-count {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 0.5rem;
}

.login-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    display: block;
    border: 3px solid #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin-top: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    nav ul li {
        margin: 0.5rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .products {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .cart-table {
        font-size: 0.9rem;
    }

    .cart-table th,
    .cart-table td {
        padding: 0.5rem;
    }

    .cart-actions {
        flex-direction: column;
    }

    .payment-options {
        grid-template-columns: 1fr;
    }
}