/* Estilos específicos para el escáner de billetes */

.escaner-container {
    max-width: 100%;
    padding: 10px;
}

.escaner-card {
    padding: 20px;
    margin-bottom: 20px;
}

.camara-wrapper {
    position: relative;
    width: 100%;
    height: 200px; /*300px*/
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin: 20px 0;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay con guía visual */
.overlay-guia {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.marco-escaneo {
    position: relative;
    width: 260px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
}

/* Esquinas del marco */
.esquina {
    position: absolute;
    width: 12px;
    height: 20px;
    border: 2px solid #10b981;
}

.esquina-tl {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.esquina-tr {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
}

.esquina-bl {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
}

.esquina-br {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

/* Línea de escaneo animada */
.linea-escaneo {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, #10b981, transparent);
    top: 0;
    animation: scan 2s linear infinite;
    box-shadow: 0 0 10px #10b981;
}

@keyframes scan {
    0% {
        top: 0;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.guia-texto {
    color: white;
    margin-top: 20px;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
}

/* Botón de captura */
.btn-capturar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: white;
    border: 4px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    pointer-events: auto;
}

.btn-capturar:active {
    transform: translateX(-50%) scale(0.95);
    background: #f3f4f6;
}

.icono-camara {
    font-size: 24px;
    line-height: 1;
}

.btn-capturar span:last-child {
    font-size: 10px;
    color: #374151;
    margin-top: 2px;
}

/* Controles */
.controles-camara {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-secundario {
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-secundario:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-primario {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primario:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

/* Resultado del escaneo */
.resultado-escaner {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.resultado-escaner h3 {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.numero-detectado {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px dashed #e5e7eb;
    margin: 15px 0;
    word-break: break-all;
}

.acciones-detectado {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Procesando */
.procesando {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.procesando p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Volver link */
.volver-link {
    display: block;
    text-align: center;
    color: white;
    text-decoration: none;
    font-size: 14px;
    margin-top: 20px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.volver-link:hover {
    opacity: 1;
}

/* Spinner inline */
.spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Indicador de detección en tiempo real */
.detection-indicator {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10;
}

/* Botón flash activo */
.btn-secundario.activo {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

/* Animación de éxito */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.resultado-exito {
    animation: successPulse 0.5s ease;
}

/* Overlay de escaneo activo */
.escaneando-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Responsive */
@media (max-width: 480px) {
    .camara-wrapper {
        height: 180px;
    }

    .marco-escaneo {
        width: 240px;
        height: 40px;
    }

    .numero-detectado {
        font-size: 24px;
        letter-spacing: 2px;
    }
}