/**
 * ArkkoTicket: Estilos y animaciones personalizadas
 * - Bloque informativo con animaciones
 * - Validador de entradas
 */

/* ===== ANIMACIONES GLOBALES ===== */

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

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes avatarPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes slideFromLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideFromRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== BLOQUE INFORMATIVO MEJORADO ===== */

.arkko-info-block-enhanced {
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

/* Fondo degradado dinámico */
.arkko-info-bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 50%, #f5f7fa 100%);
    animation: slideInDown 1.2s ease-out;
    z-index: 1;
}

.arkko-info-container {
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.arkko-info-title-enhanced {
    animation: slideInDown 0.7s ease-out;
    background: linear-gradient(135deg, var(--akt-text) 0%, var(--akt-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Grid de características */
.arkko-features-grid {
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.arkko-feature-item {
    animation: scaleIn 0.6s ease-out;
}

.arkko-feature-item:nth-child(1) {
    animation-delay: 0.6s;
}

.arkko-feature-item:nth-child(2) {
    animation-delay: 0.8s;
}

.arkko-feature-item:nth-child(3) {
    animation-delay: 1s;
}

.arkko-feature-card {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.arkko-feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--wp--preset--color--primary), var(--wp--preset--color--primary-light));
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.arkko-feature-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.arkko-feature-card:hover::before {
    opacity: 1;
}

.arkko-feature-card h1 {
    animation: fadeInUp 0.4s ease-out;
    transition: transform 0.3s ease;
}

.arkko-feature-card:hover h1 {
    transform: scale(1.2) rotate(5deg);
}

.arkko-feature-card h3 {
    animation: fadeInUp 0.5s ease-out 0.1s backwards;
}

.arkko-feature-card p {
    animation: fadeInUp 0.5s ease-out 0.2s backwards;
}

/* Tarjetas de contacto */
.arkko-contact-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out;
    background: white;
}

.arkko-contact-card:hover {
    transform: translateY(-6px);
    border-color: var(--wp--preset--color--primary-light) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.arkko-contact-card a {
    color: inherit;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

.arkko-contact-card a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--wp--preset--color--primary);
    transition: width 0.3s ease;
}

.arkko-contact-card a:hover::after {
    width: 100%;
}

.arkko-contact-item:nth-child(1) {
    animation-delay: 1.2s;
}

.arkko-contact-item:nth-child(2) {
    animation-delay: 1.4s;
}

/* ===== TARJETAS PERSPECTIVA 3D (LIBRO ABIERTO) ===== */

.arkko-features-3d {
    perspective: 1200px;
}

.arkko-feature-card-modern {
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transform-style: preserve-3d;
}

/* Rotación 3D inicial */
.arkko-feature-item:nth-child(1) .arkko-feature-card-modern {
    transform: rotateZ(-15deg) rotateY(-8deg);
}

.arkko-feature-item:nth-child(2) .arkko-feature-card-modern {
    transform: rotateZ(0deg) scale(1.05);
}

.arkko-feature-item:nth-child(3) .arkko-feature-card-modern {
    transform: rotateZ(15deg) rotateY(8deg);
}

/* Efecto de fondo animado en hover */
.arkko-feature-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: right 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

/* Iconos de características animados */
.arkko-feature-icon {
    animation: avatarPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.3s ease;
    margin: 0 !important;
}

.arkko-feature-icon img {
    display: block;
    margin: 0 auto;
}

/* Avatar animado (legacy) */
.arkko-avatar {
    animation: avatarPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.arkko-feature-item:nth-child(1) .arkko-avatar {
    animation-delay: 0.2s;
}

.arkko-feature-item:nth-child(2) .arkko-avatar {
    animation-delay: 0.4s;
}

.arkko-feature-item:nth-child(3) .arkko-avatar {
    animation-delay: 0.6s;
}

.arkko-feature-card-modern:hover .arkko-avatar {
    transform: scale(1.15) rotate(12deg);
    animation: float 2s ease-in-out infinite;
}

.arkko-feature-card-modern:hover .arkko-feature-icon {
    transform: scale(1.2) rotate(8deg);
    animation: float 2s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
}

/* Transiciones suaves para efectos de scroll */
.arkko-feature-item {
    transition: transform 0.3s ease-out;
}

/* Entrada dinámica de tarjetas con perspectiva 3D */
@keyframes rotateInLeft3D {
    from {
        opacity: 0;
        transform: rotateZ(-15deg) rotateY(-25deg) translateX(-40px);
    }
    to {
        opacity: 1;
        transform: rotateZ(-15deg) rotateY(-8deg) translateX(0);
    }
}

@keyframes rotateInCenter3D {
    from {
        opacity: 0;
        transform: rotateZ(0deg) scale(0.9) translateY(30px);
    }
    to {
        opacity: 1;
        transform: rotateZ(0deg) scale(1.05) translateY(0);
    }
}

@keyframes rotateInRight3D {
    from {
        opacity: 0;
        transform: rotateZ(15deg) rotateY(25deg) translateX(40px);
    }
    to {
        opacity: 1;
        transform: rotateZ(15deg) rotateY(8deg) translateX(0);
    }
}

.arkko-feature-item:nth-child(1) {
    animation: rotateInLeft3D 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}

.arkko-feature-item:nth-child(2) {
    animation: rotateInCenter3D 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

.arkko-feature-item:nth-child(3) {
    animation: rotateInRight3D 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

/* Hover de tarjeta 3D */
.arkko-feature-item:nth-child(1) .arkko-feature-card-modern:hover {
    transform: rotateZ(-8deg) rotateY(-5deg) translateY(-8px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.arkko-feature-item:nth-child(2) .arkko-feature-card-modern:hover {
    transform: rotateZ(0deg) scale(1.08) translateY(-12px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
}

.arkko-feature-item:nth-child(3) .arkko-feature-card-modern:hover {
    transform: rotateZ(8deg) rotateY(5deg) translateY(-8px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

/* Animación de elementos internos */
.arkko-feature-card-modern h3 {
    animation: fadeInUp 0.5s ease-out 0.3s backwards;
    transition: color 0.3s ease;
}

.arkko-feature-card-modern:hover h3 {
    color: var(--wp--preset--color--primary);
}

.arkko-feature-card-modern > p:nth-of-type(1) {
    animation: fadeInUp 0.5s ease-out 0.4s backwards;
}

.arkko-feature-card-modern > p:nth-of-type(2) {
    animation: fadeInUp 0.5s ease-out 0.5s backwards;
    transition: color 0.3s ease;
}

.arkko-feature-card-modern:hover > p:nth-of-type(2) {
    color: var(--wp--preset--color--ink);
}

/* Línea decorativa en hover */
.arkko-feature-card-modern::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--wp--preset--color--primary), var(--wp--preset--color--primary-light));
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.arkko-feature-card-modern:hover::after {
    width: 100%;
}

/* ===== BLOQUES CTA DE CONTACTO COMPACTOS ===== */

.arkko-cta-header {
    animation: fadeInUp 0.7s ease-out 0.6s backwards;
    text-align: center;
    transition: all 0.35s ease;
}

.arkko-cta-header p {
    transition: color 0.35s ease, opacity 0.35s ease;
}

.arkko-contact-cta-grid {
    animation: fadeInUp 0.7s ease-out 0.8s backwards;
    transition: all 0.35s ease;
}

.arkko-contact-cta-item {
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.arkko-contact-cta-item:nth-child(1) {
    animation-delay: 0.9s;
}

.arkko-contact-cta-item:nth-child(2) {
    animation-delay: 1.1s;
}

.arkko-contact-cta-card {
    position: relative;
    overflow: hidden;
}

/* Hover desactivado en las tarjetas de contacto.
   Se elimina todo movimiento (transform/scale/float/spin y el cambio de
   letter-spacing que desplazaba el texto) que provocaba el "brinco".
   Las tarjetas permanecen estáticas al pasar el puntero. */
.arkko-contact-cta-card a {
    text-decoration: none;
}

/* ===== PÁGINA DE VALIDACIÓN ===== */

.arkko-validar-page {
    animation: fadeInUp 0.8s ease-out;
}

.arkko-validar-page h1 {
    animation: slideInDown 0.6s ease-out;
}

.arkko-validation-option {
    animation: fadeInUp 0.6s ease-out;
}

.arkko-validation-option:nth-child(1) {
    animation-delay: 0.2s;
}

.arkko-validation-option:nth-child(2) {
    animation-delay: 0.4s;
}

.arkko-validation-option:nth-child(3) {
    animation-delay: 0.6s;
}

.arkko-validation-option .wp-block-group {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    background: white;
}

.arkko-validation-option .wp-block-group:hover {
    transform: translateY(-10px);
    border-color: var(--wp--preset--color--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.arkko-validation-option h3 {
    animation: fadeInUp 0.4s ease-out;
}

.arkko-validation-option p {
    animation: fadeInUp 0.5s ease-out 0.1s backwards;
}

.arkko-validation-option .wp-block-buttons {
    animation: fadeInUp 0.5s ease-out 0.2s backwards;
}

.arkko-validation-option .wp-block-button__link {
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.arkko-validation-option .wp-block-button__link:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.arkko-validation-option .wp-block-button__link:active {
    transform: scale(0.98);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .arkko-info-block-enhanced {
        padding-top: 80px !important;
        padding-bottom: 80px !important;
    }

    .arkko-info-title-enhanced {
        font-size: 2rem !important;
    }

    .arkko-features-grid .wp-block-columns {
        display: flex;
        flex-wrap: wrap;
    }

    .arkko-feature-item {
        min-width: 100%;
        margin-bottom: 1.5rem;
    }

    .arkko-feature-item:nth-child(1) {
        animation: rotateInLeft3D 0.6s ease-out !important;
        animation-delay: 0.1s !important;
    }

    .arkko-feature-item:nth-child(2) {
        animation: rotateInCenter3D 0.6s ease-out 0.2s backwards !important;
    }

    .arkko-feature-item:nth-child(3) {
        animation: rotateInRight3D 0.6s ease-out 0.3s backwards !important;
    }

    /* Eliminar perspectiva en mobile */
    .arkko-feature-item:nth-child(1) .arkko-feature-card-modern {
        transform: rotateZ(-5deg);
    }

    .arkko-feature-item:nth-child(2) .arkko-feature-card-modern {
        transform: rotateZ(0deg) scale(1);
    }

    .arkko-feature-item:nth-child(3) .arkko-feature-card-modern {
        transform: rotateZ(5deg);
    }

    .arkko-feature-card-modern {
        padding-top: 25px !important;
        padding-bottom: 25px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .arkko-avatar {
        width: 50px !important;
        height: 50px !important;
        margin-bottom: 1rem !important;
    }

    .arkko-contact-cta-card {
        padding-top: 25px !important;
        padding-bottom: 25px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .arkko-contact-cta-card h1 {
        font-size: 2.2rem !important;
    }

    .arkko-contact-cta-card h3 {
        font-size: 1.1rem !important;
    }

    .arkko-validation-option {
        margin-bottom: 1rem;
    }

    .arkko-validation-option .wp-block-group {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }

    .arkko-validation-option h3 {
        font-size: 1.25rem !important;
    }
}

@media (max-width: 480px) {
    .arkko-info-block-enhanced {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }

    .arkko-info-title-enhanced {
        font-size: 1.75rem !important;
    }

    .arkko-feature-card {
        padding-top: 30px !important;
        padding-bottom: 30px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .arkko-feature-card h1 {
        font-size: 2.5rem !important;
    }

    .arkko-feature-card h3 {
        font-size: 1.25rem !important;
    }

    .arkko-contact-card {
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }

    .arkko-validation-option .wp-block-group {
        padding: 15px !important;
    }

    .arkko-validation-option h3 {
        font-size: 1.1rem !important;
    }

    .arkko-validation-option p {
        font-size: 0.9rem !important;
    }
}

/* ===== BLOQUES CTA CON IMAGEN DE FONDO ===== */

.arkko-contact-phone,
.arkko-contact-email {
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

.arkko-contact-phone::before,
.arkko-contact-email::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    z-index: 3;
    transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.arkko-contact-phone:hover::before,
.arkko-contact-email:hover::before {
    left: 100%;
}

.arkko-contact-phone:hover,
.arkko-contact-email:hover {
    transform: scale(1.05);
}

.arkko-contact-phone:hover img,
.arkko-contact-email:hover img {
    transform: scale(1.1) !important;
}

/* Animaciones de entrada específicas para CTA */
.arkko-contact-phone {
    animation: slideFromLeft 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1s backwards;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, filter 0.35s ease;
}

.arkko-contact-email {
    animation: slideFromRight 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1s backwards;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, filter 0.35s ease;
}
