:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #e0e7ff 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --shadow-soft: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --border-radius: 16px;
    --danger: #EF4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

#app {
    width: 100%;
    max-width: 480px; /* Mobile width container */
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.hidden { display: none !important; }

/* Sections */
.view-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    visibility: hidden;
    overflow-y: auto;
}

.view-section.active {
    transform: translateX(0);
    visibility: visible;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.glass-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    padding: 20px;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin: -20px -20px 20px -20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.glass-header.with-back {
    justify-content: flex-start;
    gap: 15px;
}

/* Auth Section */
.auth-card {
    margin-top: 10vh;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.logo-container h1 { font-size: 1.5rem; font-weight: 700; }
.logo-container p { color: var(--text-muted); font-size: 0.9rem; }

.auth-tabs {
    display: flex;
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Inputs & Buttons */
.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 45px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    background: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

button.btn-primary, button.btn-secondary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

button.btn-primary {
    background: var(--primary);
    color: white;
    margin-top: 10px;
}

button.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

button.btn-secondary {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

button.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
}

/* Dashboard Elements */
.header-info h2 { font-size: 1.3rem; }
.header-info p { color: var(--text-muted); font-size: 0.85rem; }

.dashboard-content { padding-bottom: 30px; }

.section-title {
    font-size: 1.1rem;
    margin: 20px 0 15px 5px;
    color: var(--text-main);
}

/* Banner Active Ticket */
.banner {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    cursor: pointer;
    margin-bottom: 20px;
    border: none;
}

.banner-icon {
    font-size: 24px;
    background: rgba(255,255,255,0.2);
    width: 45px; height: 45px;
    border-radius: 12px;
    display: flex; justify-content: center; align-items: center;
    margin-right: 15px;
}

.banner-text h3 { font-size: 1rem; margin-bottom: 2px; }
.banner-text p { font-size: 0.8rem; opacity: 0.9; }
.banner .arrow { margin-left: auto; }

/* Grid Lists */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grid-item, .list-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.grid-item:hover, .list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-color: rgba(79, 70, 229, 0.3);
}

.grid-item h4, .list-item h4 { font-size: 0.9rem; margin-bottom: 4px; color: var(--text-main); }
.grid-item p, .list-item p { font-size: 0.75rem; color: var(--text-muted); }

/* Skeleton Loading */
.skeleton-card {
    height: 90px;
    background: linear-gradient(90deg, rgba(255,255,255,0.5) 25%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0.5) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 14px;
}

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

/* Ticket View */
.ticket-card {
    text-align: center;
    margin-bottom: 20px;
    background: white;
    position: relative;
}

.ticket-card::before, .ticket-card::after {
    content: '';
    position: absolute;
    top: 70px;
    width: 30px;
    height: 30px;
    background: var(--bg-gradient);
    border-radius: 50%;
    z-index: 2;
}

.ticket-card::before { left: -15px; border-right: 1px solid var(--glass-border); }
.ticket-card::after { right: -15px; border-left: 1px solid var(--glass-border); }

.ticket-header {
    border-bottom: 2px dashed rgba(0,0,0,0.1);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.ticket-header h4 { font-size: 1.2rem; color: var(--primary); }
.ticket-header p { font-size: 0.9rem; color: var(--text-muted); }

.queue-number h1 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 5px 0;
}

.queue-number span, .booking-code span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.booking-code { margin-top: 20px; }
.booking-code h2 { font-size: 2rem; font-family: monospace; letter-spacing: 4px; margin: 5px 0; }
.booking-code .instruction { font-size: 0.75rem; color: var(--danger); margin-top: 10px; }

.status-box {
    display: flex;
    align-items: center;
    background: rgba(16, 185, 129, 0.1);
    padding: 12px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: left;
}

.status-box i { font-size: 1.5rem; color: var(--secondary); margin-right: 15px; }
.status-text span { font-size: 1.1rem; font-weight: 700; color: var(--secondary); }
.status-text p { font-size: 0.75rem; color: var(--text-muted); margin: 0; }

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    white-space: nowrap;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--secondary); }

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: space-around;
    padding: 10px 15px 15px 15px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    z-index: 100;
    border-radius: 24px 24px 0 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 12px;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.nav-item.active {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

.nav-item:hover {
    color: var(--primary);
}

/* History Card */
.history-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary);
}
.history-card .h-info h4 { margin-bottom: 3px; font-size: 0.95rem; }
.history-card .h-info p { font-size: 0.8rem; color: var(--text-muted); }
.history-card .h-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-ONLINE { background: rgba(16, 185, 129, 0.1); color: var(--secondary); }
.status-BATAL { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.status-SELESAI { background: rgba(107, 114, 128, 0.1); color: var(--text-muted); }

/* Tenant Status Card */
.tenant-status-card {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 12px;
}
.ts-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    display: flex; justify-content: center; align-items: center;
    margin-right: 15px;
    font-size: 1.2rem;
}
.ts-info { flex: 1; }
.ts-info h4 { font-size: 0.9rem; margin-bottom: 2px; }
.ts-info p { font-size: 0.75rem; color: var(--text-muted); }
.ts-numbers {
    text-align: right;
}
.ts-numbers .saatini {
    font-size: 1.2rem; font-weight: 700; color: var(--primary);
}
.ts-numbers .menunggu {
    font-size: 0.75rem; color: var(--text-muted); display: block;
}
/* Modal styling */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: 20px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    transform: translateY(20px);
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.modal-overlay.show .modal-box {
    transform: translateY(0);
}

.modal-box h3 {
    margin-bottom: 10px;
    color: var(--text-main);
}

.modal-box p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.modal-box input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    margin-bottom: 20px;
    outline: none;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions button {
    flex: 1;
}

.btn-cancel {
    background: rgba(0,0,0,0.05);
    color: var(--text-main);
}
