/*==================================================
                QR SCANNER MODAL
==================================================*/

.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.qr-modal.hidden {
    display: none !important;
}

.qr-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.qr-modal-card {
    position: relative;
    z-index: 2;
    width: min(420px, 94vw);
    max-height: min(88vh, 640px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px 20px 20px;
    background: #18181b;
    border: 1px solid rgba(214, 40, 40, 0.35);
    border-radius: 24px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(214, 40, 40, 0.15);
    text-align: center;
    animation: qrModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Custom Scrollbar for Modal Card */
.qr-modal-card::-webkit-scrollbar {
    width: 5px;
}
.qr-modal-card::-webkit-scrollbar-track {
    background: transparent;
}
.qr-modal-card::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

@keyframes qrModalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/*================ CLOSE =================*/

.qr-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #27272a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e4e4e7;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.qr-close:hover {
    background: var(--accent, #d62828);
    color: #fff;
    transform: rotate(90deg);
}

/*================ ICON & HEADER =================*/

.qr-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 14px;
    background: rgba(214, 40, 40, 0.12);
    border: 1px solid rgba(214, 40, 40, 0.3);
    color: var(--accent, #d62828);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.qr-modal-card h2 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.qr-modal-card > p {
    color: #a1a1aa;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/*================ QR READER =================*/

.qr-reader {
    width: 100%;
    max-width: 260px;
    height: 260px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #09090b;
    border: 2px solid rgba(214, 40, 40, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.qr-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 16px;
    display: block !important;
}

#qr-reader__scan_region {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: unset !important;
}

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

#qr-reader__scan_region img,
#qr-reader img {
    display: none !important;
}

#qr-reader__dashboard,
#qr-reader__dashboard_section,
#qr-reader__dashboard_section_csr,
#qr-reader__header_message {
    display: none !important;
}

/*================ STATUS =================*/

.qr-status {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #27272a;
    color: #d4d4d8;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    line-height: 1.4;
}

.qr-status i {
    color: var(--accent, #d62828);
    font-size: 14px;
}

.qr-status.success {
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.3);
    color: #4ade80;
}

.qr-status.success i {
    color: #4ade80;
}

.qr-status.error {
    background: rgba(214, 40, 40, 0.12);
    border-color: rgba(214, 40, 40, 0.3);
    color: #f87171;
}

.qr-status.error i {
    color: #f87171;
}

.qr-status.loading i {
    color: var(--accent, #d62828);
}

/*==================================================
                QR LINK INPUT
==================================================*/

.qr-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 14px;
    color: #71717a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.qr-divider::before,
.qr-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #27272a;
}

.qr-link-form {
    text-align: left;
}

.qr-link-form label {
    display: block;
    color: #e4e4e7;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.qr-input-group {
    display: flex;
    gap: 8px;
}

.qr-input-group input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #3f3f46;
    background: #27272a;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.qr-input-group input:focus {
    border-color: var(--accent, #d62828);
    box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.15);
}

.qr-input-group input::placeholder {
    color: #71717a;
}

.qr-input-group button {
    width: 42px;
    height: 40px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-link-form small {
    display: block;
    margin-top: 6px;
    color: #71717a;
    font-size: 11.5px;
}