:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --bg-dark: #09090b;
    --card-bg: #18181b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #27272a;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at 50% -20%, #1f2937 0%, var(--bg-dark) 80%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-container {
    text-align: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 30px;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
}

.error-container h2 {
    color: var(--error);
    margin-bottom: 10px;
}

.error-container p {
    color: var(--text-secondary);
}

/* Pass Card */
.pass-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.5s ease-out;
}

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

.status-banner {
    width: 100%;
    text-align: center;
    padding: 12px;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 14px;
    z-index: 10;
    margin-bottom: -10px;
}

.status-approved { background: rgba(16, 185, 129, 0.1); color: var(--primary); border: 1px solid rgba(16, 185, 129, 0.2); }
.status-pending { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.status-checked-in { background: rgba(59, 130, 246, 0.1); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.2); }
.status-scanned { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.status-expired, .status-revoked, .status-cancelled { background: rgba(239, 68, 68, 0.1); color: var(--error); border: 1px solid rgba(239, 68, 68, 0.2); }

.pass-card {
    background: rgba(24, 24, 27, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(16, 185, 129, 0.05);
    position: relative;
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.pass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 35px 65px -15px rgba(0, 0, 0, 0.9), 0 0 50px rgba(16, 185, 129, 0.1);
}

.pass-header {
    text-align: center;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.company-logo {
    display: inline-block;
    background: var(--bg-dark);
    padding: 12px 20px;
    border-radius: 12px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.pass-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.qr-section {
    padding: 30px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qrcode {
    background: white;
    padding: 16px;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 0 30px rgba(255,255,255,0.05), inset 0 0 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.qrcode:hover {
    transform: scale(1.02);
    box-shadow: 0 0 40px rgba(255,255,255,0.15), inset 0 0 10px rgba(0,0,0,0.1);
}

.qr-instruction {
    font-size: 13px;
    color: var(--text-secondary);
}

.qr-unavailable {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.05) 100%);
    margin: 24px;
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 50px 20px;
    box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.05);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.qr-unavailable::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; right: -50%; bottom: -50%;
    background: radial-gradient(circle at center, rgba(239,68,68,0.2) 0%, transparent 60%);
    animation: pulseGlow 3s infinite alternate ease-in-out;
    pointer-events: none;
}

@keyframes pulseGlow {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 1; }
}

.unavailable-icon {
    color: var(--error);
    margin-bottom: 16px;
    opacity: 0.9;
    filter: drop-shadow(0 0 10px rgba(239,68,68,0.6));
    animation: iconShake 0.5s ease-in-out;
}

@keyframes iconShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

#qr-unavailable-message {
    color: #fca5a5;
    font-weight: 500;
    font-size: 16px;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 0 24px;
    position: relative;
}

.divider::before, .divider::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--bg-dark);
    border-radius: 50%;
    top: -12px;
    border-right: 1px solid var(--border);
}

.divider::before {
    left: -36px;
}

.divider::after {
    right: -36px;
    border-right: none;
    border-left: 1px solid var(--border);
}

.details-section {
    padding: 24px;
}

.visitor-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.visitor-initials {
    width: 50px;
    height: 50px;
    background: var(--border);
    border-radius: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.visitor-photo {
    width: 50px;
    height: 50px;
    border-radius: 25px;
    object-fit: cover;
}

.visitor-names h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

.visitor-names p {
    font-size: 14px;
    color: var(--text-secondary);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.info-item label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.info-item span {
    font-size: 14px;
    font-weight: 500;
}

.full-width {
    grid-column: 1 / -1;
}

.expiry-notice {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
}
