/* CSS Variable Design Tokens - Warm Elegant Cozy Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

:root {
    --bg-main: #0f0d0c;
    --bg-gradient: linear-gradient(135deg, #161210 0%, #0d0a09 100%);
    --bg-card: rgba(28, 24, 22, 0.85);
    --bg-glass: rgba(36, 30, 27, 0.65);
    
    --primary: #e65c00;
    --primary-gradient: linear-gradient(135deg, #ff751a 0%, #e65c00 100%);
    --primary-hover: #ff751a;
    --primary-light: rgba(230, 92, 0, 0.1);
    
    --accent: #d4af37; /* Warm gold */
    --accent-gradient: linear-gradient(135deg, #f3e092 0%, #d4af37 100%);
    
    --text-main: #f5f2f0;
    --text-muted: #a69a95;
    --text-light: #ffffff;
    
    --border: rgba(230, 92, 0, 0.15);
    --border-focus: rgba(230, 92, 0, 0.4);
    --border-glass: rgba(255, 255, 255, 0.05);
    
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.4);
    --shadow-glass: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-family: 'Outfit', 'Noto Sans TC', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(230, 92, 0, 0.3);
    border-radius: var(--radius-full);
}

/* Container & Mobile Frame Constraint */
.app-container {
    width: 100%;
    max-width: 480px; /* Constrain to standard mobile width */
    min-height: 100vh;
    background: rgba(15, 13, 12, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Top Banner Image with Restaurant Details Overlay */
.hero-banner {
    position: relative;
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, var(--bg-main) 0%, rgba(15, 13, 12, 0) 100%);
    z-index: 1;
}

.hero-logo-container {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 2;
}

.restaurant-logo {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-full);
    border: 3px solid var(--accent);
    background-color: #fff;
    padding: 2px;
    box-shadow: var(--shadow-md);
    object-fit: cover;
}

.restaurant-info {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.restaurant-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 2px;
}

.restaurant-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Language Selector (Decorative) */
.lang-selector {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    cursor: pointer;
}

/* Main Content Area */
.content-body {
    flex: 1;
    padding: 20px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Card Styling - Glassmorphic */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-glass);
    transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.glass-card:active {
    /* Subtle press effect */
    transform: scale(0.99);
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    letter-spacing: 0.5px;
}

/* Grid Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: span 2;
}

label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Custom Input Fields */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
select,
textarea {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-family: var(--font-family);
    font-size: 15px;
    padding: 12px;
    outline: none;
    transition: var(--transition-fast);
    width: 100%;
    -webkit-appearance: none;
}

input[type="date"] {
    position: relative;
}

/* Add calendar icon to date input */
input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: rgba(36, 30, 27, 0.85);
}

/* Custom Select Dropdowns */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    font-size: 10px;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

/* Segmented Control Tabs (Lunch/Dinner Selector) */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 16px;
    border: 1px solid var(--border-glass);
}

.segment-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 500;
    padding: 8px;
    text-align: center;
    transition: var(--transition-fast);
}

.segment-btn.active {
    background: var(--primary);
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

/* Time Slots Grid */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.slot-btn {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 4px;
    text-align: center;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.slot-btn.available:hover {
    border-color: var(--primary);
    color: var(--primary-hover);
    background: var(--primary-light);
}

.slot-btn.selected {
    background: var(--primary-gradient);
    border-color: var(--primary);
    color: var(--text-light);
    box-shadow: var(--shadow-md);
}

.slot-btn.unavailable {
    opacity: 0.25;
    background: rgba(0, 0, 0, 0.4);
    border-color: transparent;
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Child Seat Checkbox Accent */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-top: 6px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-main);
}

/* Count Selectors for Child Seats */
.count-picker {
    display: flex;
    align-items: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: fit-content;
}

.count-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    padding: 8px 16px;
    transition: var(--transition-fast);
}

.count-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.count-value {
    padding: 8px 12px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Buttons */
.btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 700;
    padding: 14px;
    text-align: center;
    transition: var(--transition-fast);
    width: 100%;
    box-shadow: var(--shadow-md);
    letter-spacing: 1px;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--text-muted);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4d4d 0%, #cc0000 100%);
}

.btn-danger:hover {
    background: #ff3333;
}

/* Notes helper */
.notes-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* Success & Reservation Info Card */
.success-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 30px 10px;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: rgba(46, 204, 113, 0.15);
    border: 2px solid #2ecc71;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #2ecc71;
    animation: scaleUp var(--transition-normal);
}

.booking-code-badge {
    background: rgba(212, 175, 55, 0.12);
    border: 1px dashed var(--accent);
    color: var(--accent);
    font-size: 20px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    letter-spacing: 2px;
    margin: 8px 0;
}

.summary-list {
    width: 100%;
    text-align: left;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

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

.summary-label {
    color: var(--text-muted);
}

.summary-value {
    font-weight: 500;
    color: var(--text-light);
}

/* Footer & Branding */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: auto;
}

/* Toast Message Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(20, 15, 12, 0.95);
    border: 1px solid var(--primary);
    color: var(--text-light);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    text-align: center;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    border-color: #ff4d4d;
    background: rgba(30, 10, 10, 0.95);
}

/* Admin Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
}

.admin-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.booking-item-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    position: relative;
}

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

.booking-item-name {
    font-weight: 600;
    font-size: 15px;
}

.booking-item-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.status-confirmed {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.status-cancelled {
    background: rgba(255, 77, 77, 0.15);
    color: #ff4d4d;
}

.booking-item-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.booking-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

.btn-mini {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    width: auto;
}

/* Holiday Date Chip */
.holiday-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.holiday-chip {
    background: rgba(230, 92, 0, 0.12);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.holiday-chip-remove {
    cursor: pointer;
    font-weight: bold;
    color: var(--primary);
}

/* Animations */
@keyframes scaleUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
