/**
 * Tickvent Estilos del Escáner QR Frontend
 */

.tickvent-scanner-app {
    max-width: 580px;
    margin: 30px auto;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

.tickvent-scanner-app * {
    box-sizing: border-box;
}

/* Header */
.scanner-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 16px;
}

.scanner-header h2 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.scanner-event-badge {
    display: inline-block;
    background: #1e293b;
    color: #38bdf8;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
}

/* Barra de Controles y Selector de Cámara */
.scanner-controls-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.camera-select-wrapper {
    width: 100%;
}

.tickvent-select {
    width: 100%;
    background: #1e293b;
    color: #ffffff;
    border: 1px solid #334155;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

.camera-buttons {
    display: flex;
    gap: 10px;
}

.tickvent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.tickvent-btn-accent {
    background: #2563eb;
    color: #ffffff;
    width: 100%;
}

.tickvent-btn-accent:hover {
    background: #1d4ed8;
}

.tickvent-btn-secondary {
    background: #475569;
    color: #ffffff;
    width: 100%;
}

.tickvent-btn-secondary:hover {
    background: #334155;
}

.tickvent-btn-success {
    background: #16a34a;
    color: #ffffff;
}

.tickvent-btn-success:hover {
    background: #15803d;
}

.tickvent-btn-primary {
    background: #0f172a;
    color: #ffffff;
}

/* Viewport de Cámara y Animación Láser */
.scanner-viewport-box {
    position: relative;
    width: 100%;
    height: 320px;
    background: #000000;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #334155;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tickvent-camera-viewport {
    width: 100%;
    height: 100%;
}

/* Cuadrante de enfoque y rayo láser */
.scanner-overlay-aim {
    position: absolute;
    width: 220px;
    height: 220px;
    pointer-events: none;
}

.aim-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: #38bdf8;
    border-style: solid;
}

.aim-corner.top-left {
    top: 0;
    left: 0;
    border-width: 4px 0 0 4px;
    border-top-left-radius: 8px;
}

.aim-corner.top-right {
    top: 0;
    right: 0;
    border-width: 4px 4px 0 0;
    border-top-right-radius: 8px;
}

.aim-corner.bottom-left {
    bottom: 0;
    left: 0;
    border-width: 0 0 4px 4px;
    border-bottom-left-radius: 8px;
}

.aim-corner.bottom-right {
    bottom: 0;
    right: 0;
    border-width: 0 4px 4px 0;
    border-bottom-right-radius: 8px;
}

.aim-laser {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444, 0 0 20px #ef4444;
    top: 0;
    animation: laserScan 2s infinite ease-in-out;
}

@keyframes laserScan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.scanner-status-message {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: #94a3b8;
}

/* Pantalla de Bloqueo por PIN */
.tickvent-scanner-auth-box .auth-card {
    text-align: center;
    padding: 30px 20px;
}

.auth-icon svg {
    color: #38bdf8;
    margin-bottom: 12px;
}

.pin-input-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pin-input-group input {
    width: 140px;
    padding: 12px;
    font-size: 20px;
    letter-spacing: 4px;
    text-align: center;
    border-radius: 10px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #ffffff;
}

.auth-error-msg {
    margin-top: 12px;
    color: #f87171;
    font-size: 13px;
}

/* Modal Popup del Escaneo */
.scanner-popup-content {
    background: #f8fafc;
    padding: 0;
    overflow: hidden;
    max-width: 540px;
}

.scan-result-banner {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #ffffff;
}

.scan-result-banner.banner-admitted {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
}

.scan-result-banner.banner-already-used {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    animation: pulseWarning 1.5s infinite;
}

@keyframes pulseWarning {
    0% { opacity: 1; }
    50% { opacity: 0.85; }
    100% { opacity: 1; }
}

.scan-result-banner.banner-pending {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.scan-result-banner h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
}

.scan-result-banner p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.scanned-ticket-view {
    padding: 16px 20px 0 20px;
}

.scanned-ticket-view .tickvent-ticket-wrapper {
    margin: 0 auto;
}

.scan-modal-actions {
    padding: 16px 24px 20px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 580px) {
    .tickvent-scanner-app {
        margin: 14px auto;
        padding: 16px;
        border-radius: 14px;
    }
    .scanner-viewport-box {
        min-height: 280px;
        border-radius: 12px;
    }
    .scan-result-banner {
        padding: 14px 16px;
        gap: 12px;
    }
    .scan-result-banner h3 {
        font-size: 16px;
    }
    .scanned-ticket-view {
        padding: 12px 10px 0 10px;
    }
    .scan-modal-actions {
        padding: 14px 16px;
        flex-direction: column;
        gap: 10px;
    }
    .scan-modal-actions .tickvent-btn {
        width: 100%;
        justify-content: center;
    }
}
