/* Antriku - Main Stylesheet */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #0891b2;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;
    --gray: #94a3b8;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ======== LANDING PAGE ======== */
.landing-header {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    text-align: center;
    padding: 60px 20px 80px;
}
.landing-header h1 { font-size: 2.5rem; margin-bottom: 10px; }
.landing-header p { font-size: 1.2rem; opacity: 0.9; }
.landing-header .nav { margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    padding: 60px 20px;
    max-width: 1100px;
    margin: -40px auto 0;
}
.feature-card {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transition: var(--transition);
}
.feature-card:hover { transform: translateY(-4px); }
.feature-card .icon { font-size: 3rem; margin-bottom: 12px; }
.feature-card h3 { margin-bottom: 8px; color: var(--dark); }

.plans {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}
.plans h2 { margin-bottom: 30px; font-size: 2rem; }
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.plan-card {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    text-align: center;
}
.plan-card.featured { border-color: var(--primary); transform: scale(1.02); }
.plan-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.plan-card .price { font-size: 2rem; font-weight: 700; color: var(--primary); margin: 12px 0; }
.plan-card .price span { font-size: 0.9rem; font-weight: 400; color: var(--secondary); }
.plan-card ul { list-style: none; margin: 20px 0; }
.plan-card ul li { padding: 6px 0; color: var(--secondary); }

/* ======== BUTTONS ======== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-size: 1rem;
    transition: var(--transition);
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline-light { background: transparent; border: 2px solid white; color: white; }
.btn-lg { padding: 16px 36px; font-size: 1.1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ======== AUTH PAGES ======== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
}
.auth-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}
.auth-card h2 { text-align: center; margin-bottom: 8px; font-size: 1.8rem; color: var(--primary); }
.auth-card .subtitle { text-align: center; color: var(--secondary); margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9rem; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert-danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* ======== DASHBOARD ======== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: var(--dark);
    color: white;
    padding: 20px;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
}
.sidebar-logo { font-size: 1.5rem; font-weight: 700; margin-bottom: 30px; padding-bottom: 16px; border-bottom: 1px solid #334155; }
.sidebar-logo span { color: var(--primary); }
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 4px; }
.sidebar-nav a {
    display: block;
    padding: 10px 14px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.95rem;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,0.1); color: white; }
.sidebar-nav .badge {
    background: var(--danger);
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.75rem;
    float: right;
}

.main-content { margin-left: 260px; flex: 1; padding: 24px; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.topbar h1 { font-size: 1.5rem; }

/* Stats Cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}
.stat-card .num { font-size: 2rem; font-weight: 700; }
.stat-card .label { font-size: 0.85rem; color: var(--secondary); margin-top: 4px; }
.stat-card.blue .num { color: var(--primary); }
.stat-card.green .num { color: var(--success); }
.stat-card.orange .num { color: var(--warning); }
.stat-card.red .num { color: var(--danger); }

.card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card h3 { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--border); }

table { width: 100%; border-collapse: collapse; }
table th { text-align: left; padding: 10px 12px; background: #f8fafc; font-weight: 600; font-size: 0.85rem; color: var(--secondary); border-bottom: 2px solid var(--border); }
table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
table tr:hover td { background: #f8fafc; }

/* Badges */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-waiting { background: #fef3c7; color: #92400e; }
.badge-accepted { background: #dbeafe; color: #1e40af; }
.badge-serving { background: #e0e7ff; color: #3730a3; }
.badge-done { background: #d1fae5; color: #065f46; }
.badge-skipped { background: #f3f4f6; color: #374151; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* ======== OPERATOR PANEL ======== */
.operator-layout { display: grid; grid-template-columns: 1fr 350px; gap: 20px; min-height: calc(100vh - 80px); }
.operator-main .card { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.current-ticket {
    text-align: center;
    padding: 20px;
}
.current-ticket .ticket-num {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
}
.current-ticket .ticket-info { color: var(--secondary); font-size: 1rem; margin: 8px 0; }
.waiting-list { max-height: 400px; overflow-y: auto; }
.waiting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.waiting-item:hover { background: #f8fafc; }
.waiting-item .wl-num { font-weight: 700; font-size: 1.1rem; }

/* ======== DISPLAY MONITOR ======== */
.display-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    font-size: 0.9rem;
    opacity: 0.7;
}
.display-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.display-main .call-text { font-size: 2rem; opacity: 0.8; margin-bottom: 10px; }
.display-main .call-number {
    font-size: 8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin: 20px 0;
}
.display-main .call-loket { font-size: 2.5rem; font-weight: 600; margin-bottom: 5px; }
.display-main .call-subtitle { font-size: 1.2rem; opacity: 0.6; }
.display-footer {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    gap: 20px;
}
.display-queue-item {
    text-align: center;
    padding: 16px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.05);
    min-width: 150px;
}
.display-queue-item .dqi-num { font-size: 1.8rem; font-weight: 700; }
.display-queue-item .dqi-label { font-size: 0.8rem; opacity: 0.6; }

/* ======== KIOSK PAGE ======== */
.kiosk-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.kiosk-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    text-align: center;
}
.kiosk-card h1 { color: var(--primary); margin-bottom: 4px; }
.kiosk-card .kiosk-sub { color: var(--secondary); margin-bottom: 24px; }
.kiosk-service-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}
.kiosk-service-btn {
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-size: 1rem;
}
.kiosk-service-btn:hover, .kiosk-service-btn.selected { border-color: var(--primary); background: #eff6ff; }
.kiosk-service-btn .ks-prefix { font-weight: 700; color: var(--primary); font-size: 1.2rem; }
.kiosk-ticket-result { display: none; }
.kiosk-ticket-result.active { display: block; }
.ticket-big-num {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary);
    margin: 20px 0;
}
.ticket-barcode {
    margin: 20px auto;
    max-width: 250px;
    text-align: center;
}

/* ======== MOBILE RESPONSIVE ======== */
@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; height: auto; padding: 12px; }
    .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .sidebar-nav li { margin: 0; }
    .main-content { margin-left: 0; padding: 16px; }
    .layout { flex-direction: column; }
    .operator-layout { grid-template-columns: 1fr; }
    
    .landing-header { padding: 40px 20px 60px; }
    .landing-header h1 { font-size: 1.8rem; }
    .features { grid-template-columns: 1fr; padding: 40px 16px; }
    
    .display-main .call-number { font-size: 4rem; }
    .display-main .call-text { font-size: 1.2rem; }
    .display-main .call-loket { font-size: 1.5rem; }
    
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .auth-card { padding: 24px; }
    
    table { font-size: 0.8rem; }
    table th, table td { padding: 8px; }
    
    .current-ticket .ticket-num { font-size: 2.5rem; }
}

@media (max-width: 480px) {
    .stat-cards { grid-template-columns: 1fr; }
    .plan-grid { grid-template-columns: 1fr; }
    .display-footer { flex-direction: column; }
    .kiosk-card { padding: 20px; }
}

/* ======== UTILITIES ======== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.loading { opacity: 0.6; pointer-events: none; }
.print-only { display: none; }
@media print {
    .no-print { display: none !important; }
    .print-only { display: block; }
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 16px; }

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideUp 0.3s ease;
    max-width: 350px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Pulse animation for calling */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.pulse { animation: pulse 1s infinite; }