﻿.qr-placeholder {
    width: 275px;
    height: 280px;
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    color: #3E5553;
    background-color: rgba(62, 85, 83, 0.05);
    border: 3px dashed #3E5553;
    animation: borderPulse 2s infinite, glow 3s infinite;
    overflow: hidden; /* necesario para el efecto barrido */
}

/* Efecto de pulso en el borde */
@keyframes borderPulse {
    0% {
        border-color: #3E5553;
    }

    50% {
        border-color: #6EA19A;
    }

    100% {
        border-color: #3E5553;
    }
}

/* Efecto de brillo suave */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(110, 161, 154, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(110, 161, 154, 0.9);
    }

    100% {
        box-shadow: 0 0 5px rgba(110, 161, 154, 0.5);
    }
}

/* Texto parpadeante */
.qr-placeholder span {
    animation: blink 1.5s infinite;
    font-weight: bold;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Efecto barrido diagonal */
.qr-placeholder::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient( 120deg, transparent 0%, rgba(110, 161, 154, 0.2) 50%, transparent 100% );
    animation: sweep 3s infinite;
}

@keyframes sweep {
    0% {
        transform: translateX(-100%) rotate(25deg);
    }

    100% {
        transform: translateX(100%) rotate(25deg);
    }
}

/* Transparencia en la vista previa */
.xaf-preview-image-detail-view,
.xaf-preview-image-detail-view[style] {
    background-color: transparent !important;
    color: #3E5553 !important;
    opacity: 1 !important;
    position: relative !important;
}

/* ===== CONTENEDORES DE FOTOS PARA PERFIL E IDENTIFICACIÓN ===== */

/* Contenedor base para ambas fotos */
.foto-placeholder-base {
    width: 200px;
    height: 200px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    color: #4A5568;
    background-color: rgba(74, 85, 104, 0.05);
    border: 2px dashed #4A5568;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Placeholder para foto de perfil */
.foto-perfil-placeholder {
    @extend .foto-placeholder-base;
    border-radius: 12px; /* Cuadrado como identificación */
    background-color: rgba(59, 130, 246, 0.05);
    border-color: #3B82F6;
    color: #3B82F6;
    animation: borderMovement 3s infinite, subtlePulse 4s infinite;
}

/* Icono de fondo removido para evitar conflictos con imágenes */

/* Placeholder para foto de identificación */
.foto-identificacion-placeholder {
    @extend .foto-placeholder-base;
    border-radius: 8px; /* Rectangular para identificación */
    background-color: rgba(16, 185, 129, 0.05);
    border-color: #10B981;
    color: #10B981;
    animation: borderMovement 3s infinite 1s, subtlePulse 4s infinite; /* 1s delay para que no se sincronicen */
}

/* Icono de fondo removido para evitar conflictos con imágenes */

/* Texto del placeholder */
.foto-placeholder-base span {
    position: relative;
    z-index: 2;
    font-weight: 600;
    line-height: 1.4;
}

/* Efectos hover */
.foto-perfil-placeholder:hover {
    border-color: #2563EB;
    background-color: rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.foto-identificacion-placeholder:hover {
    border-color: #059669;
    background-color: rgba(16, 185, 129, 0.1);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

/* Animación de movimiento del borde */
@keyframes borderMovement {
    0% {
        border-style: dashed;
        border-width: 2px;
        transform: rotate(0deg);
    }
    25% {
        border-width: 3px;
        transform: rotate(1deg);
    }
    50% {
        border-style: dashed;
        border-width: 2px;
        transform: rotate(0deg);
    }
    75% {
        border-width: 3px;
        transform: rotate(-1deg);
    }
    100% {
        border-style: dashed;
        border-width: 2px;
        transform: rotate(0deg);
    }
}

/* Animación sutil de pulso */
@keyframes subtlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Estados cuando ya hay imagen */
.foto-placeholder-base.has-image {
    border-style: solid;
    border-width: 3px;
    animation: none;
    transform: none;
}

/* Centrar imágenes dentro del contenedor */
.foto-placeholder-base img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin: auto;
}

/* Asegurar que el contenedor sea flex para centrar */
.foto-placeholder-base {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .foto-placeholder-base {
        width: 150px;
        height: 150px;
        padding: 10px;
        font-size: 0.8rem;
    }
    
    .foto-perfil-placeholder::before,
    .foto-identificacion-placeholder::before {
        width: 60px;
        height: 60px;
    }
}
