/* =============================================
   Ostera Nova FoodGest — Design System
   Dark Mode Pub Theme
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700;800&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121e;
    --bg-elevated: #1a1a2e;
    --bg-card: #16162a;
    --bg-input: #1e1e35;
    --bg-hover: #22223a;
    --accent-primary: #e94560;
    --accent-primary-glow: rgba(233,69,96,0.3);
    --accent-secondary: #f5a623;
    --accent-success: #00c853;
    --accent-success-glow: rgba(0,200,83,0.2);
    --accent-info: #4fc3f7;
    --text-primary: #f0f0f5;
    --text-secondary: #8892b0;
    --text-muted: #5a607a;
    --text-inverse: #0a0a0f;
    --border: #2a2a42;
    --border-light: #3a3a55;
    --border-focus: var(--accent-primary);
    --glass: rgba(255,255,255,0.03);
    --glass-border: rgba(255,255,255,0.06);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px var(--accent-primary-glow);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', serif;
    --status-free: #ffffff;
    --status-occupied: #e94560;
    --status-waiting: #f5a623;
    --status-reserved: #4fc3f7;
}

/* ── Light Theme ── */
[data-theme="light"] {
    --bg-primary: #f4f5f7;
    --bg-secondary: #ffffff;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f0f1f4;
    --bg-hover: #e8e9ee;
    --accent-primary: #d63651;
    --accent-primary-glow: rgba(214,54,81,0.2);
    --accent-secondary: #e09400;
    --accent-success: #00a844;
    --accent-success-glow: rgba(0,168,68,0.15);
    --accent-info: #1a8fcf;
    --text-primary: #1a1a2e;
    --text-secondary: #555e78;
    --text-muted: #8892a6;
    --text-inverse: #ffffff;
    --border: #d8dbe3;
    --border-light: #c5c9d4;
    --border-focus: var(--accent-primary);
    --glass: rgba(0,0,0,0.02);
    --glass-border: rgba(0,0,0,0.06);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 12px var(--accent-primary-glow);
    --status-free: #1a1a2e;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }

h1,h2,h3,h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.25rem; }

.text-brand {
    font-family: var(--font-display);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 var(--space-md); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}
.card:hover { border-color: var(--border-light); box-shadow: var(--shadow-md); }
.card--interactive { cursor: pointer; }
.card--interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card--interactive:active { transform: translateY(0); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
    padding: 12px 24px; font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600;
    color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-fast);
    min-height: 48px; user-select: none; -webkit-tap-highlight-color: transparent;
    text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-light); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--accent-primary); border-color: var(--accent-primary); color: white; }
.btn--primary:hover { background: #d63d56; box-shadow: var(--shadow-glow); }
.btn--success { background: var(--accent-success); border-color: var(--accent-success); color: var(--text-inverse); }
.btn--success:hover { background: #00b347; }
.btn--warning { background: var(--accent-secondary); border-color: var(--accent-secondary); color: var(--text-inverse); }
.btn--sm { padding: 8px 16px; font-size: 0.85rem; min-height: 36px; border-radius: var(--radius-sm); }
.btn--lg { padding: 16px 32px; font-size: 1.1rem; min-height: 56px; border-radius: var(--radius-lg); }
.btn--icon { width: 48px; height: 48px; padding: 0; border-radius: var(--radius-md); font-size: 1.2rem; }
.btn--full { width: 100%; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--bg-hover); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    border-radius: var(--radius-full); white-space: nowrap;
}
.badge--free { background: rgba(255,255,255,0.08); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.2); }
.badge--occupied { background: rgba(233,69,96,0.15); color: var(--status-occupied); border: 1px solid rgba(233,69,96,0.3); }
.badge--waiting { background: rgba(245,166,35,0.15); color: var(--status-waiting); border: 1px solid rgba(245,166,35,0.3); animation: pulse-badge 2s ease-in-out infinite; }
.badge--reserved { background: rgba(79,195,247,0.15); color: var(--status-reserved); border: 1px solid rgba(79,195,247,0.3); }
.badge--pending { background: rgba(245,166,35,0.15); color: var(--status-waiting); border: 1px solid rgba(245,166,35,0.3); }
.badge--preparing { background: rgba(255,112,67,0.15); color: #ff7043; border: 1px solid rgba(255,112,67,0.3); animation: pulse-badge 1.5s ease-in-out infinite; }
.badge--ready { background: rgba(255,255,255,0.08); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.2); }

@keyframes pulse-badge { 0%,100%{opacity:1} 50%{opacity:0.6} }

.qty-stepper { display: flex; align-items: center; background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.qty-stepper__btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text-primary); font-size: 1.2rem; cursor: pointer; transition: background var(--transition-fast); }
.qty-stepper__btn:hover { background: var(--bg-hover); }
.qty-stepper__btn:active { background: var(--accent-primary); color: white; }
.qty-stepper__value { width: 40px; text-align: center; font-weight: 700; }

.input {
    width: 100%; padding: 12px 16px; font-family: var(--font-sans); font-size: 0.95rem;
    color: var(--text-primary); background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-md); outline: none; transition: all var(--transition-fast);
}
.input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-primary-glow); }
.input::placeholder { color: var(--text-muted); }
textarea.input { resize: vertical; min-height: 80px; }

.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10,10,15,0.85); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border); padding: 0 var(--space-md);
    height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.navbar__brand { display: flex; align-items: center; gap: var(--space-sm); font-size: 1.25rem; font-weight: 700; text-decoration: none; color: var(--text-primary); }
.navbar__links { display: flex; gap: var(--space-xs); }
.navbar__link { padding: 8px 16px; color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 0.9rem; border-radius: var(--radius-sm); transition: all var(--transition-fast); }
.navbar__link:hover,.navbar__link--active { color: var(--text-primary); background: var(--bg-hover); }

[data-theme="light"] .navbar {
    background: rgba(255,255,255,0.85); backdrop-filter: blur(20px);
}

.tab-bar { display: flex; flex-wrap: wrap; gap: var(--space-xs); padding: var(--space-sm); background: var(--bg-secondary); border-radius: var(--radius-lg); }
.tab-bar__item { padding: 8px 14px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); background: transparent; border: none; border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; font-family: var(--font-sans); }
.tab-bar__item:hover { color: var(--text-primary); background: var(--bg-hover); }
.tab-bar__item--active { color: white; background: var(--accent-primary); }

.toast-container { position: fixed; top: 80px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: var(--space-sm); pointer-events: none; }
.toast { display: flex; align-items: center; gap: var(--space-md); padding: 14px 20px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); color: var(--text-primary); font-size: 0.9rem; font-weight: 500; pointer-events: auto; animation: toast-in 0.4s cubic-bezier(0.4,0,0.2,1); max-width: 380px; }
.toast--success { border-left: 4px solid var(--accent-success); }
.toast--error { border-left: 4px solid var(--accent-primary); }
.toast--warning { border-left: 4px solid var(--accent-secondary); }
.toast--exit { animation: toast-out 0.3s ease forwards; }
.toast__icon { font-size: 1.3rem; flex-shrink: 0; }
.toast__close { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; padding: 4px; }
@keyframes toast-in { from{opacity:0;transform:translateX(100px)} to{opacity:1;transform:translateX(0)} }
@keyframes toast-out { to{opacity:0;transform:translateX(100px)} }

.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: var(--space-md); animation: fade-in 0.2s ease; }
.modal { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: var(--space-xl); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; animation: modal-in 0.3s cubic-bezier(0.4,0,0.2,1); box-shadow: var(--shadow-lg); }
.modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-lg); }
.modal__title { font-size: 1.3rem; font-weight: 700; }
.modal__close { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--bg-hover); border: none; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 1.2rem; cursor: pointer; }
.modal__close:hover { background: var(--accent-primary); color: white; }
.modal__body { margin-bottom: var(--space-lg); }
.modal__footer { display: flex; gap: var(--space-sm); justify-content: flex-end; }
@keyframes fade-in { from{opacity:0} to{opacity:1} }
@keyframes modal-in { from{opacity:0;transform:scale(0.95) translateY(10px)} to{opacity:1;transform:scale(1) translateY(0)} }

.divider { height: 1px; background: var(--border); margin: var(--space-md) 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-2xl); text-align: center; color: var(--text-muted); }
.empty-state__icon { font-size: 3rem; margin-bottom: var(--space-md); opacity: 0.5; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }

.ws-status { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-muted); }
.ws-status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.ws-status--connected .ws-status__dot { background: var(--accent-success); box-shadow: 0 0 6px var(--accent-success-glow); }

.animate-fade-in { animation: fade-in 0.3s ease; }
.animate-slide-up { animation: slide-up 0.3s cubic-bezier(0.4,0,0.2,1); }
@keyframes slide-up { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

@media (max-width: 768px) {
    html { font-size: 14px; }
    .container { padding: 0 var(--space-sm); }
    .card { padding: var(--space-md); border-radius: var(--radius-md); }
    .navbar { height: 56px; }
    h1 { font-size: 1.5rem; }
}
