/* ===== CUSTOM PROPERTY PARA ANIMACIÓN ===== */
@property --rotate {
    syntax: "<angle>";
    initial-value: 132deg;
    inherits: false;
}

/* ===== VARIABLES GLOBALES (CUSTOM PROPERTIES) ===== */
:root {
    /* Dimensiones y espaciado de la tarjeta */
    --card-height: 65vh;
    --card-width: calc(var(--card-height) / 1.5);
    --card-padding: 40px 30px;
    /* Tipografía */
    --profile-pic-size: 100px;
    --h1-font-size: 1.8rem;
    --h3-font-size: 1.1rem;
}

/* ===== ESTILOS BASE Y LAYOUT ===== */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #2d313e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #f0f8ff;
}

.card-container {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===== ESTILOS DEL COMPONENTE CARD ===== */
.card {
    background: #191c29;
    width: var(--card-width);
    min-height: var(--card-height);
    padding: var(--card-padding);
    position: relative;
    border-radius: 6px;
    justify-content: center;
    align-items: center;
    text-align: center;
    display: flex;
    flex-direction: column;
    font-size: 1.5em;
    color: rgb(88 199 250 / 0%);
    cursor: pointer;
}

/* --- Contenido de la tarjeta (Títulos) --- */
.card h1 {
    font-size: var(--h1-font-size);
    margin: 0 8px 0 0;
    line-height: 1.2;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease-in-out;
    transition-delay: 0.2s;
    display: inline-block;
}

.card h3 {
    font-size: var(--h3-font-size);
    margin: 0 0 25px 0;
    line-height: 1.3;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease-in-out;
    transition-delay: 0.4s;
    display: inline-block;
    font-weight: 400;
}

/* --- Efecto de borde animado --- */
.card::before {
    content: "";
    width: 104%;
    height: 102%;
    border-radius: 8px;
    background-image: linear-gradient(
        var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2
    );
    position: absolute;
    z-index: -1;
    top: -1%;
    left: -2%;
    animation: spin 2.5s linear infinite;
}

.card::after {
    position: absolute;
    content: "";
    top: calc(var(--card-height) / 6);
    left: 0;
    right: 0;
    z-index: -1;
    height: 100%;
    width: 100%;
    margin: 0 auto;
    transform: scale(0.8);
    filter: blur(calc(var(--card-height) / 6));
    background-image: linear-gradient(
        var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2
    );
    opacity: 1;
    transition: opacity .5s;
    animation: spin 2.5s linear infinite;
}

/* --- Animación del borde --- */
@keyframes spin {
    0% {
        --rotate: 0deg;
    }
    100% {
        --rotate: 360deg;
    }
}

/* --- Contenido de la tarjeta (Enlaces Sociales) --- */
.social-links {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease-in-out;
    transition-delay: 0.6s;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #333;
    padding: 15px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.social-icon svg {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

.social-icon:hover {
    background-color: #555;
}

/* --- Contenido de la tarjeta (Imagen de Perfil) --- */
.profile-pic {
    width: var(--profile-pic-size);
    height: var(--profile-pic-size);
    border-radius: 50%;
    object-fit: cover;
    margin: 0 0 25px 0;
    z-index: 1;
    transition: all 0.5s ease-in-out;
    transition-delay: 0s;
    border: 3px solid #5ddcff;
    opacity: 0;
    visibility: hidden;
}

/* ===== MEDIA QUERIES PARA RESPONSIVE DESIGN ===== */

/* Tablets y pantallas medianas (hasta 1024px) */
@media screen and (max-width: 1024px) {
    :root {
        --card-height: 70vh;
        --card-padding: 35px 25px;
        --profile-pic-size: 90px;
        --h1-font-size: 1.6rem;
        --h3-font-size: 1rem;
    }
    
    body {
        padding: 15px;
    }
    
    .card-container {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .social-links {
        margin-top: 25px;
        gap: 10px;
    }
    
    .social-icon {
        padding: 12px;
        font-size: 0.9rem;
    }
}

/* Móviles grandes (481px - 767px) */
@media screen and (max-width: 767px) {
    :root {
        --card-padding: 30px 20px;
        --profile-pic-size: 80px;
        --h1-font-size: 1.5rem;
        --h3-font-size: 1rem;
    }
    
    body {
        padding: 20px;
    }
    
    .card-container {
        width: 90vw;
    }
    
    .card h1,
    .card h3 {
        display: block;
        margin: 0 0 15px 0;
    }
    
    .social-links {
        margin-top: 20px;
        gap: 8px;
    }
    
    .social-icon {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .social-icon svg {
        width: 14px;
        height: 14px;
    }
}

/* Móviles pequeños (320px - 480px) */
@media screen and (max-width: 480px) {
    :root {
        --card-padding: 25px 15px;
        --profile-pic-size: 70px;
        --h1-font-size: 1.4rem;
        --h3-font-size: 0.9rem;
    }
    
    body {
        padding: 25px 15px;
    }
    
    .card-container {
        width: 90vw;
    }
    
    .social-links {
        margin-top: 15px;
        gap: 6px;
    }
    
    .social-icon {
        padding: 8px;
        font-size: 0.85rem;
    }
    
    .social-icon svg {
        width: 12px;
        height: 12px;
        margin-right: 8px;
    }
}

/* Pantallas muy pequeñas (menos de 320px) */
@media screen and (max-width: 319px) {
    :root {
        --card-padding: 20px 10px;
        --profile-pic-size: 60px;
        --h1-font-size: 1.2rem;
        --h3-font-size: 0.85rem;
    }
    
    body {
        padding: 20px 10px;
    }
    
    .card-container {
        width: 95vw;
    }
    
    .social-icon {
        padding: 6px;
        font-size: 0.8rem;
    }
}

/* ===== MEDIA QUERIES ESPECÍFICAS ===== */
/* Orientación landscape en móviles */
@media screen and (max-height: 500px) and (orientation: landscape) {
    :root {
        --card-height: 90vh;
        --card-padding: 20px 15px;
        --profile-pic-size: 60px;
    }
    
    .card h1,
    .card h3 {
        margin: 0 0 10px 0;
    }
    
    .social-links {
        margin-top: 15px;
        gap: 6px;
    }
}

/* Pantallas de alta resolución (Retina, 4K) */
@media screen and (min-resolution: 2dppx) {
    .profile-pic {
        border-width: 2px;
    }
    
    .social-icon {
        border-radius: 6px;
    }
}

/* ===== LÓGICA DE INTERACCIÓN POR DISPOSITIVO ===== */

/* Para dispositivos con cursor (mouse) */
@media (hover: hover) {
    .card:hover {
        color: rgb(88 199 250 / 100%);
        transition: color 1s;
    }

    .card:hover:before, .card:hover:after {
        animation: none;
        opacity: 0;
    }

    .card:hover :is(.profile-pic, h1, h3, .social-links) {
        opacity: 1;
        visibility: visible;
    }

    .card:hover .profile-pic {
        transform: scale(1.1);
    }
}

/* Dispositivos sin hover (móviles/tablets táctiles): mostrar contenido siempre */
@media (hover: none) {
    .card {
        color: rgb(88 199 250 / 100%);
    }
    .profile-pic,
    .card h1,
    .card h3,
    .social-links {
        opacity: 1;
        visibility: visible;
    }
}

/* ===== ACCESIBILIDAD ===== */
/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    .card,
    .profile-pic,
    .card h1,
    .card h3,
    .social-links { transition: none; }
    .card::before,
    .card::after { animation: none; }
}
