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

:root {
    --primary: #15803d;
    --primary-dark: #166534;
    --primary-light: #22c55e;
    --secondary: #0f766e;
    --accent: #f59e0b;
    --bg-dark: #0a1628;
    --bg-card: #0f2035;
    --bg-gradient: linear-gradient(135deg, #064e3b 0%, #0f766e 50%, #115e59 100%);
    --text-white: #ffffff;
    --text-light: #ffffff;
    --text-muted: #ffffff;
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 30px rgba(34,197,94,0.3);
    --radius: 16px;
    --radius-sm: 10px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============ DISPLAY / MONITOR ============ */
.display-container {
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    background: var(--bg-gradient);
    position: relative;
    overflow: hidden;
}

.display-container::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(34,197,94,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(14,165,233,0.06) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(1deg); }
    66% { transform: translate(-20px, 20px) rotate(-1deg); }
}

.display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(34,197,94,0.3);
    position: relative;
    z-index: 2;
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-logo {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 900;
    box-shadow: 0 4px 15px rgba(34,197,94,0.4);
}

.header-info h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.header-right {
    text-align: right;
}

.header-date {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.header-time {
    font-size: 36px;
    font-weight: 800;
    font-family: 'Roboto Mono', monospace;
    color: #ffffff;
}

/* Main Display Content */
.display-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 12px 30px;
    position: relative;
    z-index: 2;
}

.current-call {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 2px solid rgba(34,197,94,0.25);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.current-call::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.call-label {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--primary-light);
    margin-bottom: 8px;
}

.call-service {
    background: var(--primary);
    color: white;
    padding: 8px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(34,197,94,0.3);
}

.call-number {
    font-size: 110px;
    font-weight: 900;
    font-family: 'Roboto Mono', monospace;
    line-height: 1;
    text-shadow: 0 0 30px rgba(34,197,94,0.3);
    background: linear-gradient(180deg, #fff 0%, #a7f3d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.call-number.calling {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.85; }
}

.call-counter {
    font-size: 28px;
    font-weight: 700;
    margin-top: 16px;
    color: var(--text-light);
}

.video-area {
    background: #000000;
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 2px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.video-area iframe, .video-area img {
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: var(--radius);
}

.video-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.video-placeholder i {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.3;
}

/* Bottom Services Bar */
.display-footer-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    padding: 30px 40px;
    min-height: 300px;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(20px);
    border-top: 2px solid rgba(34,197,94,0.2);
    position: relative;
    z-index: 2;
}

.service-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 40px 30px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.service-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.service-card .svc-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-white);
    text-transform: uppercase;
    margin-bottom: 8px;
    opacity: 0.8;
}

.service-card .svc-number {
    font-size: 100px;
    font-weight: 900;
    font-family: 'Roboto Mono', monospace;
    line-height: 1;
    margin-top: 10px;
}

.service-card.active {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-glow);
    background: rgba(34,197,94,0.1);
}

/* Running Text */
.running-text-bar {
    background: rgba(0,0,0,0.5);
    padding: 10px 0;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.running-text {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 25s linear infinite;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-light);
    letter-spacing: 1px;
}

@keyframes marquee {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* ============ KIOSK ============ */
.kiosk-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--bg-gradient);
    position: relative;
}

.kiosk-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px 30px;
    background: rgba(0,0,0,0.2);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 2;
}

.kiosk-logo-img {
    width: auto;
    height: 100px;
    border-radius: 14px;
    background: white;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.kiosk-header-text {
    text-align: left;
}

.kiosk-header-text h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.1;
    color: white;
}

.kiosk-header-text p {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    margin-bottom: 12px;
}

.kiosk-badge {
    display: inline-block;
    padding: 4px 16px;
    background: var(--primary);
    color: white;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

.kiosk-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(34,197,94,0.1), transparent 70%);
    pointer-events: none;
}

.kiosk-title {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
    z-index: 2;
}

.kiosk-title h1 {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.kiosk-title p {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 500;
}

.kiosk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.kiosk-btn {
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.kiosk-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(34,197,94,0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.kiosk-btn:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-light);
    box-shadow: 0 20px 60px rgba(34,197,94,0.3);
}

.kiosk-btn:hover::before { opacity: 1; }

.kiosk-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.kiosk-btn .prefix {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 900;
    margin: 0 auto 20px;
    box-shadow: 0 8px 30px rgba(34,197,94,0.4);
}

.kiosk-btn .btn-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
}

.kiosk-btn .btn-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Print Ticket */
.ticket-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.ticket-modal.active { display: flex; }

.ticket {
    background: white;
    color: #1a1a1a;
    width: 320px;
    padding: 32px 24px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.ticket h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
    letter-spacing: 2px;
}

.ticket h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
}

.ticket .ticket-number {
    font-size: 80px;
    font-weight: 900;
    font-family: 'Roboto Mono', monospace;
    color: var(--primary-dark);
    line-height: 1;
    margin: 16px 0;
}

.ticket .ticket-service {
    background: var(--primary);
    color: white;
    padding: 6px 20px;
    border-radius: 50px;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.ticket .ticket-date {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
}

.ticket .ticket-waiting {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
}

.ticket .divider {
    border: none;
    border-top: 2px dashed #ddd;
    margin: 16px 0;
}

.ticket-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.ticket-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-print {
    background: var(--primary);
    color: white;
}

.btn-print:hover { background: var(--primary-dark); }

.btn-close-ticket {
    background: #e5e7eb;
    color: #374151;
}

.btn-close-ticket:hover { background: #d1d5db; }

/* ============ COUNTER / LOKET ============ */
.counter-container {
    min-height: 100vh;
    background: #0f172a;
    padding: 24px;
}

.counter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px 28px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.08);
}

.counter-header h1 {
    font-size: 28px;
    font-weight: 800;
}

.counter-header .badge {
    background: var(--primary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
}

.counter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.counter-current {
    background: rgba(255,255,255,0.04);
    border: 2px solid rgba(34,197,94,0.2);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
}

.counter-current h3 {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.counter-current .big-number {
    font-size: 100px;
    font-weight: 900;
    font-family: 'Roboto Mono', monospace;
    line-height: 1;
    background: linear-gradient(180deg, #fff, #a7f3d0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.counter-current .current-service {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-light);
}

.counter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-content: center;
}

.action-btn {
    padding: 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.action-btn:hover { transform: translateY(-3px); }
.action-btn:active { transform: translateY(0); }

.btn-next {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    grid-column: 1 / -1;
    font-size: 20px;
    padding: 32px;
    box-shadow: 0 8px 30px rgba(34,197,94,0.3);
}

.btn-recall {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1a1a1a;
}

.btn-skip {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
}

.btn-finish {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Queue List */
.queue-list {
    margin-top: 24px;
    grid-column: 1 / -1;
}

.queue-list h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.queue-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.queue-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
}

.queue-item.waiting { border-left: 3px solid var(--accent); }
.queue-item.calling { border-left: 3px solid var(--primary-light); background: rgba(34,197,94,0.1); }

/* ============ ADMIN & LOKET SHARED ============ */
.admin-container {
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    padding: 24px;
    background: #0f172a;
    padding-bottom: 0 !important; 
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    position: relative;
}

.admin-header h1 { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 10px; }

.admin-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.admin-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary-light);
}

.btn-reset {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reset:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(239,68,68,0.3); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 900;
    font-family: 'Roboto Mono', monospace;
    color: var(--primary-light);
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ============ PRINT ============ */
@media print {
    body * { visibility: hidden; }
    .ticket, .ticket * { visibility: visible; }
    .ticket {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        box-shadow: none;
        border: 1px solid #ccc;
    }
    .ticket-actions { display: none !important; }
}

/* (Styles merged above or consolidated here) */
.tabs { display: flex; gap: 5px; }

.tab-btn { 
    background: transparent !important; 
    border: none !important; 
    color: #ffffff !important; 
    font-size: 16px; 
    font-weight: 600; 
    cursor: pointer; 
    padding: 10px 20px; 
    transition: 0.3s; 
    text-decoration: none;
    display: inline-block;
    border-bottom: 2px solid transparent;
}

.tab-btn.active { 
    color: var(--primary-light) !important; 
    border-bottom: 2px solid var(--primary-light) !important; 
}

.tab-btn:hover { color: white !important; }

.menu-toggle { 
    display: none; 
    background: rgba(255,255,255,0.1); 
    border: 1px solid rgba(255,255,255,0.2); 
    color: white; 
    padding: 10px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 20px; 
}

@media (max-width: 992px) {
    .admin-container { padding: 15px; }
    .admin-header { position: relative; padding-bottom: 15px; margin-bottom: 15px; }
    .menu-toggle { display: block; }
    .tabs { 
        display: none; 
        flex-direction: column; 
        position: absolute; 
        top: 100%; 
        right: 0; 
        background: var(--bg-card); 
        border: 1px solid rgba(255,255,255,0.1); 
        border-radius: 12px; 
        padding: 10px; 
        width: 220px; 
        box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
        z-index: 1000; 
        margin-top: 5px;
        gap: 5px;
    }
    .tabs.active { display: flex; }
    .tab-btn { 
        width: 100%; 
        text-align: left; 
        border-bottom: none !important; 
        margin-bottom: 0; 
        border-radius: 8px; 
        padding: 12px 20px; 
    }
    .tab-btn.active { background: rgba(34,197,94,0.15); color: var(--primary-light) !important; }
    .tab-btn:hover { background: rgba(255,255,255,0.05); }

    /* RESPONSIVE LOKET / COUNTER */
    .counter-grid { grid-template-columns: 1fr; }
    .counter-header { flex-direction: column; gap: 10px; text-align: center; padding: 15px; }
    .counter-current { padding: 30px 15px; }
    .counter-current .big-number { font-size: 80px; }
    .counter-actions { grid-template-columns: 1fr; }
    .action-btn { padding: 18px; font-size: 14px; }

    /* RESPONSIVE KIOSK / AMBIL ANTRIAN */
    .kiosk-container { padding: 15px; }
    .kiosk-header { flex-direction: column; text-align: center; gap: 15px; padding: 20px !important; }
    .kiosk-logo-img { height: 80px !important; margin: 0 auto; }
    .kiosk-header-text { text-align: center; }
    .kiosk-header h1 { font-size: 24px !important; }
    .kiosk-grid { grid-template-columns: 1fr; gap: 15px; }
    .kiosk-btn { padding: 30px 15px; }
    .kiosk-btn .prefix { width: 60px; height: 60px; font-size: 28px; }
    .kiosk-btn .btn-name { font-size: 18px; }
    
    .ticket { width: 100%; max-width: 340px; }
}
