/* ==========================================================
    🎮 Perfil de Usuario - Estilo Gaming Minimalista
    ========================================================== */
    
.profile-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 1080px;
}
/* 1. Contenedor Principal (Header) */
.profile-header {
    width: 100%;
    background: #0f0f10;
    padding: 3rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding-top: 120px;
}

/* 2. Contenedor Interno (Avatar + Info) */
.profile-header-container {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 2rem;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0;
}

@media (min-width: 1024px) {
    .profile-header-inner {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }
}

/* 3. Avatar */
.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar-wrapper {
    width: 140px;
    height: 140px;
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    transition: all 0.3s ease-in-out;
    background-color: var(--panel);
}

form .profile-avatar-wrapper {
    cursor: pointer;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s ease;
    background: black;
}

/* Overlay de edición */
.profile-avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
}

form .profile-avatar-wrapper:hover .profile-avatar-overlay {
    opacity: 1;
}

form .profile-avatar-wrapper:hover .profile-avatar-img {
    filter: brightness(0.7);
}

/* 4. Información del Usuario */
.profile-info {
    text-align: center;
    width: 100%;
    max-width: 600px;
    /* En Escritorio, .profile-info es un contenedor de bloque */
}

@media (min-width: 768px) {
    .profile-info {
        text-align: left;
    }
}

/* ===============================
    AJUSTES DE ESCRITORIO (> 767px)
    =============================== */

/* Ocultar @usuario móvil */
.profile-type-1 {
    display: none;
}

/* Contenedor principal de Nombre, @ Móvil y Botón */
.profile-name-action {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Espacio entre el nombre y el botón */
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .profile-name-action {
        justify-content: flex-start;
        gap: 1.5rem;
    }
}

/* Nombre completo y título */
.profile-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
    margin: 0; /* Asegurar que no hay margen extra */
    font-weight: 800;
}

@media (min-width: 768px) {
    .profile-name {
        justify-content: flex-start;
    }
}

/* Icono de edición */
.profile-edit-icon {
    color: var(--accent);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.profile-edit-icon:hover {
    color: var(--hover);
}

/* @usuario Escritorio (Visible solo en escritorio) */
.profile-type-2 {
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 1rem 0;
}

@media (max-width: 767px) {
    .profile-type-2 {
        display: none;
    }
    
    .profile-header {
        position: relative;
    }
}

/* Resumen/Biografía */
.profile-summary {
    color: white;
    max-width: 600px;
    margin: 0.75rem auto 0;
    line-height: 1.7;
    padding-bottom: 1rem;
    text-align: justify;
}

@media (min-width: 768px) {
    .profile-summary {
        margin: 0.75rem 0 0 0;
    }
}

/* Font Awesome */
.fa-solid {
    background: transparent;
}

/* ===============================
    SEGUIDORES / SIGUIENDO
    =============================== */

.profile-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: .4rem;
    color: white;
}

.stat-item strong {
    font-weight: 800;
}

.stat-item span {
    color: var(--muted);
    font-weight: 500;
}

/* ===============================
    BOTÓN SEGUIR
    =============================== */

.profile-follow-action {
    /* En escritorio se alinea con el nombre gracias a .profile-name-action */
    margin-top: 0;
}

.btn-invite-user,
.btn-follow-user {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 0 12px;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-invite-user:hover,
.btn-follow-user:hover {
    background: white;
    color: var(--accent);
    box-shadow: 0 6px 15px rgba(232, 0, 40, 0.35);
}

.btn-follow-user:active {
    transform: scale(0.95);
}

/* ===============================
    BOTÓN DEJAR DE SEGUIR
    =============================== */

.btn-unfollow-user {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 12px 0;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-unfollow-user:hover {
    background: #e80028;
    border-color: #e80028;
    box-shadow: 0 6px 15px rgba(232, 0, 40, 0.35);
}

.btn-unfollow-user:active {
    transform: scale(0.95);
}

/* ===============================
    TRANSICIÓN ANIMADA ENTRE BOTONES
    =============================== */

.btn-follow-user,
.btn-unfollow-user {
    position: relative;
    overflow: hidden;
    transition:
        background 0.35s ease,
        color 0.3s ease,
        transform 0.25s ease,
        box-shadow 0.3s ease,
        border 0.3s ease;
}

/* Efecto visual deslizante */
.btn-follow-user::after,
.btn-unfollow-user::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

.btn-follow-user.animating::after,
.btn-unfollow-user.animating::after {
    transform: translateX(100%);
}

/* Micro animación morph */
.btn-follow-user.animating,
.btn-unfollow-user.animating {
    animation: morphButton 0.35s ease;
}

@keyframes morphButton {
    0% { transform: scale(1); }
    50% { transform: scale(0.92); }
    100% { transform: scale(1); }
}


/* ==========================================================
    📱 ORDEN RESPONSIVE MOBILE PERFIL
    1. Nombre
    2. @del usuario
    3. Botón de seguir
    ========================================================== */

@media (max-width: 767px) {

    .profile-header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-avatar {
        order: 1;
        margin-bottom: 1rem;
    }

    .profile-info {
        order: 2;
        display: flex;
        flex-direction: column; /* Usamos columna para aplicar order */
        align-items: center;
        width: 100%;
    }

    /* 1. Contenedor del Nombre, @ Móvil y Botón */
    .profile-name-action {
        order: 1; /* Primer elemento en la columna .profile-info */
        flex-direction: column; /* Apilar sus elementos internos */
        gap: 0;
        margin-bottom: 0;
        width: 100%;
    }

    /* Ocultar @usuario de escritorio */
    .profile-type-2 {
        display: none;
    }

    /* Mostrar @usuario móvil */
    .profile-type-1 {
        display: block;
        font-weight: 600;
        color: var(--muted);
        margin: 0.3rem 0 0.5rem 0; /* Espacio justo debajo del nombre */
        order: 2; /* Segundo elemento dentro de .profile-name-action */
    }

    /* Nombre (primer elemento dentro de .profile-name-action) */
    .profile-name {
        order: 1;
        margin-bottom: 0;
        justify-content: center;
    }

    /* Botón (tercer elemento dentro de .profile-name-action) */
    .profile-follow-action {
        order: 3;
        margin-top: 0.5rem;
    }

    /* 2. Estadísticas */
    .profile-stats {
        order: 2; /* Segundo elemento en la columna .profile-info */
        margin-top: 1rem;
    }

    /* 3. Descripción */
    .profile-summary {
        order: 3; /* Tercer elemento en la columna .profile-info */
        text-align: center;
        padding-top: 0.5rem;
        margin-top: 0.75rem;
    }
}