/* Style System: Modern Dark Mode & Mobile First */

:root {
    --bg-main: #090d16;
    --bg-card: rgba(17, 24, 39, 0.65);
    --bg-input: #151d30;
    --primary: #ff782e;
    --primary-gradient: linear-gradient(135deg, #ff782e 0%, #e05300 100%);
    --primary-glow: rgba(255, 120, 46, 0.35);
    --secondary: #3b82f6;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #64748b;
    
    --border: rgba(255, 255, 255, 0.06);
    --border-active: rgba(255, 120, 46, 0.5);
    --border-hover: rgba(255, 255, 255, 0.12);
    
    --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

html {
    overflow-x: hidden;
}

/* Background Ambient Glows */
body::before, body::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
}

body::before {
    top: 5%;
    left: -100px;
    background: var(--primary);
}

body::after {
    bottom: 15%;
    right: -100px;
    background: var(--secondary);
}

/* Container */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px 16px 120px 16px; /* Extra bottom padding for sticky footer */
}

/* Glassmorphism utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border);
}

.card {
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-md);
}

/* Header */
.app-header {
    margin-bottom: 24px;
    padding: 8px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.logo h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo h1 span {
    color: var(--primary);
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 400;
}

/* Icons Button */
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: rotate(30deg);
}

.icon-btn:active {
    transform: scale(0.95);
}

/* Form Styles */
.form-section {
    margin-bottom: 28px;
    animation: fadeInUp 0.5s ease forwards;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 0 4px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.section-header-row .section-title {
    margin-bottom: 0;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-gradient);
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-title h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.required {
    color: var(--danger);
}

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.badge-required {
    background: rgba(255, 120, 46, 0.1);
    color: var(--primary);
    border: 1px solid rgba(255, 120, 46, 0.2);
}

/* Input Fields */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    padding-left: 2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-dark);
    font-size: 1.1rem;
    pointer-events: none;
    transition: var(--transition);
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 120, 46, 0.15);
    background-color: rgba(21, 29, 48, 0.9);
}

.input-wrapper input:focus + .input-icon {
    color: var(--primary);
}

.error-msg {
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 500;
    padding-left: 4px;
    display: none;
}

.input-group.has-error input {
    border-color: var(--danger);
    background-color: rgba(239, 68, 68, 0.03);
}

.input-group.has-error .error-msg {
    display: block;
}

/* Dishes Grid & Cards */
.dishes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.dish-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.dish-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.dish-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 60%; /* 5:3 Aspect Ratio */
    background: #111827;
    overflow: hidden;
}

.dish-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.dish-card:hover .dish-img {
    transform: scale(1.05);
}

.dish-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    gap: 6px;
}

.dish-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.dish-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.dish-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary);
}

@media(min-width: 480px) {
    .dishes-grid {
        gap: 16px;
    }
    .dish-info {
        padding: 14px;
        gap: 8px;
    }
    .dish-name {
        font-size: 0.95rem;
    }
    .dish-price {
        font-size: 1.05rem;
    }
}

/* Checkbox and Radio indicator */
.dish-selector {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: transparent;
}

/* Checkbox specific indicator (square corner slightly) */
.dish-card.checkbox-type .dish-selector {
    border-radius: 6px;
}

.dish-selector i {
    font-size: 0.65rem;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: var(--transition);
}

/* Selected State */
.dish-card.selected {
    border-color: var(--primary);
    background: rgba(255, 120, 46, 0.04);
    box-shadow: 0 0 15px rgba(255, 120, 46, 0.1), var(--shadow-sm);
}

.dish-card.selected .dish-selector {
    border-color: var(--primary);
    background: var(--primary-gradient);
}

.dish-card.selected .dish-selector i {
    opacity: 1;
    transform: scale(1);
}

/* Sticky Footer Summary */
.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 10px 12px 14px;
    background: linear-gradient(to top, rgba(9, 13, 22, 0.98) 70%, rgba(9, 13, 22, 0) 100%);
    pointer-events: none;
}

.summary-wrapper {
    max-width: 600px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.summary-info {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.summary-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#summary-selection {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#summary-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

/* Buttons */
.btn {
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:active {
    transform: scale(0.98);
}

#btn-submit {
    flex-shrink: 0;
    height: 44px;
}

@media(min-width: 480px) {
    .sticky-footer {
        padding: 12px 16px 16px;
    }
    .summary-wrapper {
        padding: 12px 16px;
        gap: 16px;
    }
    #summary-selection {
        font-size: 0.82rem;
    }
    #summary-price {
        font-size: 1.25rem;
    }
    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
        gap: 10px;
    }
    #btn-submit {
        height: 48px;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

.modal {
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-body {
    padding: 20px;
}

.settings-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.helper-text {
    font-size: 0.75rem;
    color: var(--text-dark);
    margin-top: 4px;
}

.modal-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.modal-actions .btn {
    width: 100%;
}

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* Cart Item Styles (Step 2) */
.cart-items-list {
    display: flex;
    flex-direction: column;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cart-item:first-child {
    padding-top: 0;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item-price {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

.cart-quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.cart-qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: var(--bg-input);
    border: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.cart-qty-btn:hover {
    background: var(--primary-gradient);
}

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

.cart-qty-value {
    width: 24px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    -moz-appearance: textfield;
}

.cart-qty-value::-webkit-outer-spin-button,
.cart-qty-value::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-back-inline {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    transition: var(--transition);
}

.btn-back-inline:hover {
    color: var(--text-main);
}

/* Toast System */
#toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 360px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    box-shadow: var(--shadow-lg);
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    border: 1px solid var(--border);
}

.toast-success {
    background: rgba(16, 185, 129, 0.95);
    border-color: rgba(16, 185, 129, 0.3);
}

.toast-error {
    background: rgba(239, 68, 68, 0.95);
    border-color: rgba(239, 68, 68, 0.3);
}

.toast-info {
    background: rgba(59, 130, 246, 0.95);
    border-color: rgba(59, 130, 246, 0.3);
}

.toast-icon {
    font-size: 1.1rem;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 13, 22, 0.85);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-content p {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Keyframes Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes modalScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Language Switch */
.lang-switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 30px;
    cursor: pointer;
    user-select: none;
}

.lang-switch input {
    display: none;
}

.lang-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 30px;
    transition: var(--transition);
}

.lang-slider .knob {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    z-index: 2;
}

.lang-slider .text-vi,
.lang-slider .text-zh {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    font-weight: 800;
    transition: opacity 0.2s ease;
    z-index: 1;
    line-height: 1;
}

.lang-slider .text-vi {
    right: 8px;
    color: var(--text-muted);
    opacity: 1;
}

.lang-slider .text-zh {
    left: 8px;
    color: #fff;
    opacity: 0;
}

/* Checked States */
.lang-switch input:checked + .lang-slider {
    background: var(--primary-gradient);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.lang-switch input:checked + .lang-slider .knob {
    transform: translateX(36px);
}

.lang-switch input:checked + .lang-slider .text-vi {
    opacity: 0;
}

.lang-switch input:checked + .lang-slider .text-zh {
    opacity: 1;
}

