/* ================================
   ESTILOS PERFIL DE USUARIO
   ================================ */

body {
    background:
        linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
        url('../imagenes/fondoBuscadoroficial.webp') no-repeat center center fixed !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
}

/* ================================
   CONTENEDOR PRINCIPAL
   ================================ */
.contenedor-perfil {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

.tarjeta-perfil {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    padding: 0;
    border: 3px solid #000;
    animation: fadeInUp 0.6s ease-in-out;
    overflow: hidden;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   ENCABEZADO DEL PERFIL
   ================================ */
.encabezado-perfil {
    background: linear-gradient(135deg, #7a322e, #5a241f);
    color: white;
    text-align: center;
    padding: 40px 30px 30px;
    position: relative;
}

.avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.icono-avatar {
    font-size: 6rem;
    color: white;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.estado-perfil {
    position: absolute;
    bottom: 5px;
    right: -10px;
}

.badge-usuario {
    background: #fff;
    color: #7a322e;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-usuario.badge-admin {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.nombre-usuario {
    font-size: 2rem;
    font-weight: 600;
    margin: 10px 0 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: white;
}

.subtitulo-perfil {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
}

/* ================================
   MENSAJES DE ALERTA
   ================================ */
.mensaje-alerta {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    margin: 20px 30px;
    border-radius: 10px;
    font-size: 0.95rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mensaje-alerta i {
    font-size: 1.3rem;
}

.mensaje-alerta.success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.mensaje-alerta.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.mensaje-alerta.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* ================================
   TABS DE NAVEGACIÓN
   ================================ */
.tabs-navegacion {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 0 30px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 18px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(122, 50, 46, 0.05);
    color: #7a322e;
}

.tab-btn.active {
    color: #7a322e;
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #7a322e, #5a241f);
    border-radius: 3px 3px 0 0;
}

.tab-btn i {
    font-size: 1.1rem;
}

/* ================================
   CONTENIDO DE TABS
   ================================ */
.tabs-contenido {
    padding: 30px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ================================
   FORMULARIO
   ================================ */
.formulario-perfil {
    max-width: 100%;
}

.seccion-formulario {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f1f3f5;
}

.seccion-formulario:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.titulo-seccion {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.titulo-seccion i {
    color: #7a322e;
    font-size: 1.4rem;
}

.fila-campos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.grupo-formulario {
    display: flex;
    flex-direction: column;
}

.grupo-formulario label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grupo-formulario label i {
    color: #7a322e;
    font-size: 1rem;
}

.campo-entrada {
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.campo-entrada:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.campo-entrada:not(:disabled):hover {
    border-color: #adb5bd;
}

.campo-entrada:not(:disabled):focus {
    outline: none;
    border-color: #7a322e;
    box-shadow: 0 0 0 3px rgba(122, 50, 46, 0.1);
    background: white;
}

.campo-entrada.editando {
    border-color: #f39c12;
    background: #fffbf0;
}

.campo-entrada.editando:focus {
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.15);
}

.texto-ayuda {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
    display: block;
}

/* ================================
   CONTENEDOR DE PASSWORD
   ================================ */
.contenedor-password {
    position: relative;
    display: flex;
    align-items: center;
}

.contenedor-password .campo-entrada {
    flex: 1;
    padding-right: 45px;
}

.btn-mostrar-password {
    position: absolute;
    right: 5px;
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.btn-mostrar-password:hover {
    color: #7a322e;
    background: rgba(122, 50, 46, 0.1);
}

.btn-mostrar-password i {
    font-size: 1.1rem;
}

/* ================================
   ALERTA INFORMATIVA
   ================================ */
.alerta-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 4px solid #2196f3;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alerta-info i {
    color: #1976d2;
    font-size: 1.3rem;
    margin-top: 2px;
}

.alerta-info p {
    margin: 0;
    color: #0d47a1;
    font-size: 0.9rem;
    line-height: 1.5;
}

.separador-seguridad {
    height: 1px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
    margin: 25px 0;
}

/* ================================
   BOTONES DE ACCIÓN
   ================================ */
.botones-accion {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #f1f3f5;
}

.boton-primario,
.boton-secundario,
.boton-editar {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
}

.boton-primario {
    background: linear-gradient(135deg, #7a322e, #5a241f);
    color: white;
    box-shadow: 0 4px 12px rgba(122, 50, 46, 0.3);
}

.boton-primario:hover {
    background: linear-gradient(135deg, #5a241f, #3d1814);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(122, 50, 46, 0.4);
}

.boton-primario:active {
    transform: translateY(0);
}

.boton-secundario {
    background: white;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.boton-secundario:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.boton-editar {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.boton-editar:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.4);
}

/* ================================
   SECCIÓN VOLVER
   ================================ */
.seccion-volver {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
}

.boton-volver {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: #6c757d;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.boton-volver:hover {
    background: rgba(122, 50, 46, 0.1);
    color: #7a322e;
    text-decoration: none;
    transform: translateX(-3px);
}

.boton-volver i {
    font-size: 1rem;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    .contenedor-perfil {
        padding: 20px 10px;
    }

    .tarjeta-perfil {
        border-radius: 15px;
    }

    .encabezado-perfil {
        padding: 30px 20px 20px;
    }

    .icono-avatar {
        font-size: 4.5rem;
    }

    .nombre-usuario {
        font-size: 1.5rem;
    }

    .tabs-contenido {
        padding: 20px 15px;
    }

    .tabs-navegacion {
        padding: 0 15px;
    }

    .tab-btn {
        padding: 15px 10px;
        font-size: 0.85rem;
    }

    .tab-btn i {
        font-size: 1rem;
    }

    .fila-campos {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .titulo-seccion {
        font-size: 1.1rem;
    }

    .botones-accion {
        flex-direction: column-reverse;
    }

    .boton-primario,
    .boton-secundario,
    .boton-editar {
        width: 100%;
        justify-content: center;
    }

    .seccion-volver {
        padding: 15px 20px;
    }

    .mensaje-alerta {
        margin: 15px 15px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .icono-avatar {
        font-size: 3.5rem;
    }

    .nombre-usuario {
        font-size: 1.3rem;
    }

    .tab-btn span {
        display: none;
    }

    .campo-entrada {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* ================================
   ANIMACIONES ADICIONALES
   ================================ */
.campo-entrada:not(:disabled) {
    animation: none;
}

.campo-entrada.editando {
    animation: glow 1.5s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(243, 156, 18, 0.2);
    }

    50% {
        box-shadow: 0 0 15px rgba(243, 156, 18, 0.4);
    }
}

/* ================================
   ACCESIBILIDAD
   ================================ */
.campo-entrada:focus-visible,
.boton-primario:focus-visible,
.boton-secundario:focus-visible,
.boton-editar:focus-visible,
.tab-btn:focus-visible {
    outline: 3px solid #7a322e;
    outline-offset: 2px;
}

/* ================================
   IMPRESIÓN
   ================================ */
@media print {
    body {
        background: white !important;
    }

    .tarjeta-perfil {
        box-shadow: none;
        border: 1px solid #000;
    }

    .botones-accion,
    .seccion-volver,
    .tabs-navegacion {
        display: none !important;
    }

    .tab-panel {
        display: block !important;
    }
}