/* ===================================================
   Slotify Check-in Scanner — Styles
   Mobile-first, clean, event-ready UI
   =================================================== */

/* --- Reset & Container --- */
.slotify-checkin *,
.slotify-checkin *::before,
.slotify-checkin *::after {
    box-sizing: border-box;
}

.slotify-checkin {
    --sl-primary: #4f46e5;
    --sl-primary-hover: #4338ca;
    --sl-success: #16a34a;
    --sl-success-bg: #f0fdf4;
    --sl-success-border: #bbf7d0;
    --sl-error: #dc2626;
    --sl-error-bg: #fef2f2;
    --sl-error-border: #fecaca;
    --sl-info: #2563eb;
    --sl-info-bg: #eff6ff;
    --sl-info-border: #bfdbfe;
    --sl-warning-bg: #fffbeb;
    --sl-warning-border: #fde68a;
    --sl-text: #1e293b;
    --sl-text-muted: #64748b;
    --sl-bg: #f8fafc;
    --sl-card-bg: #ffffff;
    --sl-border: #e2e8f0;
    --sl-radius: 16px;
    --sl-radius-sm: 10px;
    --sl-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --sl-shadow-md: 0 4px 12px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);

    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--sl-text);
    -webkit-font-smoothing: antialiased;
}

/* --- Header --- */
.slotify-checkin__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.slotify-checkin__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
    color: var(--sl-text);
}

.slotify-checkin__actions {
    display: flex;
    gap: 8px;
}

/* --- Buttons --- */
.slotify-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid var(--sl-border);
    border-radius: var(--sl-radius-sm);
    background: var(--sl-card-bg);
    color: var(--sl-text);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.slotify-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.slotify-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.slotify-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.slotify-btn--primary {
    background: var(--sl-primary);
    color: #fff;
    border-color: var(--sl-primary);
}

.slotify-btn--primary:hover:not(:disabled) {
    background: var(--sl-primary-hover);
    border-color: var(--sl-primary-hover);
}

.slotify-btn--danger {
    background: transparent;
    color: var(--sl-error);
    border-color: var(--sl-error);
}

.slotify-btn--danger:hover:not(:disabled) {
    background: var(--sl-error);
    color: #fff;
}

.slotify-btn--sm {
    padding: 8px 14px;
    font-size: 13px;
}

.slotify-btn--icon {
    padding: 8px;
    min-width: 38px;
}

/* --- Status Bar --- */
.slotify-status {
    border-radius: var(--sl-radius-sm);
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--sl-info-border);
    background: var(--sl-info-bg);
    transition: all 0.25s ease;
    animation: sl-fadeIn 0.2s ease;
}

.slotify-status--ok {
    background: var(--sl-success-bg);
    border-color: var(--sl-success-border);
}

.slotify-status--err {
    background: var(--sl-error-bg);
    border-color: var(--sl-error-border);
}

.slotify-status--loading {
    background: var(--sl-warning-bg);
    border-color: var(--sl-warning-border);
}

.slotify-status__head {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.slotify-status__icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.slotify-status__text {
    flex: 1;
    min-width: 0;
}

.slotify-status__title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    color: var(--sl-text);
}

.slotify-status__msg {
    font-size: 13px;
    color: var(--sl-text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.slotify-status__details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,.06);
}

.slotify-status__row {
    font-size: 13px;
    margin-top: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    line-height: 1.4;
}

.slotify-status__row:first-child {
    margin-top: 0;
}

.slotify-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: rgba(0,0,0,.05);
    border: 1px solid rgba(0,0,0,.08);
    color: var(--sl-text-muted);
}

/* --- Scanner Card --- */
.slotify-scanner-card {
    background: var(--sl-card-bg);
    border: 1px solid var(--sl-border);
    border-radius: var(--sl-radius);
    box-shadow: var(--sl-shadow);
    overflow: hidden;
    margin-bottom: 16px;
}

/* --- QR Reader --- */
.slotify-qr {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 380px;
    background: #0f172a;
    overflow: hidden;
}

.slotify-qr video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* placeholder when camera is off */
.slotify-qr--idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #94a3b8;
    font-size: 14px;
}

.slotify-qr--idle .slotify-qr__icon {
    width: 64px;
    height: 64px;
    border: 2px dashed #475569;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

/* --- Divider --- */
.slotify-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    color: var(--sl-text-muted);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slotify-divider::before,
.slotify-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--sl-border);
}

/* --- Manual Input --- */
.slotify-manual {
    display: flex;
    gap: 8px;
    padding: 16px 20px 20px;
}

.slotify-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--sl-border);
    border-radius: var(--sl-radius-sm);
    background: var(--sl-bg);
    color: var(--sl-text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.slotify-input::placeholder {
    color: #94a3b8;
}

/* --- Footer --- */
.slotify-footer {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

/* --- Login --- */
.slotify-checkin-login {
    max-width: 380px;
    margin: 40px auto;
    padding: 32px 28px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.slotify-checkin-login h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1e293b;
    letter-spacing: -0.3px;
}

.slotify-checkin-login .slotify-login__sub {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px;
}

.slotify-checkin-login .slotify-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.slotify-checkin-login input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: 14px;
    box-sizing: border-box;
    text-align: center;
    letter-spacing: 2px;
}

.slotify-checkin-login input[type="password"]:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.slotify-checkin-login button[type="submit"] {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.slotify-checkin-login button[type="submit"]:hover {
    background: #4338ca;
}

.slotify-checkin-login button[type="submit"]:active {
    transform: scale(0.98);
}

.slotify-checkin-login .slotify-login__note {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 12px;
}

/* --- Animations --- */
@keyframes sl-fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes sl-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.slotify-status--loading {
    animation: sl-pulse 1.5s ease-in-out infinite;
}

/* --- Counter badge --- */
.slotify-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--sl-card-bg);
    border: 1px solid var(--sl-border);
    border-radius: var(--sl-radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--sl-text);
    margin-bottom: 16px;
}

.slotify-counter__num {
    font-size: 18px;
    font-weight: 700;
    color: var(--sl-primary);
    font-variant-numeric: tabular-nums;
}

/* --- Responsive --- */
@media (max-width: 520px) {
    .slotify-checkin {
        padding: 12px;
    }

    .slotify-checkin__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .slotify-checkin__actions {
        width: 100%;
    }

    .slotify-checkin__actions .slotify-btn {
        flex: 1;
    }

    .slotify-qr {
        max-height: 320px;
    }

    .slotify-manual {
        flex-direction: column;
    }

    .slotify-manual .slotify-btn {
        width: 100%;
    }

    .slotify-checkin-login {
        margin: 20px auto;
        padding: 24px 20px;
    }
}
