/* ============================================================
   Jabs Kiosk · client/assets/app.css
   Customer kiosk · complete stylesheet
   ============================================================ */

/* ---------- RESET ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

:root {
    --bg: #fafcff;
    --ink: #1a1e2b;
    --ink-soft: #3e4a5c;
    --muted: #6d7a8c;
    --line: #eef2f6;
    --line-strong: #dfe6ef;
    --accent: #f39f86;
    --accent-soft: #f9d976;
    --green: #1e7b48;
    --red: #c0392b;
    --warn: #a1611a;
    --purple: #5c2d91;
    --card: #ffffff;
    --radius: 18px;
}

html,
body {
    height: 100%;
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: #f5f7fb;
}

body {
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 12px;
    min-height: 100vh;
}

/* ---------- KIOSK SHELL ---------- */
.kiosk {
    max-width: 1100px;
    width: 100%;
    height: calc(100vh - 24px);
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* ---------- SPLASH ---------- */
.splash {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: linear-gradient(145deg, #1a1e2b, #2a2f3f);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
    padding: 20px;
    transition: opacity .5s ease, visibility .5s ease;
}

.splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(to right, var(--accent-soft), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.splash h1 i {
    -webkit-text-fill-color: var(--accent-soft);
    margin-right: 8px;
}

.splash .sub {
    font-size: 1.05rem;
    opacity: .8;
    margin-bottom: 36px;
}

.splash .tap {
    padding: 15px 42px;
    border-radius: 60px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    animation: pulse 2.2s infinite;
    transition: background .2s ease, transform .15s ease;
}

.splash .tap:hover {
    background: rgba(255, 255, 255, .22);
    transform: scale(1.02);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(249, 217, 118, .45);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(249, 217, 118, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(249, 217, 118, 0);
    }
}

.splash-foot {
    position: absolute;
    bottom: 24px;
    font-size: .72rem;
    opacity: .4;
}

/* ---------- HEADER ---------- */
.kiosk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.kiosk-header h2 {
    font-size: 1.4rem;
    color: var(--ink);
    line-height: 1.1;
}

.kiosk-header small {
    font-size: .72rem;
    color: var(--muted);
    display: inline-block;
    margin-top: 2px;
}

.kiosk-header small i {
    color: var(--accent);
    margin-right: 4px;
}

.cart-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #f5f7fb;
    color: var(--ink-soft);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
}

.cart-btn:hover {
    background: #e6ebf2;
}

.cart-btn #cartCount {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ---------- BODY ---------- */
.kiosk-body {
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
    padding: 20px 24px;
}

/* ---------- MODALS ---------- */
.modal {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-card {
    background: #fff;
    border-radius: 24px;
    padding: 26px;
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, .4);
    animation: modalIn .25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.94) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-card h3 {
    font-size: 1.5rem;
    margin-bottom: 6px;
    color: var(--ink);
}

.modal-card p {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 18px;
}

.modal-card p.hint {
    font-size: .72rem;
    text-align: center;
    color: #a0b3cc;
    margin-top: 14px;
}

/* ---------- CHOICES ---------- */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.choice {
    background: #f5f7fb;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    transition: transform .15s ease, background .2s ease, border-color .2s ease;
}

.choice:hover {
    background: #fff4ef;
    border-color: var(--accent-soft);
    transform: translateY(-2px);
}

.choice i {
    font-size: 1.6rem;
    color: var(--accent);
}

/* ---------- FORMS ---------- */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    font-size: .95rem;
    font-family: inherit;
    background: var(--bg);
    color: var(--ink);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-soft);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(249, 217, 118, .15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ---------- BUTTONS ---------- */
.btn-primary {
    width: 100%;
    border: none;
    border-radius: 40px;
    padding: 14px 22px;
    background: var(--ink);
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s ease, transform .1s ease;
}

.btn-primary:hover {
    background: #2a2f3f;
}

.btn-primary:active {
    transform: scale(.99);
}

.btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 40px;
    padding: 12px 22px;
    background: transparent;
    color: var(--ink-soft);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: background .2s ease;
}

.btn-secondary:hover {
    background: #f5f7fb;
}

/* ---------- MENU ---------- */
.menu-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.menu-head h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--ink-soft);
    font-size: .75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
}

.chip.active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.chip:hover {
    border-color: var(--accent-soft);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.menu-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    transition: transform .15s ease, box-shadow .2s ease;
}

.menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, .08);
}

.menu-card .img {
    width: 100%;
    height: 92px;
    border-radius: 12px;
    background: #f0f4fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    overflow: hidden;
    margin-bottom: 10px;
    color: #a0b3cc;
}

.menu-card .img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-card h4 {
    font-size: .95rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}

.menu-card .price {
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.tag {
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--line);
    color: var(--ink-soft);
    font-size: .6rem;
    font-weight: 500;
    white-space: nowrap;
}

.tag.nut-free {
    background: #e1f5e8;
    color: #1e7b48;
}

.tag.gluten-free {
    background: #fff0db;
    color: #a1611a;
}

.tag.vegan {
    background: #e8f0e1;
    color: #4c7a34;
}

.tag.vegetarian {
    background: #e1f0fa;
    color: #1a6a8c;
}

.add-btn {
    margin-top: auto;
    border: none;
    border-radius: 30px;
    background: var(--ink);
    color: #fff;
    padding: 8px 12px;
    font-size: .75rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background .2s ease;
}

.add-btn:hover {
    background: var(--accent);
}

.empty {
    text-align: center;
    color: #a0b3cc;
    font-size: .85rem;
    padding: 30px 20px;
}

.empty i {
    display: block;
    font-size: 2rem;
    opacity: .5;
    margin-bottom: 10px;
}

/* ---------- CART DRAWER ---------- */
.cart-panel {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 320px;
    max-height: calc(100% - 32px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .15);
    z-index: 20;
    transform: translateX(calc(100% + 40px));
    transition: transform .3s ease;
}

.cart-panel.open {
    transform: translateX(0);
}

.cart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f4fa;
}

.cart-head h4 {
    font-size: 1rem;
    color: var(--ink);
    font-weight: 700;
}

.cart-head button {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--muted);
    cursor: pointer;
}

.cart-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    max-height: 380px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1px solid #f0f4fa;
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 8px;
}

.cart-item .emoji {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.cart-item .info {
    flex: 1;
    min-width: 0;
}

.cart-item .info h5 {
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item .info span {
    font-size: .7rem;
    color: var(--muted);
}

.qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty button {
    width: 24px;
    height: 24px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: #fff;
    color: var(--ink-soft);
    font-weight: 700;
    font-size: .8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}

.qty button:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.qty span {
    min-width: 18px;
    text-align: center;
    font-size: .8rem;
    font-weight: 700;
}

.cart-foot {
    border-top: 1px solid #f0f4fa;
    padding: 14px 18px;
}

.cart-foot .row {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.cart-foot .row.grand {
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.cart-foot .btn-primary {
    margin-top: 4px;
}

/* ---------- ORDER CARD (pending/approved/ready) ---------- */
.order-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .02);
}

.order-card h4 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line);
}

.order-card h4 span:last-child {
    font-family: monospace;
    font-size: .7rem;
    color: var(--muted);
    font-weight: 400;
}

.order-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.order-row .oi-emoji {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f5f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.order-row .oi-name {
    flex: 1;
    font-size: .8rem;
    font-weight: 500;
}

.order-row .oi-qty {
    font-size: .75rem;
    color: var(--muted);
}

.order-row .oi-price {
    font-size: .8rem;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

.order-total {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    font-weight: 800;
    font-size: .95rem;
    color: var(--ink);
}

/* ---------- STATUS PAGES ---------- */
.status-center {
    text-align: center;
    padding: 16px 0;
}

.status-center .big-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.status-center h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--ink);
}

.status-center .desc {
    color: var(--muted);
    font-size: .9rem;
}

.queue-num {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--accent);
    text-align: center;
    margin: 12px 0;
}

.voucher-code {
    background: #f5f7fb;
    border: 1px dashed var(--accent-soft);
    border-radius: 14px;
    padding: 14px;
    margin: 14px 0;
    text-align: center;
    font-family: monospace;
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--ink);
}

/* ---------- READY FLASH OVERLAY ---------- */
#readyFlashStyle {
    /* marker element for injected keyframes */
}

/* ---------- TOAST ---------- */
.toast {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    background: var(--ink);
    color: #fff;
    padding: 12px 24px;
    border-radius: 40px;
    font-size: .85rem;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease, bottom .3s ease;
    z-index: 999;
}

.toast.show {
    opacity: 1;
    bottom: 40px;
}

/* ---------- UTILITIES ---------- */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 14px;
}

.flex {
    display: flex;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
    body {
        padding: 0;
    }

    .kiosk {
        border-radius: 0;
        height: 100vh;
        max-width: none;
    }

    .kiosk-header {
        padding: 14px 18px;
    }

    .kiosk-body {
        padding: 16px 18px;
    }

    .cart-panel {
        right: 10px;
        top: 10px;
        width: calc(100% - 20px);
        max-height: calc(100% - 20px);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .choice-grid {
        grid-template-columns: 1fr;
    }

    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}