/* =========================================================
   Customer Queue Page
   Design-only stylesheet: no class/ID names were changed.
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
    --maroon: #641b2b;
    --maroon-600: #7a2437;
    --maroon-dark: #42101c;
    --maroon-light: #f8eff1;
    --black: #171315;
    --ink-2: #3f3a3c;
    --white: #ffffff;
    --muted: #7a7377;
    --border: #ece5e7;
    --bg: #f4f1f2;
    --live: #16a34a;
    --amber: #b45309;
    --amber-bg: #fffbeb;
    --amber-line: #fcd34d;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --focus: 0 0 0 3px rgba(100, 27, 43, 0.28);
}

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

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 28px 16px;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--black);
    background:
        radial-gradient(1200px 500px at 50% -10%, rgba(100, 27, 43, 0.10), transparent 60%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
}

button:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.ui-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    stroke-width: 2.2;
}

/* ---------- Card ---------- */

.queue-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 22px 22px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow:
        0 1px 2px rgba(48, 17, 26, 0.04),
        0 20px 45px rgba(48, 17, 26, 0.10);
}

/* Brand accent strip */
.queue-card::before {
    content: "";
    display: block;
    height: 6px;
    margin: 0 -22px 26px;
    background: linear-gradient(90deg, var(--maroon-dark), var(--maroon), #9a3349);
}

.queue-card h1 {
    margin: 0;
    color: var(--black);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-align: center;
}

.subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 6px 0 24px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

/* Live indicator */
.subtitle::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
    animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
    70%  { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ---------- Get queue number ---------- */

#joinSection {
    padding: 4px 0 6px;
}

#joinButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 16px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--maroon-600), var(--maroon-dark));
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(100, 27, 43, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

#joinButton:hover {
    filter: brightness(1.08);
    box-shadow: 0 10px 24px rgba(100, 27, 43, 0.30);
}

#joinButton:active {
    transform: scale(0.985);
}

/* ---------- Queue status panel ---------- */

#queueSection {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    text-align: center;
}

#queueSection > * {
    grid-column: 1 / -1;
}

/* "Your Queue Number" label */
#queueSection > p:first-of-type {
    margin: 0 0 -4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Ticket-style queue number */
#queueNumber {
    position: relative;
    display: block;
    margin: 0 0 4px;
    padding: 26px 12px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.14), transparent 50%),
        linear-gradient(145deg, var(--maroon-600), var(--maroon-dark));
    color: var(--white);
    font-size: clamp(72px, 22vw, 104px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    box-shadow: 0 14px 30px rgba(66, 16, 28, 0.28);
}

/* Ticket notches */
#queueNumber::before,
#queueNumber::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--white);
    transform: translateY(-50%);
}

#queueNumber::before { left: -11px; }
#queueNumber::after  { right: -11px; }

/* Status + People Ahead tiles */
#queueSection > p:nth-of-type(2),
#queueSection > p:nth-of-type(3) {
    grid-column: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 14px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbf9fa;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#queueSection > p:nth-of-type(3) .ui-icon {
    display: none;
}

#queueStatus,
#peopleAhead {
    color: var(--black);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

#queueStatus {
    color: var(--maroon);
}

#peopleAhead {
    font-size: 22px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

/* Progress bar */
.progress-track {
    width: 100%;
    height: 10px;
    margin: 8px 0 0;
    overflow: hidden;
    border-radius: 999px;
    background: #ece7e9;
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #9a3349, var(--maroon));
    transition: width 0.45s ease;
}

#queueMessage {
    margin: 2px 0 0;
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- Approaching-turn notification ---------- */

.queue-notification {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: start;
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid var(--amber-line);
    border-left: 4px solid #f59e0b;
    border-radius: 14px;
    background: var(--amber-bg);
    color: var(--amber);
    text-align: left;
    animation: notify-in 0.35s ease-out;
}

.queue-notification .ui-icon {
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 10px;
    background: #fef3c7;
    color: var(--amber);
    animation: bell-ring 1.6s ease-in-out infinite;
    transform-origin: 50% 20%;
}

.queue-notification strong {
    font-size: 15px;
    font-weight: 700;
    color: #92400e;
}

.queue-notification p {
    margin: 2px 0 0;
    color: #78350f;
    font-size: 13px;
    line-height: 1.55;
}

@keyframes notify-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bell-ring {
    0%, 60%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(-12deg); }
    20%, 40% { transform: rotate(12deg); }
}

/* ---------- Cancel button ---------- */

.cancel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    margin-top: 6px;
    padding: 12px 16px;
    border: 1px solid #e3d6da;
    border-radius: 14px;
    background: var(--white);
    color: var(--maroon);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cancel-button:hover {
    border-color: var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
}

/* ---------- Error message ---------- */

#errorMessage {
    margin: 0;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

#errorMessage:not(:empty) {
    margin-top: 16px;
    padding: 10px 14px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: var(--danger-bg);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 360px) {
    body {
        padding: 12px 8px;
    }

    .queue-card {
        padding: 0 16px 16px;
        border-radius: 20px;
    }

    .queue-card::before {
        margin: 0 -16px 20px;
    }

    .queue-card h1 {
        font-size: 21px;
    }

    #queueNumber {
        padding: 22px 8px;
        font-size: clamp(64px, 21vw, 80px);
    }
}

@media (min-width: 600px) {
    body {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .queue-card {
        padding: 0 28px 28px;
    }

    .queue-card::before {
        margin: 0 -28px 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}
