/* Premium Design Variables */
:root {
    --primary-color: #1A1A1D; /* Dark Charcoal */
    --secondary-color: #2D2D34; /* Light Charcoal */
    --accent-color: #D4AF37; /* Metallic Gold */
    --accent-hover: #C5A028; /* Darker Gold for hover */
    --background-light: #F9F9F9; /* Very light warm grey for page body */
    --text-dark: #333333;
    --text-muted: #777777;
    --card-bg: #FFFFFF;
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --gold-glow: 0 4px 15px rgba(212, 175, 55, 0.3);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Main Styles */
body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--background-light);
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: 90px; /* Space for sticky order bar */
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(26, 26, 29, 0.85), rgba(26, 26, 29, 0.95)), url('def.jpg') center/cover;
    color: white;
    padding: 4rem 1rem;
    text-align: center;
    border-bottom-left-radius: 2rem;
    border-bottom-right-radius: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 4px 4px 0 0;
}

.hero-title {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    color: white;
}

.hero-subtitle {
    font-weight: 300;
    color: #e2e8f0;
    font-size: 1.1rem;
}

.gold-text {
    color: var(--accent-color);
}

/* Day Filter Styles - Elegant Tabs */
.day-filter {
    margin-bottom: 2rem;
}

.filter-container {
    background: transparent;
    padding: 5px;
    margin: 0;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 0.5rem;
    /* Hide scrollbar */
    scrollbar-width: none; 
    -webkit-overflow-scrolling: touch;
}
.filter-container::-webkit-scrollbar {
    display: none;
}

@media (min-width: 768px) {
    .filter-container {
        justify-content: center;
        gap: 1rem;
    }
}

.day-pill {
    background: white;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    min-width: 110px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    position: relative;
}

.day-pill:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.day-pill.active {
    background: var(--primary-color);
    color: var(--accent-color);
    font-weight: 700;
    transform: translateY(-3px);
    box-shadow: var(--gold-glow);
}

.day-pill.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f5f9;
    color: #94a3b8;
    pointer-events: none;
    box-shadow: none;
}

/* Meal Section Titles */
.meal-section {
    margin-bottom: 2.5rem;
    animation: fadeIn 0.8s ease-out forwards;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    padding-right: 15px;
    position: relative;
}

.section-header h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 5px;
    bottom: 5px;
    width: 4px;
    background-color: var(--accent-color);
    border-radius: 4px;
}

/* Meal Grid & Cards */
.meal-grid {
    max-width: 1200px;
    margin: 0 auto;
}

.meal-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.8rem;
}

.meal-card {
    background-color: var(--card-bg);
    border: none;
    border-radius: 1.2rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.meal-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

.card-header {
    position: relative;
}

.card-header img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}

.meal-card:hover .card-header img {
    transform: scale(1.05);
}

.badge-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(26, 26, 29, 0.85);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 2;
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
    z-index: 2;
}

.meal-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.meal-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.meal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
    margin-top: auto;
}

.meal-price {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.meal-price span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.favorite-btn {
    background: var(--background-light);
    border: 1px solid #e2e8f0;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.favorite-btn:hover {
    background: #e2e8f0;
}

.favorite-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: var(--gold-glow);
    transform: scale(1.1);
}

/* Error and Empty States */
.error-message, .no-meals-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    background: white;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    grid-column: 1 / -1;
    font-size: 1.1rem;
}

/* Sticky Bottom Order Bar */
.sticky-order-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 15px 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 999;
    transform: translateY(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sticky-order-bar.show {
    transform: translateY(0);
}

.order-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.order-count {
    background: var(--accent-color);
    color: var(--primary-color);
    font-weight: bold;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.order-text {
    font-size: 1.1rem;
    font-weight: 500;
}

.checkout-btn {
    background: var(--accent-color);
    color: var(--primary-color);
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
}

.checkout-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--gold-glow);
}

/* Premium Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 29, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 550px;
    position: relative;
    overflow: hidden;
    animation: modalSlideUp 0.4s ease-out;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header-custom {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.modal-header-custom h2 {
    margin: 0;
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.close-modal {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--accent-color);
}

.modal-body-custom {
    padding: 2rem;
}

/* Form Styling within Modal */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.required {
    color: #e53e3e;
    margin-right: 4px;
}

.form-control-custom {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: var(--transition);
    background: #f8fafc;
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

textarea.form-control-custom {
    resize: vertical;
    min-height: 80px;
}

/* Radio Buttons */
.order-type-buttons {
    display: flex;
    gap: 1rem;
}

.radio-card {
    flex: 1;
    position: relative;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-card label {
    width: 100%;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.radio-card label i {
    font-size: 1.5rem;
}

.radio-card input:checked + label {
    border-color: var(--accent-color);
    background: rgba(212, 175, 55, 0.05);
    color: var(--primary-color);
}

.radio-card input:checked + label i {
    color: var(--accent-color);
}

/* Selected Items Area */
.selected-items-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.selected-items-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.selected-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px dashed #cbd5e1;
}
.selected-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 600;
    display: block;
}

.item-code {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.item-price {
    color: var(--accent-color);
    font-weight: 700;
    display: block;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 4px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.quantity-input {
    width: 45px;
    border: none;
    text-align: center;
    font-weight: 600;
    background: transparent;
}
.quantity-input:focus { outline: none; }

.btn-remove-item {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove-item:hover {
    background: #ef4444;
    color: white;
}

.submit-btn {
    background-color: var(--primary-color);
    color: var(--accent-color);
    padding: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
}

.submit-btn:hover {
    background-color: #000;
    box-shadow: var(--gold-glow);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .meal-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }

    /* Shrink the cards so that 3 per row looks good on mobile */
    .card-header img {
        height: 120px;
    }

    .badge-tag {
        font-size: 0.7rem;
        padding: 2px 8px;
        top: 8px;
        right: 8px;
    }

    .card-content {
        padding: 0.8rem;
    }

    .meal-title {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .meal-description {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }

    .meal-price {
        font-size: 1rem;
    }

    .meal-price span {
        font-size: 0.75rem;
    }

    .favorite-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    /* Other responsive overrides */
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .order-bar-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .checkout-btn {
        width: 100%;
    }
}