/*************************************************************
 * 🎨 ESTILOS PARA SCANNER DE ASISTENCIA MÓVIL
 *************************************************************/

/* PREVENIR SCROLL HORIZONTAL */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* POPUP PRINCIPAL */
.swal2-popup.mobile-friendly {
    background: linear-gradient(135deg, #001a00 0%, #003300 100%);
    border: 2px solid #00ff41;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.3),
                0 0 60px rgba(0, 255, 65, 0.1) inset;
    border-radius: 20px;
    overflow: hidden !important;
    max-width: 95vw !important;
    width: 95vw !important;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* CONTENEDOR PRINCIPAL DEL SCANNER */
.mobile-scanner {
    position: relative;
    padding: 10px;
    background: rgba(0, 30, 0, 0.9);
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* HEADER DEL SCANNER */
.scanner-header {
    text-align: center;
    margin-bottom: 5px;
    animation: pulse-glow 2s infinite;
    width: 100%;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 10px #00ff41; }
    50% { text-shadow: 0 0 20px #00ff41, 0 0 30px #00ff41; }
}

.scanner-title {
    color: #00ff41;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
    text-transform: uppercase;
    background: linear-gradient(90deg, #00ff41, #39ff14);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-break: break-word;
}

.scanner-subtitle {
    color: #b8ffb8;
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 2px 0;
}

/* SECCIÓN DE NOMBRE */
.scanner-section {
    background: rgba(0, 50, 0, 0.3);
    border: 1px solid #00ff41;
    border-radius: 12px;
    padding: 8px;
    margin: 5px 0;
    text-align: center;
    animation: border-pulse 3s infinite;
    width: 100%;
    box-sizing: border-box;
}

@keyframes border-pulse {
    0%, 100% { border-color: #00ff41; box-shadow: 0 0 15px rgba(0, 255, 65, 0.3); }
    50% { border-color: #39ff14; box-shadow: 0 0 25px rgba(57, 255, 20, 0.5); }
}

.section-name {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    word-break: break-word;
}

/* VISUALIZADOR DEL SCANNER */
.scanner-visual {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 5px auto;
    transition: transform 0.3s ease;
    max-width: 100%;
}

.scanner-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: scan-rotate 4s linear infinite;
}

@keyframes scan-rotate {
    0% { transform: rotate(0deg); border-top-color: #00ff41; }
    25% { border-right-color: #39ff14; }
    50% { border-bottom-color: #00ff88; }
    75% { border-left-color: #39ff14; }
    100% { transform: rotate(360deg); border-top-color: #00ff41; }
}

/* PUNTOS FLOTANTES */
.scanner-dots {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
}

.scanner-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #00ff41;
    border-radius: 50%;
    animation: dot-float 2s infinite ease-in-out;
    box-shadow: 0 0 10px #00ff41;
}

@keyframes dot-float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.7; }
    50% { transform: translateY(-10px) scale(1.2); opacity: 1; }
}

/* CENTRO DEL SCANNER */
.scanner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 255, 65, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #00ff41;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.4);
}

.center-icon {
    font-size: 1.8rem;
    animation: icon-bounce 1.5s infinite;
}

@keyframes icon-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ONDAS EXPANSIVAS */
.wave-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    pointer-events: none;
}

.wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(0, 255, 65, 0.3);
    border-radius: 50%;
    animation: wave-expand 3s infinite;
}

@keyframes wave-expand {
    0% { width: 0; height: 0; opacity: 1; }
    100% { width: 140px; height: 140px; opacity: 0; }
}

/* BARRA DE PROGRESO */
.scanner-progress {
    width: 100%;
    margin-top: 10px;
    box-sizing: border-box;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
    color: #b8ffb8;
    font-size: 0.8rem;
    width: 100%;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 40, 0, 0.8);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #007700;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff41, #39ff14);
    width: 0%;
    border-radius: 6px;
    transition: width 0.1s linear;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ESTADÍSTICAS */
.progress-stats {
    display: flex;
    justify-content: space-around;
    gap: 5px;
    margin-top: 8px;
    color: #00ff41;
    width: 100%;
}

.stat-item {
    text-align: center;
    padding: 4px 6px;
    background: rgba(0, 50, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 65, 0.2);
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    display: block;
    color: #39ff14;
    transition: all 0.2s ease;
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* TEXTO DE PROCESAMIENTO */
.processing-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #00ff41;
    margin-top: 8px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: #00ff41;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ANIMACIONES GENERALES */
@keyframes explosion {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes starFly {
    0% { transform: translate(0,0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) rotate(360deg) scale(0); opacity: 0; }
}

@keyframes sparkFly {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0); opacity: 0; }
}

/* ANIMACIÓN DE DESVANECIMIENTO SUAVE */
@keyframes fadeOut {
    0% { opacity: 1; transform: scale(1); }
    70% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 0; transform: scale(0.95); }
}

.scanner-fade-out {
    animation: fadeOut 0.4s ease-out forwards !important;
}

/* MEDIA QUERIES */
@media (max-height: 700px) {
    .scanner-visual {
        width: 140px;
        height: 140px;
    }
    
    .scanner-center {
        width: 45px;
        height: 45px;
    }
    
    .center-icon {
        font-size: 1.5rem;
    }
}

@media (max-width: 350px) {
    .scanner-title {
        font-size: 1.2rem;
    }
    
    .scanner-visual {
        width: 130px;
        height: 130px;
    }
    
    .stat-value {
        font-size: 0.9rem;
    }
}

/* ESTILOS PARA FUEGOS ARTIFICIALES Y ESTRELLAS */
.firework-spark {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
    z-index: 1500;
    pointer-events: none;
    box-shadow: 0 0 8px currentColor;
}

.star-effect {
    position: absolute;
    font-size: 18px;
    color: #00ff41;
    left: 20%;
    top: 30%;
    opacity: 1;
    z-index: 2000;
    pointer-events: none;
    text-shadow: 0 0 10px #00ff41;
}

/* ESTADO DE ÉXITO */
.success-visual {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-glow {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #00ff41 0%, #00aa22 50%, transparent 80%);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

.success-icon {
    position: absolute;
    font-size: 3rem;
    animation: bounce 0.3s infinite;
}

.success-ring {
    position: absolute;
    width: 140px;
    height: 140px;
    border: 2px solid #00ff41;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}