/* ================================================
   Booking Verify — Styles
   ================================================ */

/* ── Shared Input Wrap ──────────────────────────────────────── */
.ref-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ref-input-wrap input {
    padding-right: 38px;
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.btn-clear-input {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 0.95rem;
    padding: 4px;
    line-height: 1;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clear-input:hover { color: var(--danger); }

/* ── Verify Actions ─────────────────────────────────────────── */
.verify-actions {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.verify-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* QR button */
.btn-qr {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    color: #fff;
    border: none;
    font-family: 'Prompt', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-qr:hover  { opacity: 0.9; }
.btn-qr:active { transform: scale(0.97); }

/* ── QR Scanner Card ────────────────────────────────────────── */
.scanner-card {
    padding: 0;
    overflow: hidden;
}

.scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.scanner-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--dark-grey-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon-close {
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #777;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.btn-icon-close:hover {
    background: var(--danger);
    color: #fff;
}

/* Viewport */
.scanner-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #000;
    overflow: hidden;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Scanning overlay */
.scanner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Dark mask — the transparent cutout is handled by the frame's shadow */
.scanner-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
}

.scanner-frame {
    position: relative;
    width: 62%;
    aspect-ratio: 1 / 1;
    /* Reveal the frame area by cutting out the dark overlay */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
    border-radius: 4px;
    z-index: 1;
}

/* Corner brackets */
.corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: #fff;
    border-style: solid;
}

.corner.tl { top: -2px; left: -2px;  border-width: 3px 0 0 3px; border-radius: 3px 0 0 0; }
.corner.tr { top: -2px; right: -2px; border-width: 3px 3px 0 0; border-radius: 0 3px 0 0; }
.corner.bl { bottom: -2px; left: -2px;  border-width: 0 0 3px 3px; border-radius: 0 0 0 3px; }
.corner.br { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; border-radius: 0 0 3px 0; }

/* Scan line animation */
.scanner-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4ade80, transparent);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
    animation: scan-line 1.8s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes scan-line {
    0%   { top: 4%;  opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { top: 92%; opacity: 0; }
}

.scanner-hint {
    position: relative;
    z-index: 1;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    text-align: center;
    padding: 0 1rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* Error overlay (camera permission denied etc.) */
.scanner-error-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    text-align: center;
    padding: 1.5rem;
    z-index: 5;
}

.scanner-error-overlay p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Processing overlay */
.scanner-processing {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    gap: 10px;
    z-index: 4;
}

.scanner-processing p {
    margin: 0;
    font-size: 0.9rem;
}

/* Controls bar */
.scanner-controls {
    padding: 0.9rem 1.2rem;
    background: var(--white-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scanner-status {
    margin: 0;
    font-size: 0.82rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Zoom */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zoom-label {
    font-size: 0.82rem;
    color: #666;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 80px;
}

.zoom-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 99px;
    background: linear-gradient(
        to right,
        var(--primary-color) 0%,
        var(--primary-color) var(--zoom-pct, 33%),
        #e0e0e0 var(--zoom-pct, 33%),
        #e0e0e0 100%
    );
    outline: none;
    cursor: pointer;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    cursor: pointer;
}

.zoom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
}

/* ── Result Card ────────────────────────────────────────────── */
.result-card {
    animation: fade-in-up 0.28s ease;
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Result status banner */
.result-status-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.2rem;
    border-radius: 10px;
    margin-bottom: 1.2rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.result-status-banner.success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

.result-status-banner.error {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}

.result-status-banner.warning {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffe082;
}

.result-status-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    line-height: 1;
}

/* Detail grid inside result */
.result-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1.2rem;
    margin-bottom: 1rem;
}

.result-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-detail-item.full-width {
    grid-column: 1 / -1;
}

.result-detail-label {
    font-size: 0.75rem;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.result-detail-value {
    font-size: 0.92rem;
    color: var(--dark-grey-color);
    font-weight: 500;
}

/* Section separator */
.result-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

/* Verify again button */
.btn-verify-again {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 1rem;
    border-radius: 10px;
    border: 2px dashed var(--border-color);
    background: transparent;
    color: #888;
    font-family: 'Prompt', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-verify-again:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

/* ── Loading spinner inside result card ─────────────────────── */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    color: #aaa;
    gap: 12px;
}

.result-loading i {
    font-size: 2rem;
    color: var(--primary-color);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .result-detail-grid {
        grid-template-columns: 1fr;
    }

    .result-detail-item.full-width {
        grid-column: 1;
    }

    .verify-actions {
        flex-direction: column;
    }

    .verify-actions .btn {
        width: 100%;
    }
}