/* ==========================================================================
   Menu Selection Styles
   ========================================================================== */

/* Date Groups */
.date-group {
    margin-bottom: 2rem;
    animation: slideInUp 0.5s ease-out;
}

.date-header {
    color: #2c3e50;
    border-bottom: 3px solid #e9ecef;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.3rem;
    position: relative;
}

.date-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--info-color) 100%);
    border-radius: 2px;
}

/* Time Slots Grid */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.day-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Slot Cards */
.slot-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.slot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 50%, transparent 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.slot-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

.slot-card:hover::before {
    transform: scaleX(1);
}

.slot-card.selected {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.2);
}

.slot-card.selected::before {
    background: linear-gradient(90deg, transparent 0%, var(--success-color) 50%, transparent 100%);
    transform: scaleX(1);
}

.slot-card.selecting {
    animation: slotPulse 0.6s ease-in-out;
}

@keyframes slotPulse {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.02) translateY(-2px); }
}

.slot-time {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slot-time::before {
    content: '🕐';
    font-size: 1.1rem;
}

.slot-location {
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.slot-location strong {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.05rem;
}

.slot-capacity {
    color: var(--muted-color);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.price-info {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.price-info::before {
    content: '💰';
    font-size: 0.9rem;
}

.select-slot-btn {
    width: 100%;
    margin-top: auto;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Menu Items */
.category-description {
    color: var(--muted-color);
    font-style: italic;
    margin: 0;
    font-size: 0.95rem;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    position: relative;
    overflow: hidden;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--info-color) 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.menu-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.menu-item:hover::before {
    transform: scaleY(1);
}

.menu-item.has-quantity {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #f8fff9 0%, #f0fff4 100%);
}

.menu-item.has-quantity::before {
    background: linear-gradient(180deg, var(--success-color) 0%, #20c997 100%);
    transform: scaleY(1);
}

.item-info {
    flex: 1;
    margin-right: 1.5rem;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.item-name {
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.item-price {
    font-weight: 700;
    color: var(--success-color);
    font-size: 1.2rem;
    white-space: nowrap;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.item-description {
    color: var(--muted-color);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #138496 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
    color: #212529;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

/* Quantity Controls */
.item-controls {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 0.25rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.quantity-control:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.qty-minus,
.qty-plus {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.qty-minus:hover,
.qty-plus:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.qty-minus:active,
.qty-plus:active {
    transform: scale(0.95);
}

.qty-input {
    width: 60px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--dark-color);
    padding: 0.5rem 0.25rem;
}

.qty-input:focus {
    outline: none;
    background: rgba(0, 123, 255, 0.05);
    border-radius: 4px;
}

/* Order Summary */
.order-summary-card {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

#orderSummary {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#orderSummary::-webkit-scrollbar {
    width: 6px;
}

#orderSummary::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#orderSummary::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#orderSummary::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.order-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.order-item.new {
    animation: orderItemAdded 0.5s ease-out;
}

@keyframes orderItemAdded {
    0% {
        transform: scale(0.8) translateX(20px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) translateX(0);
    }
    100% {
        transform: scale(1) translateX(0);
        opacity: 1;
    }
}

.order-item-info {
    flex: 1;
    margin-right: 1rem;
}

.order-item-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.order-item-details {
    font-size: 0.8rem;
    color: var(--muted-color);
}

.order-item-price {
    font-weight: 700;
    color: var(--success-color);
    font-size: 1rem;
    white-space: nowrap;
}

.total-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
    border: 2px solid #dee2e6;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.total-row:last-child {
    margin-bottom: 0;
    padding-top: 0.75rem;
    border-top: 2px solid #dee2e6;
    font-size: 1.1rem;
    font-weight: 700;
}

.total-row.highlight {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    padding: 0.5rem;
    border-radius: 6px;
    margin: 0.5rem -0.5rem;
}

/* Reservation Summary */
.reservation-summary {
    padding: 0;
}

.reservation-summary h6 {
    color: var(--dark-color);
    margin: 1.5rem 0 0.75rem 0;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reservation-summary h6:first-child {
    margin-top: 0;
}

.reservation-summary p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: var(--muted-color);
}

.reservation-summary .order-items {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 0.75rem 0;
}

.reservation-summary .order-items .d-flex {
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.9rem;
}

.reservation-summary .order-items .d-flex:last-child {
    border-bottom: none;
}

.total-summary {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-top: 1rem;
}

.total-summary .d-flex {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.total-summary .d-flex:last-child {
    margin-bottom: 0;
    padding-top: 0.75rem;
    border-top: 2px solid #dee2e6;
    font-weight: 700;
    font-size: 1.05rem;
}

/* Party Size Modal */
#partySizeModal .modal-dialog {
    max-width: 400px;
}

#partySizeModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

#partySizeModal .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

#partySizeModal .modal-title {
    font-weight: 700;
}

#partySizeModal .btn-close {
    filter: invert(1);
}

#partySizeOptions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

#partySizeOptions .btn {
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#partySizeOptions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .day-slots {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 992px) {
    .order-summary-card {
        position: static;
        margin-top: 2rem;
    }
    
    .menu-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .item-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .item-controls {
        justify-content: center;
    }
    
    .item-info {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .slots-grid,
    .day-slots {
        grid-template-columns: 1fr;
    }
    
    .slot-card {
        padding: 1.25rem;
    }
    
    .menu-item {
        padding: 1.25rem;
    }
    
    .item-badges {
        justify-content: center;
    }
    
    .quantity-control {
        padding: 0.5rem;
    }
    
    .total-section {
        padding: 1.25rem;
    }
    
    #partySizeOptions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .item-header {
        text-align: center;
    }
    
    .item-name {
        font-size: 1rem;
    }
    
    .item-price {
        font-size: 1.1rem;
    }
    
    .order-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .order-item-info {
        margin-right: 0;
    }
    
    #partySizeOptions {
        grid-template-columns: 1fr;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .slot-card,
    .menu-item,
    .order-item,
    .btn,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .slot-card,
    .menu-item {
        border-width: 3px;
    }
    
    .badge {
        border: 2px solid currentColor;
    }
    
    .qty-minus,
    .qty-plus {
        border: 2px solid currentColor;
    }
}

/* Focus Styles */
.slot-card:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.menu-item:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .qty-minus,
    .qty-plus,
    .select-slot-btn {
        display: none !important;
    }
    
    .slot-card,
    .menu-item {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .badge {
        border: 1px solid #000 !important;
        background: none !important;
        color: #000 !important;
    }
}