/* General Styles */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --dark-bg: #1e293b;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: <?php echo $bgColor; ?>;
    background-attachment: fixed;
    min-height: 100vh;
}

/* Navbar Styling */
.navbar {
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.navbar .btn {
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.navbar .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Restaurant Info Banner */
.restaurant-info-banner {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid #e2e8f0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.info-item div {
    flex: 1;
}

.info-item small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.info-item strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    word-break: break-word;
}

/* Container Background */
.main-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Search Bar */
.search-wrapper {
    position: relative;
}

.search-wrapper .input-group {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-wrapper .input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-wrapper .input-group-text {
    background: white;
    border: none;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.search-wrapper .form-control {
    border: none;
    padding: 0.875rem 1rem;
    font-size: 1rem;
}

.search-wrapper .form-control:focus {
    box-shadow: none;
}

/* Category Buttons */
.category-filter {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: none;
}

.category-filter .nav-item {
    margin: 0;
}

.category-filter .nav-link {
    border-radius: 50px !important;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: white;
    color: var(--text-primary);
}

.category-filter .nav-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.category-filter .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Card Image Wrapper */
.card-img-wrapper {
    height: 140px;
    overflow: hidden;
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    position: relative;
}

.card-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover .card-img-wrapper::after {
    opacity: 1;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img-top {
    transform: scale(1.08);
}

/* Price Badge */
.price-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* Card Styles */
.card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-body {
    padding: 0.75rem;
}

.card-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.3;
    font-size: 0.75rem;
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2em;
}

/* Add to Cart Button */
.add-to-cart {
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    font-weight: 600;
    font-size: 0.8rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    transition: all 0.3s ease;
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.add-to-cart i {
    font-size: 0.9rem;
}

/* Quantity Controls on Card */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.quantity-controls .qty-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 700;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.quantity-controls .qty-btn:hover {
    transform: scale(1.1);
}

.quantity-display {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    min-width: 25px;
    text-align: center;
}

/* Cart Badge */
.badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
    font-weight: 700;
}

/* Modal Styling */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-title {
    font-weight: 700;
    font-size: 1.5rem;
}

.modal-body {
    max-height: 65vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 20px 20px;
}

/* Customer Details Form */
#customerDetailsForm {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
}

#customerDetailsForm h6 {
    color: var(--text-primary);
    font-weight: 700;
}

#customerDetailsForm .form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

#customerDetailsForm .form-control {
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    padding: 0.625rem 0.875rem;
    transition: all 0.3s ease;
}

#customerDetailsForm .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Cart Items */
#cartItems .card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

#cartItems .card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

#cartItems .btn-sm {
    border-radius: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Checkout Button */
#checkoutBtn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    padding: 0.875rem;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

#checkoutBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

#checkoutBtn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Empty States */
#emptyCart, #noResults {
    padding: 3rem 1rem;
}

#emptyCart i, #noResults i {
    font-size: 4rem;
    opacity: 0.3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
        border-radius: 16px;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    
    .restaurant-info-banner {
        padding: 1rem;
    }
    
    .info-item {
        padding: 0.625rem;
    }
    
    .info-item i {
        font-size: 1.25rem;
        min-width: 35px;
    }
    
    .info-item strong {
        font-size: 0.875rem;
    }
    
    .category-filter {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .category-filter .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .main-container {
        padding: 0.75rem;
    }
    
    .card-img-wrapper {
        height: 120px;
    }
    
    .card-body {
        padding: 0.6rem;
    }
    
    .card-title {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    .card-text {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
        height: 1.8em;
        -webkit-line-clamp: 2;
    }
    
    .price-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        top: 6px;
        right: 6px;
    }
    
    .add-to-cart {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }
    
    .add-to-cart i {
        font-size: 0.85rem;
    }
    
    .quantity-controls .qty-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .quantity-display {
        font-size: 0.9rem;
        min-width: 20px;
    }
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-item {
    animation: slideIn 0.4s ease forwards;
}

.add-to-cart:active {
    animation: pulse 0.3s ease;
}

/* Scrollbar Styling */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
