/**
 * Modern Dine - Customer App Demo Styles
 */

:root {
    --brand: #e11d48;
    --brand-2: #fb7185;
    --ink: #0f172a;
    --soft: #f8fafc;
    --line: #e2e8f0;
    --success: #16a34a;
    --warn: #f59e0b;
}

body {
    font-family: 'Kanit', sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top left, #ffe4ec 0%, transparent 30%),
                radial-gradient(circle at top right, #ffe7df 0%, transparent 28%),
                #f8fafc;
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #fb7185;
    outline-offset: 2px;
}

html.theme-dark body {
    color: #e2e8f0;
    background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.18) 0%, transparent 34%),
                radial-gradient(circle at top right, rgba(30, 41, 59, 0.35) 0%, transparent 32%),
                #020617;
}

.view {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all .25s ease;
}

.view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.glass {
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

html.theme-dark .glass {
    background: rgba(15, 23, 42, .88);
}

.cat-scroll::-webkit-scrollbar,
.no-scroll::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    border-width: 1px;
    background: #16a34a;
    color: #ffffff;
    border-color: #15803d;
    transition: all .22s ease;
}

.cat-btn:hover {
    transform: translateY(-1px);
    background: #15803d;
    border-color: #166534;
}

.cat-btn.active {
    background: #166534;
    color: #ffffff;
    border-color: #14532d;
    box-shadow: 0 10px 18px rgba(21, 128, 61, .28);
}

.mode-btn.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    box-shadow: 0 10px 18px rgba(225, 29, 72, .25);
}

.favorite-on {
    color: var(--brand);
    fill: rgba(225, 29, 72, .18);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.drawer-open {
    transform: translateY(0) !important;
}

.overlay-open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.star-btn.active {
    color: #f59e0b;
    fill: rgba(245, 158, 11, .25);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, .45); }
    70% { box-shadow: 0 0 0 12px rgba(225, 29, 72, 0); }
    100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

.pulse {
    animation: pulse 2s infinite;
}

.order-action-locked {
    opacity: 0.55 !important;
    filter: grayscale(0.2);
    cursor: not-allowed !important;
}

.order-lock-banner {
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.15);
}

.session-status-pill {
    letter-spacing: 0.01em;
}

/* Navigation active state */
.nav-btn {
    color: #64748b;
    transition: color .2s ease;
    min-width: 44px;
}

.nav-btn:hover {
    color: #334155;
}

.nav-btn.text-slate-300 {
    color: #64748b !important;
}

.nav-btn.text-rose-500 {
    color: var(--brand) !important;
}

.nav-btn.text-rose-500 i {
    transform: translateY(-2px);
    filter: drop-shadow(0 4px 6px rgba(239, 68, 68, 0.3));
}

/* Utility classes */
.text-rose-500 {
    color: var(--brand);
}

.bg-rose-500 {
    background-color: var(--brand);
}

.bg-rose-200 {
    background-color: rgba(225, 29, 72, 0.2);
}

.shadow-rose-200 {
    box-shadow: 0 10px 40px rgba(225, 29, 72, 0.15);
}

.theme-btn.active {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(120deg, var(--brand), var(--brand-2)) !important;
    box-shadow: 0 8px 16px rgba(225, 29, 72, 0.2);
}

html.theme-dark .bg-white {
    background-color: #0f172a !important;
}

html.theme-dark .bg-white\/90,
html.theme-dark .bg-white\/92 {
    background-color: rgba(15, 23, 42, 0.9) !important;
}

html.theme-dark .bg-slate-50 {
    background-color: #111827 !important;
}

html.theme-dark .bg-slate-100 {
    background-color: #1e293b !important;
}

html.theme-dark .bg-slate-900 {
    background-color: #020617 !important;
}

html.theme-dark .border-slate-50,
html.theme-dark .border-slate-100,
html.theme-dark .border-slate-200 {
    border-color: #334155 !important;
}

html.theme-dark .text-slate-300,
html.theme-dark .text-slate-400,
html.theme-dark .text-slate-500 {
    color: #94a3b8 !important;
}

html.theme-dark .text-slate-600 {
    color: #cbd5e1 !important;
}

html.theme-dark .text-slate-700,
html.theme-dark .text-slate-800,
html.theme-dark .text-slate-900 {
    color: #e2e8f0 !important;
}

html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea {
    background-color: #0b1220;
    color: #e2e8f0;
    border-color: #334155 !important;
}

html.theme-dark input.bg-transparent {
    background-color: transparent !important;
    border-color: transparent !important;
}

html.theme-dark #food-search {
    color: #e2e8f0;
}

html.theme-dark #food-search::placeholder {
    color: #94a3b8;
}

html.theme-dark input[type="date"],
html.theme-dark input[type="time"] {
    color-scheme: dark;
    padding-right: 2.25rem;
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 1rem 1rem;
}

html.theme-dark input[type="date"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

html.theme-dark input[type="time"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15 15'/%3E%3C/svg%3E");
}

html.theme-dark input[type="date"]::-webkit-calendar-picker-indicator,
html.theme-dark input[type="time"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    width: 1.5rem;
    height: 1.5rem;
    cursor: pointer;
}

html.theme-dark .nav-btn:hover {
    color: #f8fafc;
}

html.theme-dark .nav-btn.text-slate-300 {
    color: #94a3b8 !important;
}

html.theme-dark .nav-btn.text-rose-500 {
    color: #fb7185 !important;
}

html.theme-dark .order-lock-banner {
    background: rgba(120, 53, 15, 0.28) !important;
    border-color: rgba(217, 119, 6, 0.45) !important;
}

html.theme-dark .session-status-pill.bg-rose-100 {
    background: rgba(136, 19, 55, 0.3) !important;
    color: #fda4af !important;
    border-color: rgba(244, 63, 94, 0.35) !important;
}

html.theme-dark .session-status-pill.bg-sky-100 {
    background: rgba(12, 74, 110, 0.35) !important;
    color: #7dd3fc !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
}

html.theme-dark .session-status-pill.bg-emerald-100 {
    background: rgba(6, 78, 59, 0.35) !important;
    color: #86efac !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
}

html.theme-dark .bg-rose-50 {
    background-color: rgba(136, 19, 55, 0.2) !important;
}

html.theme-dark .bg-rose-100 {
    background-color: rgba(136, 19, 55, 0.3) !important;
}

html.theme-dark .text-rose-600,
html.theme-dark .text-rose-700 {
    color: #fda4af !important;
}

html.theme-dark .bg-emerald-50 {
    background-color: #0f172a !important;
}

html.theme-dark .bg-emerald-100 {
    background-color: rgba(6, 78, 59, 0.35) !important;
}

html.theme-dark .text-emerald-600,
html.theme-dark .text-emerald-700,
html.theme-dark .text-emerald-800 {
    color: #86efac !important;
}

html.theme-dark .bg-amber-50 {
    background-color: #0f172a !important;
}

html.theme-dark .bg-amber-100 {
    background-color: rgba(120, 53, 15, 0.35) !important;
}

html.theme-dark .text-amber-700,
html.theme-dark .text-amber-800 {
    color: #fcd34d !important;
}

html.theme-dark .bg-sky-100 {
    background-color: rgba(12, 74, 110, 0.35) !important;
}

html.theme-dark .text-sky-600,
html.theme-dark .text-sky-700 {
    color: #7dd3fc !important;
}

/* Mobile-only shell */
.app-shell {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-surface {
    margin-left: auto;
    margin-right: auto;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 768px) {
    .app-shell:not(.desktop-enabled) {
        width: min(430px, 100vw);
        margin-left: auto !important;
        margin-right: auto !important;
        box-shadow: 0 22px 70px rgba(15, 23, 42, 0.14);
        border-left: 1px solid rgba(148, 163, 184, 0.24);
        border-right: 1px solid rgba(148, 163, 184, 0.24);
    }

    html.theme-dark .app-shell:not(.desktop-enabled) {
        box-shadow: 0 28px 82px rgba(2, 6, 23, 0.7);
        border-left-color: rgba(51, 65, 85, 0.6);
        border-right-color: rgba(51, 65, 85, 0.6);
    }

    .app-shell:not(.desktop-enabled) .app-surface {
        width: min(430px, 100vw) !important;
    }

    .app-shell.desktop-enabled {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: 0 !important;
    }

    .app-shell.desktop-enabled .app-surface {
        width: 100% !important;
    }
}

.desktop-layout {
    width: 100%;
}

.desktop-main {
    min-width: 0;
}

.desktop-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .desktop-layout {
        width: min(1240px, calc(100% - 2.5rem));
        margin-left: auto;
        margin-right: auto;
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 1.5rem;
        align-items: start;
    }

    .desktop-sidebar {
        display: block;
        position: sticky;
        top: 5.75rem;
    }

    .desktop-sidebar-card {
        border: 1px solid #e2e8f0;
        background: #ffffff;
        border-radius: 1.5rem;
        padding: 1rem;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    }

    .desktop-sidebar-title {
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .18em;
        color: #94a3b8;
        margin-bottom: .75rem;
    }

    .desktop-sidebar-nav {
        display: grid;
        gap: .35rem;
    }

    .desktop-sidebar-link {
        display: flex;
        align-items: center;
        gap: .7rem;
        border-radius: .9rem;
        padding: .6rem .72rem;
        font-size: .875rem;
        font-weight: 600;
        color: #475569;
        transition: background-color .18s ease, color .18s ease;
    }

    .desktop-sidebar-link:hover {
        background: #f1f5f9;
        color: #334155;
    }

    .desktop-sidebar-link.is-active {
        background: linear-gradient(120deg, #e11d48, #fb7185);
        color: #ffffff;
    }

    .desktop-sidebar-table {
        margin-top: 1rem;
        border: 1px solid #a7f3d0;
        background: #ecfdf5;
        border-radius: .9rem;
        padding: .55rem .72rem;
        font-size: .75rem;
        font-weight: 600;
        color: #047857;
    }

    .desktop-bottom-nav {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .desktop-sidebar {
        display: none !important;
    }
}

html.theme-dark .desktop-sidebar-card {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 18px 42px rgba(2, 6, 23, .58);
}

html.theme-dark .desktop-sidebar-title {
    color: #64748b;
}

html.theme-dark .desktop-sidebar-link {
    color: #cbd5e1;
}

html.theme-dark .desktop-sidebar-link:hover {
    background: #1e293b;
    color: #f1f5f9;
}

html.theme-dark .desktop-sidebar-link.is-active {
    color: #ffffff;
}

html.theme-dark .desktop-sidebar-table {
    background: rgba(6, 78, 59, .3);
    border-color: rgba(16, 185, 129, .45);
    color: #86efac;
}

@media (max-width: 360px) {
    .app-surface {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .nav-btn span {
        font-size: 9px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

#queue-join-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

#queue-join-modal.is-open {
    display: block;
}

#queue-join-modal .queue-join-backdrop {
    position: absolute;
    inset: 0;
}

#queue-join-modal .queue-join-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(32rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}


@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.animate-slide-up {
    animation: slideUp 0.35s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}
