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

:root {
    --primary: #5B4ED6;
    --primary-dark: #4A3FB5;
    --primary-light: #EDE9FE;
    --primary-lighter: #F5F3FF;
    --bg: #EEEDF7;
    --text-dark: #1E1B4B;
    --text-gray: #6B7280;
    --white: #FFFFFF;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* ==============================
   DECORATIVE BACKGROUND ELEMENTS
   ============================== */

/* Large curved shape (top-right) */
body::before {
    content: '';
    position: fixed;
    top: -200px;
    right: -300px;
    width: 900px;
    height: 900px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, rgba(91,78,214,0.06) 0%, rgba(91,78,214,0.02) 60%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Curved wave lines (bottom-right) */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    right: 0;
    width: 500px;
    height: 300px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 500 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M500,80 Q400,20 300,80 T100,80 T-100,80' fill='none' stroke='rgba(91,78,214,0.08)' stroke-width='1.5'/%3E%3Cpath d='M500,110 Q400,50 300,110 T100,110 T-100,110' fill='none' stroke='rgba(91,78,214,0.06)' stroke-width='1.2'/%3E%3Cpath d='M500,140 Q400,80 300,140 T100,140 T-100,140' fill='none' stroke='rgba(91,78,214,0.04)' stroke-width='1'/%3E%3Cpath d='M500,170 Q400,110 300,170 T100,170 T-100,170' fill='none' stroke='rgba(91,78,214,0.03)' stroke-width='0.8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: bottom right;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
}

/* Dot grid pattern (upper-left) */
.page-decor-dots {
    position: fixed;
    top: 90px;
    left: 40px;
    width: 100px;
    height: 120px;
    background-image: radial-gradient(circle, rgba(91,78,214,0.25) 1.5px, transparent 1.5px);
    background-size: 18px 18px;
    pointer-events: none;
    z-index: 0;
}

/* ==============================
   SOLID HEADER
   ============================== */
.header {
    background: var(--primary);
    color: white;
    padding: 0.5rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(91,78,214,0.2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    background: transparent;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-logo img {
    width: 65px;
    height: 65px;
    object-fit: contain;
}

.header-logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    background: none;
    -webkit-text-fill-color: white;
    margin: 0;
    letter-spacing: 0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right a,
.header-right span {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.header-right a:hover {
    background: rgba(255,255,255,0.12);
}

.header-sep {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.25);
    margin: 0 6px;
    flex-shrink: 0;
}

/* Printer status pill */
.status-pill {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.status-pill:hover { background: rgba(255,255,255,0.25); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.red   { background: #F87171; box-shadow: 0 0 6px rgba(248,113,113,0.6); }
.status-dot.green { background: #34D399; box-shadow: 0 0 6px rgba(52,211,153,0.6); }

/* ==============================
   MAIN CONTAINER
   ============================== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* ==============================
   WHITE CARDS
   ============================== */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 3.5rem 3rem;
    box-shadow: 0 8px 40px rgba(91,78,214,0.06);
    text-align: center;
    margin: 1.5rem auto;
    border: 1px solid rgba(91,78,214,0.04);
    transition: box-shadow 0.3s ease;
}
.card:hover {
    box-shadow: 0 12px 50px rgba(91,78,214,0.1);
}

/* ==============================
   ICON CIRCLE (ticket icon area)
   ============================== */
.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    background: var(--primary-lighter);
    border-radius: 50%;
    margin-bottom: 1.8rem;
    position: relative;
}

.icon-circle > i.icon-main {
    font-size: 2.8rem;
    color: var(--primary);
    position: relative;
    z-index: 2;
}

/* Sparkle decorations around the icon */
.icon-sparkle {
    position: absolute;
    color: #C4B5FD;
    pointer-events: none;
}
.icon-sparkle.s1 { top: -2px; left: -10px; font-size: 0.85rem; }
.icon-sparkle.s2 { top: -8px; right: 4px; font-size: 0.7rem; }
.icon-sparkle.s3 { bottom: 2px; right: -14px; font-size: 1rem; }
.icon-sparkle.s4 { top: 12px; right: -18px; font-size: 0.6rem; }
.icon-sparkle.s5 { bottom: 12px; left: -6px; font-size: 0.5rem; }

/* ==============================
   SEPARATOR LINE
   ============================== */
.separator {
    width: 32px;
    height: 3px;
    background: var(--primary);
    margin: 1.2rem auto 1.5rem;
    border-radius: 2px;
}

/* ==============================
   BUTTONS
   ============================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(91,78,214,0.3);
    letter-spacing: 0.3px;
    font-family: inherit;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(91,78,214,0.35);
    background: var(--primary-dark);
}
.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(91,78,214,0.3);
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    background: #10B981;
    box-shadow: 0 6px 20px rgba(16,185,129,0.3);
}
.btn-secondary:hover {
    background: #059669;
    box-shadow: 0 10px 30px rgba(16,185,129,0.35);
}

/* ==============================
   FORMS
   ============================== */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}
.form-control {
    width: 100%;
    padding: 0.85rem 1.2rem;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: #F3F4F8;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all 0.25s ease;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91,78,214,0.12);
}

/* ==============================
   TABLE (Admin)
   ============================== */
.table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.table th, .table td { padding: 1rem; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.05); vertical-align: middle; }
.table th { background: rgba(91,78,214,0.03); font-weight: 600; color: var(--text-gray); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.table tr:hover td { background: rgba(91,78,214,0.02); }
.btn-danger { background: #EF4444; color: white; padding: 8px 16px; border: none; border-radius: var(--radius-sm); cursor: pointer; box-shadow: 0 4px 10px rgba(239,68,68,0.2); font-weight: 500; transition: all 0.2s ease; text-decoration: none; font-family: inherit; }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 15px rgba(239,68,68,0.3); background: #DC2626; }
.btn-warning { background: #F59E0B; color: white; padding: 8px 16px; border: none; border-radius: var(--radius-sm); cursor: pointer; box-shadow: 0 4px 10px rgba(245,158,11,0.2); font-weight: 500; transition: all 0.2s ease; text-decoration: none; margin-right: 8px; font-family: inherit; }
.btn-warning:hover { transform: translateY(-1px); box-shadow: 0 6px 15px rgba(245,158,11,0.3); background: #D97706; }
.flex-actions { display: flex; align-items: center; }

/* ==============================
   DISPLAY SCREEN (Big Antrian)
   ============================== */
.display-screen {
    height: 100vh;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    background: radial-gradient(circle at top right, #312e81 0%, #1e1b4b 100%);
    color: white; text-align: center;
    overflow: hidden; position: relative;
}
.display-box {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 5rem 4rem;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
    width: 90%; max-width: 900px;
    z-index: 10;
}
.display-title { font-size: 2.2rem; font-weight: 700; color: #A5B4FC; margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 4px; }
.display-number { font-size: 14rem; font-weight: 900; line-height: 1; margin: 2rem 0; text-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.display-loket { font-size: 3rem; font-weight: 600; color: #FCD34D; }

/* ==============================
   QUEUE ITEMS (CS page)
   ============================== */
.queue-list { list-style: none; text-align: left; }
.queue-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem; background: white; border-radius: var(--radius-md);
    margin-bottom: 0.75rem; box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    border: 1px solid rgba(91,78,214,0.04);
    transition: all 0.25s ease;
}
.queue-item:hover {
    transform: translateX(4px);
    box-shadow: 0 5px 15px rgba(91,78,214,0.06);
    border-color: rgba(91,78,214,0.12);
}
.queue-item-number { font-size: 1.75rem; font-weight: 800; color: var(--primary); line-height: 1.2; }

/* Pulse animation for display */
.pulse {
    animation: pulse-anim 2s cubic-bezier(0.4,0,0.6,1) infinite;
}
@keyframes pulse-anim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.98); }
}

/* ==============================
   PRINT
   ============================== */
@media print {
    body * { visibility: hidden; }
    .print-area, .print-area * { visibility: visible; }
    .print-area { position: absolute; left: 0; top: 0; width: 100%; text-align: center; padding: 20px; }
    .header, .btn, .nav-links, .page-decor-dots { display: none !important; }
}
