:root {
    --primary: #6366F1;
    --primary-dark: #A855F7;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F97316;
    --bg: #F8FAFC;
    --white: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --radius-lg: 32px;
    --radius-md: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);

    /* Gradients from Mobile App */
    --gradient-called: linear-gradient(135deg, #FBBF24 0%, #F97316 100%);
    --gradient-serving: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    --gradient-done: linear-gradient(135deg, #FCA5A5 0%, #F87171 100%);
    --gradient-header: linear-gradient(135deg, #6366F1 0%, #A855F7 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.mt-4 {
    margin-top: 16px;
}

.mt-6 {
    margin-top: 24px;
}

.mt-8 {
    margin-top: 32px;
}

.mb-4 {
    margin-bottom: 16px;
}

.pt-6 {
    padding-top: 24px;
}

.w-full {
    width: 100%;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.justify-center {
    justify-content: center;
}

.gap-3 {
    gap: 12px;
}

.border-t {
    border-top: 1px solid;
}

.border-gray-100 {
    border-color: #F1F5F9;
}

.text-xs {
    font-size: 12px;
}

.font-bold {
    font-weight: 700;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.text-gray-400 {
    color: #94A3B8;
}

.transition-transform {
    transition: transform 0.2s;
}

.hover\:scale-105:hover {
    transform: scale(1.05);
}

.screen {
    min-height: 100vh;
    width: 100%;
}

/* Loading & Error */
.premium-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(30, 64, 175, 0.1);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 24px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.5px;
}

/* Premium Animated Splash Overlay */
#splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: radial-gradient(circle at center, #4338CA 0%, #1E1B4B 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s;
    overflow: hidden;
    perspective: 1000px;
}

/* Particles Background */
#splash-particles {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(white 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.1;
    animation: particlesMove 20s linear infinite;
}

@keyframes particlesMove {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 100px 100px;
    }
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(37, 99, 235, 0.05) 51%, transparent 51%);
    background-size: 100% 4px;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(100%);
    }
}

.splash-content {
    text-align: center;
    position: relative;
    z-index: 2;
    transform-style: preserve-3d;
}

.splash-promo {
    position: absolute;
    bottom: 50px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 3;
    opacity: 0;
    animation: splashFadeUp 1s ease-out 1.5s forwards;
}

.splash-promo p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.splash-promo .store-links img {
    height: 32px;
    opacity: 0.8;
}

.splash-logo {
    width: 130px;
    height: 130px;
    border-radius: 35px;
    box-shadow: 0 0 50px rgba(37, 99, 235, 0.4);
    margin-bottom: 32px;
    animation: splashLogoEntry 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        splashLogoFloat 4s ease-in-out infinite 1.5s;
    opacity: 0;
    transform: rotateX(20deg);
}

@keyframes splashLogoEntry {
    from {
        opacity: 0;
        transform: scale(0.2) translateY(100px) rotateX(-45deg);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0);
    }
}

@keyframes splashLogoFloat {

    0%,
    100% {
        transform: translateY(0) rotateY(0);
    }

    50% {
        transform: translateY(-15px) rotateY(10deg);
    }
}

.splash-title {
    color: white;
    font-size: 38px;
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 12px;
    opacity: 0;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    animation: splashFadeUp 1s ease-out 0.8s forwards;
}

.splash-subtitle {
    color: #60A5FA;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 6px;
    text-transform: uppercase;
    opacity: 0;
    animation: splashFadeUp 1s ease-out 1s forwards;
}

@keyframes splashFadeUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.splash-hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    pointer-events: none;
}

.error-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 90%;
}

.error-icon-wrapper {
    width: 80px;
    height: 80px;
    background: #FEF2F2;
    color: var(--error);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.error-icon-wrapper .material-icons-round {
    font-size: 40px;
}

/* Premium Header */
.premium-header {
    background: var(--gradient-header);
    padding: 40px 24px 60px;
    color: var(--white);
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-logo {
    height: 40px;
}

.live-indicator {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 1px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #4ADE80;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.header-info h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.header-info p {
    font-size: 16px;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    margin-top: -40px;
    padding: 0 24px 40px;
}

/* Ticket Card */
.premium-ticket {
    background: var(--white);
    border-radius: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    border: 2px solid transparent;
    transition: all 0.5s ease;
}

.premium-ticket.called {
    background: var(--gradient-called);
    border-color: rgba(255, 255, 255, 0.3);
}

.premium-ticket.called .big-number,
.premium-ticket.called .ticket-label,
.premium-ticket.called .pos-label,
.premium-ticket.called .pos-value span,
.premium-ticket.called .pos-value small {
    color: var(--white);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.premium-ticket.serving {
    background: var(--gradient-serving);
    border-color: rgba(255, 255, 255, 0.3);
}

.premium-ticket.serving .big-number,
.premium-ticket.serving .ticket-label,
.premium-ticket.serving .pos-label,
.premium-ticket.serving .pos-value span,
.premium-ticket.serving .pos-value small {
    color: var(--white);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.premium-ticket.done {
    background: var(--gradient-done);
    border-color: rgba(255, 255, 255, 0.3);
}

.premium-ticket.done .big-number,
.premium-ticket.done .ticket-label,
.premium-ticket.done .pos-label,
.premium-ticket.done .pos-value span,
.premium-ticket.done .pos-value small {
    color: var(--white);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ticket-head {
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-label {
    font-size: 11px;
    font-weight: 900;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    background: #F1F5F9;
    font-size: 13px;
    font-weight: 700;
}

.status-badge.serving {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge.called {
    background: #FFEDD5;
    color: #9A3412;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.6;
    }
}

/* Perforation */
.perforation {
    height: 30px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 15px;
}

.perf-cut {
    width: 30px;
    height: 30px;
    background: var(--bg);
    border-radius: 50%;
    position: absolute;
    top: 0;
}

.cut-left {
    left: -15px;
}

.cut-right {
    right: -15px;
}

.perf-line {
    flex: 1;
    border-bottom: 2px dashed #E2E8F0;
}

/* Ticket Body */
.ticket-body {
    padding: 32px;
    text-align: center;
}

.big-number {
    font-size: 84px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 32px;
    letter-spacing: -2px;
}

.position-info {
    background: #F8FAFC;
    padding: 24px;
    border-radius: 24px;
    transition: background 0.3s ease;
}

.called .position-info,
.serving .position-info,
.done .position-info {
    background: rgba(255, 255, 255, 0.15);
}

.pos-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pos-value {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pos-value span {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-main);
}

.pos-value small {
    font-size: 12px;
    color: var(--text-muted);
}

/* Counter Alert */
.counter-alert {
    background: var(--primary);
    color: var(--white);
    padding: 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    margin-top: 16px;
    animation: bounce 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounce {
    0% {
        transform: scale(0.8);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.counter-alert .material-icons-round {
    font-size: 32px;
}

.alert-content h3 {
    font-size: 16px;
    font-weight: 800;
}

.alert-content p {
    font-size: 14px;
    opacity: 0.9;
}

/* Other Alerts */
.alert-card {
    padding: 24px;
    border-radius: 24px;
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.alert-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #86EFAC;
}

.alert-text h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}

.alert-text p {
    font-size: 14px;
    opacity: 0.8;
}

/* Rating Card */
.rating-card {
    background: var(--white);
    padding: 32px;
    border-radius: 32px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.rating-card.nested {
    background: var(--white);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 20px 0 0;
    text-align: center;
}

.rating-card.nested p {
    color: var(--text-muted) !important;
}

.rating-card.nested .star {
    color: #E2E8F0 !important;
}

.rating-card.nested .star.active {
    color: var(--warning) !important;
}

.rating-card.nested #rating-comment {
    background: var(--bg) !important;
    border-color: #E2E8F0 !important;
    color: var(--text-main) !important;
}

.rating-card.nested #submit-rating-btn {
    background: var(--primary) !important;
    color: var(--white) !important;
}

.rating-card.nested .thanks-msg {
    color: var(--success) !important;
}

.rating-card h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.rating-card p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.stars-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.star {
    font-size: 36px;
    color: #E2E8F0;
    cursor: pointer;
    transition: all 0.2s;
}

.star.active {
    color: var(--warning);
    transform: scale(1.2);
}

.comment-container {
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease-out;
}

#rating-comment {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

#rating-comment:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.thanks-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--success);
    font-weight: 700;
}

.thanks-msg .material-icons-round {
    font-size: 40px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 18px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.2);
}

.btn-primary:active {
    transform: scale(0.96);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
}

/* App Promo */
.app-promo {
    text-align: center;
    padding-bottom: 40px;
}

.app-promo p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.store-links {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.store-links img {
    height: 40px;
    border-radius: 8px;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-icon {
    width: 80px;
    height: 80px;
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.modal-icon .material-icons-round {
    font-size: 40px;
}

.modal-card h2 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 12px;
}

.modal-card p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-link {
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
}

.btn-ghost.danger {
    color: var(--error);
    border: 2px solid transparent;
}

.btn-ghost.danger:hover {
    border-color: var(--error);
}

.modal-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.btn-primary.danger {
    background: var(--error);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.2);
}

/* Scrollbar hiding */
::-webkit-scrollbar {
    display: none;
}