/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Ensure menu is hidden on load */
.menu-panel:not(.open) {
    display: none !important;
}

/* Menu Button */
.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: #45a049;
    transform: scale(1.1);
}

/* Menu Panel */
.menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    visibility: hidden;
}

.menu-panel.open {
    transform: translateX(0);
    visibility: visible;
}

.menu-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.menu-image {
    width: 90%;
    max-width: 400px;
    height: auto;
    margin: 80px auto 0;
    border-radius: 8px;
    object-fit: contain;
    display: block;
}

/* Mobile specific menu adjustments */
@media (max-width: 768px) {
    .menu-panel {
        padding: 15px;
    }
    
    .menu-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    .menu-image {
        margin-top: 70px;
        max-height: calc(100vh - 100px);
        object-fit: contain;
    }
}

/* Saved Customer Banner */
.saved-customer-banner {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.saved-customer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.saved-customer-content span {
    font-weight: 500;
    flex: 1;
}

.saved-customer-content button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.saved-customer-content button:hover {
    background: rgba(255,255,255,0.3);
}

.saved-customer-content button:last-child {
    padding: 6px 10px;
    font-weight: bold;
}

/* Returning Customer Button */
.returning-customer-btn {
    width: 100%;
    padding: 10px 15px;
    margin-top: 8px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.returning-customer-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.returning-customer-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Enhanced Customer Banner Styles */
.saved-customer-banner.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-left: 4px solid #155724;
}

.saved-customer-banner.not-found {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border: 2px solid #ffc107;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Screen management */
.screen {
    display: none;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen h2 {
    color: #4a5568;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.4rem;
}

/* Meal selection */
.meal-options {
    display: grid;
    gap: 8px;
}

.meal-group {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    transition: all 0.3s ease;
}

.meal-group:hover {
    border-color: #667eea;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.15);
}

.meal-group h3 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.meal-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.meal-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.meal-group input[type="number"] {
    width: 60px;
    padding: 4px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #667eea;
    background-color: #667eea;
    color: white;
    border-radius: 4px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qty-btn:hover:not(:disabled) {
    background-color: #5568d3;
    border-color: #5568d3;
}

.qty-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.qty-btn:disabled {
    background-color: #cbd5e0;
    border-color: #cbd5e0;
    cursor: not-allowed;
    opacity: 0.5;
}


.meal-group input[type="text"] {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.meal-group input:disabled {
    background-color: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.form-buttons {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-top: 30px;
}

.btn-next,
.btn-back,
.btn-submit,
.btn-new-order {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-next,
.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-next:hover,
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-back {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-back:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.btn-new-order {
    background: #48bb78;
    color: white;
    width: 100%;
    margin-top: 20px;
}

.btn-new-order:hover {
    background: #38a169;
    transform: translateY(-2px);
}

/* Order summary */
.order-details {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.order-details h3 {
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.order-details p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.order-details ul {
    list-style: none;
    padding-left: 0;
}

.order-details li {
    background: white;
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

/* Confirmation */
.confirmation-message {
    text-align: center;
    padding: 20px;
}

.confirmation-message h3 {
    color: #48bb78;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.confirmation-message p {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        margin-bottom: 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .screen {
        padding: 12px;
    }
    
    .screen h2 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .meal-options {
        gap: 6px;
    }
    
    .meal-group {
        padding: 8px;
    }
    
    .meal-group h3 {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .meal-group label {
        gap: 6px;
        font-size: 0.8rem;
    }
    
    .meal-group input[type="number"] {
        width: 50px;
        padding: 3px;
        font-size: 0.8rem;
    }
    
    .qty-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .meal-group input[type="text"] {
        padding: 3px 6px;
        font-size: 0.8rem;
    }
    
    .form-buttons {
        flex-direction: column;
        margin-top: 15px;
    }
    
    .btn-next,
    .btn-back,
    .btn-submit {
        width: 100%;
        margin-bottom: 10px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Mobile menu adjustments */
    .menu-toggle {
        width: 45px;
        height: 45px;
        font-size: 18px;
        top: 15px;
        left: 15px;
    }
    
    .menu-panel {
        padding: 15px;
    }
    
    .menu-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    .menu-image {
        width: 85%;
        max-width: 350px;
        height: auto;
        max-height: 70vh;
        margin: 70px auto 0;
        object-fit: contain;
        display: block;
    }
}

/* Loading and transitions */
.screen-transition {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.screen-transition.active {
    opacity: 1;
    transform: translateX(0);
}

/* Success states */
.success {
    border-color: #48bb78 !important;
    background-color: #f0fff4;
}

.error {
    border-color: #f56565 !important;
    background-color: #fed7d7;
}

/* Meal Type Selection */
.meal-type-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.meal-type-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.meal-type-checkbox:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.meal-type-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.meal-type-checkbox input[type="checkbox"]:checked + span,
.meal-type-checkbox:has(input[type="checkbox"]:checked) {
    background: #e6fffa;
    border-color: #4CAF50;
    color: #2d3748;
}

@media (max-width: 768px) {
    .meal-type-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .meal-type-checkbox {
        width: 100%;
        justify-content: center;
    }
}

/* Phone Loading Indicator */
.phone-loader {
    display: inline-block;
    margin-left: 10px;
    color: #4CAF50;
    font-size: 0.9rem;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
