/* Custom styles for the restaurant client */

/* Enhanced mobile design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Category section styling */
.category-section {
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    background: linear-gradient(135deg, #fafafa 0%, #f8f9fa 100%);
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.category-section:not(:last-child) {
    border-bottom: none;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #ef4444, #f97316, #eab308);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced cart design */
#cart-count.scale-items,
#cart-count-mobile.scale-items {
    transform: scale(1);
    animation: cartPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#cart-count:not(.scale-items),
#cart-count-mobile:not(.scale-items) {
    transform: scale(0);
}

@keyframes cartPop {
    0% { transform: scale(0.3) rotate(-20deg); }
    50% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Enhanced mobile header design */
.mobile-header-gradient {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile category buttons */
.category-btn {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.category-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;
}

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

.category-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 20px 40px rgba(239, 68, 68, 0.2);
}

.category-btn.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

/* Mobile-specific improvements */
@media (max-width: 640px) {
    body {
        background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    }
    
    /* Enhanced category layout */
    .category-btn {
        min-height: 80px;
        border-radius: 1rem;
        background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
        color: #374151;
        border: 2px solid #e5e7eb;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }
    
    .category-btn.active {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        color: white;
        border-color: transparent;
        box-shadow: 0 8px 25px rgba(239, 68, 68, 0.25);
    }
    
    .category-btn i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .category-btn span {
        font-size: 0.875rem;
        font-weight: 700;
    }
    
    /* Menu container improvements */
    #menu-container {
        background: white;
        border-radius: 1.5rem;
        padding: 1.5rem;
        margin-top: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    }
    
    /* Loading state improvements */
    #loading {
        background: white;
        border-radius: 2rem;
        margin: 2rem 1rem;
        padding: 3rem 2rem;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    }
}

/* Tablet and smaller */
@media (max-width: 768px) {
    header {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    }
    
    header .grid {
        grid-template-columns: 1fr 2fr 1fr;
        gap: 0.5rem;
    }
    
    header button {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        border-radius: 0.5rem;
        min-height: 2.5rem;
    }
    
    header button i {
        margin-right: 0.25rem;
    }
    
    .category-btn {
        padding: 0.75rem;
        min-height: 44px;
        min-width: 44px;
    }
    
    .category-btn i {
        font-size: 1.25rem;
    }
    
    header .flex.flex-col {
        gap: 0.25rem;
    }
    
    header .flex.flex-col .text-sm {
        font-size: 0.75rem;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    header {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%) !important;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3) !important;
    }
    
    header .grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.25rem;
    }
    
    header button {
        padding: 0.375rem 0.5rem;
        font-size: 0.625rem;
        min-width: 2.5rem;
        border-radius: 0.375rem;
    }
    
    /* Category grid for mobile */
    #category-filter .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }
    
    .category-btn {
        padding: 0.75rem 0.5rem;
        min-height: 60px;
    }
    
    .category-btn i {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    
    .category-btn span {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    }
    
    header button i {
        margin-right: 0.125rem;
        font-size: 0.75rem;
    }
    
    #table-info {
        font-size: 0.625rem;
    }
    
    .w-8, .h-8 {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    .w-10, .h-10 {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    #cart-count {
        width: 1rem;
        height: 1rem;
        font-size: 0.5rem;
        top: -0.25rem;
        right: -0.25rem;
    }
    
    .max-w-4xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Make restaurant name smaller on very small screens */
    header .text-white.font-bold {
        font-size: 0.625rem;
        letter-spacing: 0.025em;
    }
}

/* Category buttons styling */
.category-btn {
    transition: all 0.3s ease;
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.category-btn.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: scale(1.05);
}

/* Menu item styling - Modern cards */
.menu-item {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.1), transparent);
    transition: left 0.6s;
    z-index: 1;
}

.menu-item:hover::before {
    left: 100%;
}

.menu-item:hover {
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 25px 50px rgba(239, 68, 68, 0.15);
    transform: translateY(-8px) scale(1.02);
}

.menu-item img {
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item:hover img {
    transform: scale(1.1) rotate(1deg);
}

/* Add to cart button improvements */
.add-to-cart-btn {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.add-to-cart-btn:hover::before {
    width: 200%;
    height: 200%;
}

.add-to-cart-btn:active {
    transform: scale(0.95);
}

/* Line clamp utility */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Improved cart animation */
.cart-animation {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
    border: 4px solid white;
}

/* Mobile menu grid improvements for new cards */
@media (max-width: 640px) {
    .menu-item {
        margin-bottom: 1rem;
    }
    
    .menu-item .add-to-cart-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* Cart modal styling */
#cart-modal .bg-white {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Order notification styling */
#order-notification {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Mobile menu grid improvements */
@media (max-width: 640px) {
    /* Keep category grid intact - don't change category buttons layout */
    #category-filter .grid.grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Only modify menu items grid */
    #menu-container .grid.grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Simplified mobile cards */
    .menu-item {
        margin-bottom: 1rem;
        border-radius: 1rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }
    
    .menu-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    }
    
    .menu-item .add-to-cart-btn {
        width: 100%;
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    /* Better spacing for mobile */
    .category-section {
        background: white;
        border-radius: 1rem;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
}

/* Touch-friendly buttons on mobile */
@media (max-width: 768px) {
    .add-to-cart-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
    }
}

/* Accessibility improvements */
.focus\:outline-none:focus {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-red-500 {
        background-color: #dc2626;
    }
    
    .text-gray-600 {
        color: #374151;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .transition-all,
    .transition-colors,
    .transition-transform,
    .transition-shadow {
        transition: none;
    }
    
    .animate-spin,
    .animate-pulse {
        animation: none;
    }
    
    @keyframes cartPop {
        0%, 100% { transform: scale(1); }
    }
}

/* Dark header with better contrast */
header .text-white {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Enhanced button styling */
header button {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header button:hover {
    border-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
}

/* Cart count badge enhancement */
#cart-count {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.9);
}
