/* ==================== */
/* VARIABLES GLOBALES */
/* ==================== */
:root {
    /* Colores principales */
    --color-primario: #4e73df;
    --color-secundario: #224abe;
    --color-activo: #1cc88a;
    --color-inactivo: #e74a3b;
    --color-texto: #5a5c69;
    --color-fondo: #f8f9fc;
    
    /* Efectos visuales */
    --sombra: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    --degradado: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ==================== */
/* FONDO ANIMADO */
/* ==================== */
.container__background-triangle {
    max-width: 1200px;
    height: 600px;
    margin: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.triangle {
    width: 300px;
    height: 300px;
    position: absolute;
}

/* Triángulo 1 - Gradiente azul */
.triangle1 {
    width: 250px;
    height: 250px;
    background: linear-gradient(to left, #062b50, #1e67c7);
    right: 100px;
    top: 100px;
    animation: t1 8s ease infinite;
}

/* Triángulo 2 - Gradiente azul a blanco */
.triangle2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(to left, #1e67c7, #fff);
    top: 350px;
    animation: t2 9s ease infinite;
}

/* Triángulo 3 - Gradiente azul a rosa */
.triangle3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(to left, #1b8fc5, #df0f8f);
    left: 200px;
    animation: t3 7s ease infinite;
}

/* Animaciones para los triángulos */
@keyframes t1 {
    0%, 100% { transform: rotate(45deg) translateY(0px); }
    50% { transform: rotate(45deg) translateY(20px); }
}

@keyframes t2 {
    0%, 100% { transform: rotate(65deg) translateY(0px); }
    50% { transform: rotate(65deg) translateY(20px); }
}

@keyframes t3 {
    0%, 100% { transform: rotate(45deg) translateY(0px); }
    50% { transform: rotate(45deg) translateY(20px); }
}

/* ==================== */
/* CONTENEDOR PRINCIPAL */
/* ==================== */
.tarjeta-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%; /* Asegura que ocupe todo el ancho */
    margin: 0 auto; /* Centra el contenedor */
}

/* ==================== */
/* TARJETA DE ASOCIADO */
/* ==================== */
.tarjeta {
    width: 380px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fadeIn 0.6s ease-out;
}

.tarjeta:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px; /* O ajusta según necesites */
    margin: 0 auto;
}

/* Asegúrate que la tarjeta y los botones estén bien alineados */
.d-flex.flex-column.flex-md-row.align-items-start {
    justify-content: center;
    width: 100%;
}

/* ==================== */
/* ENCABEZADO DE TARJETA - DISEÑO MEJORADO */
/* ==================== */
.encabezado {
    background: var(--degradado);
    color: white;
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

/* Efecto de luz animado */
.encabezado::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shine 6s infinite;
    opacity: 0.5;
    z-index: -1;
}

/* Patrón de puntos sutiles */
.encabezado::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(
        circle at 10px 10px,
        rgba(255, 255, 255, 0.1) 1px,
        transparent 2px
    );
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: -1;
}

/* Animación del efecto de luz */
@keyframes shine {
    0% { transform: rotate(30deg) translate(-30%, -30%); }
    50% { transform: rotate(30deg) translate(70%, 70%); }
    100% { transform: rotate(30deg) translate(-30%, -30%); }
}

/* Nombre del asociado */
.nombre {
    font-size: 24px;
    font-weight: 700;
    margin: 10px 0 5px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* Estado del asociado */
.estado-tarjeta {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-top: 10px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

/* Contenedor de foto de perfil */
.contenedor-foto {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.5);
    margin: 0 auto 15px;
    overflow: hidden;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    background: white;
    padding: 3px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 100%);
}

/* Foto de perfil */
.foto-perfil {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Efecto hover para elementos interactivos */
.contenedor-foto:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 0 30px rgba(255, 255, 255, 0.4);
}

.estado-tarjeta:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.25),
        inset 0 2px 2px rgba(255, 255, 255, 0.4);
}

.nombre:hover {
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* Efecto de partículas flotantes (opcional) */
.particulas {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.particula {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float linear infinite;
    pointer-events: none;
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) translateX(20px); opacity: 0; }
}

/* Versión responsive */
@media (max-width: 768px) {
    .encabezado {
        padding: 1.5rem;
    }
    
    .contenedor-foto {
        width: 100px;
        height: 100px;
    }
    
    .nombre {
        font-size: 20px;
    }
    
    .estado-tarjeta {
        padding: 5px 15px;
        font-size: 11px;
    }
}
/* Agrega esto a tarjeta_asociado.css */
.logo-fondo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    z-index: 0;
    opacity: 0.8;
    pointer-events: none;
}

.logo-fondo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cuerpo {
    position: relative;
}

.info-item {
    position: relative;
    z-index: 1;
}

/* ==================== */
/* CUERPO DE LA TARJETA */
/* ==================== */
.cuerpo {
    padding-top: 25px;
    padding-right: 25px;
    padding-bottom: 10px;
    padding-left: 25px;
    background: rgba(255, 255, 255, 0.7);
}

/* Elementos de información */
.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.info-item:hover {
    transform: translateX(5px);
}

/* Iconos de información */
.info-item i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(110, 142, 251, 0.1);
    color: var(--color-primario);
    border-radius: 50%;
    margin-right: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.info-item:hover i {
    background: var(--degradado);
    color: white;
    transform: scale(1.1);
}

/* Texto de información */
.info-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 3px;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-texto);
}

/* ==================== */
/* SECCIÓN QR */
/* ==================== */
.qr-container {
    text-align: center;
    padding: 20px;
    background: rgba(249, 249, 249, 0.7);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Línea decorativa sobre el QR */
.qr-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
}

.qr-code {
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
    border: 5px solid white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.qr-code:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.qr-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 10px;
}

/* ==================== */
/* PIE DE TARJETA */
/* ==================== */
.pie-tarjeta {
    background: var(--degradado);
    color: white;
    padding: 12px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ==================== */
/* BOTONES DE ACCIÓN */
/* ==================== */
.acciones-tarjeta {
    display: flex;
    flex-direction: column;
    width: 200px;
    margin-left: 1rem;
}

/* Botón Descargar */
.btn-descargar {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--degradado);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.btn-descargar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-descargar i {
    margin-right: 0.8rem;
}

/* Botón Volver */
.btn-volver {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--color-primario);
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: var(--color-primario);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

.btn-volver:hover {
    background: var(--color-primario);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* ==================== */
/* DISEÑO RESPONSIVE */
/* ==================== */

/* Pantallas pequeñas (móviles) */
@media (max-width: 768px) {
    .tarjeta-container {
        padding: 1rem;
        min-height: auto;
    }
    
    .container {
        padding: 0;
    }
    
    .tarjeta {
        width: 100%;
        max-width: 100%;
        box-shadow: none;
    }
    
    .encabezado {
        padding: 1.5rem;
    }
    
    .contenedor-foto {
        width: 100px;
        height: 100px;
    }
    
    .nombre {
        font-size: 20px;
    }
    
    .cuerpo {
        padding: 1.5rem;
    }
    
    .info-item {
        align-items: flex-start;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }
    
    .info-item i {
        margin-bottom: 8px;
        margin-right: 0;
    }
    
    .qr-container {
        padding: 1rem;
    }
    
    .qr-code {
        width: 100px;
        height: 100px;
    }
    
    /* Ajustes para botones en móviles */
    .acciones-tarjeta {
        width: 100%;
        margin-left: 0;
        margin-top: 1rem;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .btn-descargar, .btn-volver {
        width: 48%;
        padding: 0.7rem;
        font-size: 14px;
    }
    
    h1.text-primary {
        font-size: 1.5rem;
        text-align: center;
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Pantallas medianas (tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
    .tarjeta {
        width: 90%;
        max-width: 500px;
    }
    
    .contenedor-foto {
        width: 110px;
        height: 110px;
    }
    
    .nombre {
        font-size: 22px;
    }
    
    .acciones-tarjeta {
        width: 180px;
    }
}

/* ==================== */
/* ANIMACIONES */
/* ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== */
/* ESTILOS ESPECÍFICOS PARA EL LOGO DE FONDO */
/* ==================== */
.logo-fondo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    z-index: 0;
    opacity: 0.8;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-fondo img {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0;
    transform: none !important;
}

/* ==================== */
/* MODO DESCARGA - Para mejorar la calidad de la imagen */
/* ==================== */
body.modo-descarga .container__background-triangle,
.modo-descarga .container__background-triangle {
    display: none !important;
}

.modo-descarga {
    animation: none !important;
    transition: none !important;
    transform: none !important;
}

.modo-descarga.tarjeta {
    transform: none !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

.modo-descarga .encabezado::before,
.modo-descarga .encabezado::after {
    display: none !important;
}

.modo-descarga .contenedor-foto:hover,
.modo-descarga .estado-tarjeta:hover,
.modo-descarga .nombre:hover,
.modo-descarga .info-item:hover,
.modo-descarga .qr-code:hover {
    transform: none !important;
}

.modo-descarga .info-item i,
.modo-descarga .qr-code {
    transition: none !important;
}

/* Mejorar visibilidad para impresión */
.modo-descarga .encabezado {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.modo-descarga .pie-tarjeta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.modo-descarga .estado-activo {
    background-color: #1cc88a !important;
}

.modo-descarga .estado-inactivo {
    background-color: #e74a3b !important;
}

/* Estilos específicos para el logo en modo descarga */
.modo-descarga .logo-fondo {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.modo-descarga .logo-fondo img {
    width: 60% !important;
    height: auto !important;
    max-width: 60% !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    transform: none !important;
}
/* ==================== */
/* ESTILOS PARA EL BOTÓN DE DESCARGA */
/* ==================== */
.btn-descargar {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--degradado);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.btn-descargar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-descargar:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-descargar.btn-generando {
    background: #6c757d;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

.btn-descargar.btn-generando:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

.btn-descargar i {
    margin-right: 0.8rem;
}
