/**
 * Profile Picture Viewer
 * Visor profesional de fotos de perfil - Estilo minimalista similar a redes sociales modernas
 * Soporte completo para modo claro y oscuro
 * Responsive y escalable
 */

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.profile-picture-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
}

.profile-picture-viewer.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* Modo oscuro */
.dark-mode .profile-picture-viewer {
    background-color: rgba(0, 0, 0, 0.85);
}

/* ============================================
   CONTENEDOR DE LA IMAGEN
   ============================================ */
.profile-picture-viewer__container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: profileViewerFadeIn 0.3s ease-out;
}

@keyframes profileViewerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   IMAGEN DE PERFIL
   ============================================ */
.profile-picture-viewer__image {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 4px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

.profile-picture-viewer__image:hover {
    transform: scale(1.02);
}

/* Modo oscuro */
.dark-mode .profile-picture-viewer__image {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ============================================
   INFORMACIÓN DEL USUARIO
   ============================================ */
.profile-picture-viewer__info {
    margin-top: 24px;
    text-align: center;
    color: #ffffff;
    max-width: 400px;
}

.profile-picture-viewer__name {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 4px 0;
    color: #ffffff;
}

.profile-picture-viewer__username {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
}

/* Modo oscuro */
.dark-mode .profile-picture-viewer__name {
    color: #ffffff;
}

.dark-mode .profile-picture-viewer__username {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   BOTÓN DE CERRAR
   ============================================ */
.profile-picture-viewer__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10001;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    line-height: 1;
    flex-shrink: 0;
}

.profile-picture-viewer__close:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.profile-picture-viewer__close:active {
    transform: scale(0.95);
}

/* CRÍTICO: Asegurar que el icono dentro del botón esté centrado perfectamente */
.profile-picture-viewer__close i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    margin: 0;
    padding: 0;
}

/* Modo oscuro */
.dark-mode .profile-picture-viewer__close {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.dark-mode .profile-picture-viewer__close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   RESPONSIVE - MÓVILES
   ============================================ */
@media (max-width: 768px) {
    .profile-picture-viewer__container {
        max-width: 95vw;
        padding: 16px;
    }

    .profile-picture-viewer__image {
        max-height: 60vh;
        border-width: 3px;
    }

    .profile-picture-viewer__info {
        margin-top: 20px;
        max-width: 90%;
    }

    .profile-picture-viewer__name {
        font-size: 18px;
    }

    .profile-picture-viewer__username {
        font-size: 14px;
    }

    .profile-picture-viewer__close {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        max-width: 36px;
        max-height: 36px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .profile-picture-viewer__container {
        padding: 12px;
    }

    .profile-picture-viewer__image {
        max-height: 50vh;
        border-width: 2px;
    }

    .profile-picture-viewer__info {
        margin-top: 16px;
    }

    .profile-picture-viewer__name {
        font-size: 16px;
    }

    .profile-picture-viewer__username {
        font-size: 13px;
    }

    .profile-picture-viewer__close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        max-width: 32px;
        max-height: 32px;
        font-size: 16px;
    }
}

/* ============================================
   TABLETS
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .profile-picture-viewer__container {
        max-width: 85vw;
    }

    .profile-picture-viewer__image {
        max-height: 65vh;
    }
}

/* ============================================
   ANIMACIONES Y TRANSICIONES
   ============================================ */
.profile-picture-viewer__image {
    animation: profileImageZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes profileImageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */
.profile-picture-viewer__close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.profile-picture-viewer__close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* ============================================
   PREVENIR SCROLL DEL BODY
   ============================================ */
body.profile-viewer-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

