:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-image: radial-gradient(#e0e7ff 1px, transparent 1px);
    background-size: 24px 24px;
}

.page-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.container {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    text-align: center;
    position: relative;
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

/* Header */
h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

p.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Queue Display Card */
.queue-display {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.queue-jam-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-label {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.queue-number {
    font-size: 5.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.05em;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.05);
}

/* Animation State */
.calling {
    animation: flash 1s ease-in-out;
}

@keyframes flash {
    0% {
        background-color: #ecfdf5;
        transform: scale(1);
    }

    50% {
        background-color: #d1fae5;
        transform: scale(1.02);
    }

    100% {
        background-color: #f8fafc;
        transform: scale(1);
    }
}

/* Control Buttons Grid */
.control-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    margin-bottom: 20px;
    background: #f1f5f9;
    padding: 8px;
    border-radius: var(--radius-md);
}

.btn-control {
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.btn-control:active {
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-prev {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-prev:hover {
    background-color: #fee2e2;
    color: var(--danger);
    border-color: #fecaca;
}

.btn-next {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-next:hover {
    background-color: #dbeafe;
    color: var(--primary);
    border-color: #bfdbfe;
}

.btn-reset {
    background-color: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    box-shadow: none;
    padding: 0 1rem;
    letter-spacing: 0.05em;
}

.btn-reset:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

/* Main Call Button */
.btn-call-large {
    width: 100%;
    background: linear-gradient(to bottom right, var(--success), var(--success-dark));
    color: white;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3), 0 2px 4px -1px rgba(16, 185, 129, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-call-large::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-call-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}

.btn-call-large:hover::after {
    opacity: 1;
}

.btn-call-large:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

/* Footer */
.footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Timer Style */
.timer-container {
    background: #e0e7ff;
    color: #4338ca;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.timer-icon {
    font-size: 1rem;
}

/* Responsive */
@media (min-width: 992px) {
    .page-layout {
        max-width: 420px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .queue-number {
        font-size: 4.5rem;
    }
}