/**
 * Plane 2.1 - Estilos específicos para animaciones GSAP
 * Complementa los estilos base del editor con clases y efectos animados
 */

/* Estilos generales para animaciones */
.gsap-no-animations * {
    transition: none !important;
    animation: none !important;
}

/* Transiciones personalizadas para botones */
.plane-btn-transition-smooth {
    transition: all 0.3s ease !important;
}

.plane-btn-transition-bounce:hover {
    transform: translateY(-6px) !important;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55) !important;
}

.plane-btn-transition-pulse:hover {
    animation: plane-pulse-animation 1s infinite !important;
}

@keyframes plane-pulse-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.plane-btn-transition-scale:hover {
    transform: scale(1.1) !important;
    transition: all 0.3s ease !important;
}

.plane-btn-transition-rotate:hover {
    transform: rotate(5deg) !important;
    transition: all 0.3s ease !important;
}

.plane-btn-transition-sweep {
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

.plane-btn-transition-sweep:after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%) !important;
    transition: all 0.5s ease !important;
    z-index: -1 !important;
}

.plane-btn-transition-sweep:hover:after {
    left: 100% !important;
}

.plane-btn-transition-shadow:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important;
    transition: all 0.3s ease !important;
}

.plane-btn-transition-glow:hover {
    box-shadow: 0 0 10px var(--accent-6-intense), 0 0 20px var(--accent-6-intense) !important;
    transition: all 0.3s ease !important;
}

.plane-btn-transition-slide {
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.plane-btn-transition-slide:hover {
    padding-right: 20px !important;
    padding-left: 4px !important;
}

.plane-btn-transition-flip {
    perspective: 1000px !important;
    transition: all 0.3s ease !important;
}

.plane-btn-transition-flip:hover {
    transform: rotateX(10deg) rotateY(10deg) !important;
}

/* Efectos de partículas */
.plane-particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 9999;
}

.plane-particle {
    position: absolute;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    z-index: 1000;
}

/* Efecto Ripple */
.plane-ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    pointer-events: none;
    opacity: 0.6;
}

/* Estilos para sílabas tónicas animadas */
.tonic-syllable {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    position: relative;
    display: inline-block;
}

/* Estilos para palabras que riman */
.rhyme-word {
    position: relative;
    display: inline-block;
    transition: color 0.3s, background-color 0.3s, transform 0.3s;
}

.rhyme-word.highlighted {
    transform: scale(1.05);
}

/* Grupos de rima destacados */
.rhyme-group-highlight-1 { color: var(--accent-1-intense); }
.rhyme-group-highlight-2 { color: var(--accent-2-intense); }
.rhyme-group-highlight-3 { color: var(--accent-3-intense); }
.rhyme-group-highlight-4 { color: var(--accent-4-intense); }
.rhyme-group-highlight-5 { color: var(--accent-5-intense); }
.rhyme-group-highlight-6 { color: var(--accent-6-intense); }
.rhyme-group-highlight-7 { color: var(--accent-7-intense); }
.rhyme-group-highlight-8 { color: var(--accent-8-intense); }

.rhyme-group-bg-1 { background-color: var(--accent-1); }
.rhyme-group-bg-2 { background-color: var(--accent-2); }
.rhyme-group-bg-3 { background-color: var(--accent-3); }
.rhyme-group-bg-4 { background-color: var(--accent-4); }
.rhyme-group-bg-5 { background-color: var(--accent-5); }
.rhyme-group-bg-6 { background-color: var(--accent-6); }
.rhyme-group-bg-7 { background-color: var(--accent-7); }
.rhyme-group-bg-8 { background-color: var(--accent-8); }

/* Efectos para conexión visual de rimas */
.rhyme-connection {
    position: absolute;
    background: transparent;
    border-top: 2px dashed var(--accent-5-intense);
    height: 0;
    transform-origin: 0 0;
    z-index: 5;
    opacity: 0.7;
    pointer-events: none;
}

/* Efectos de destello/highlight */
.text-highlight {
    position: relative;
}

.text-highlight::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--highlight-5);
    border-radius: 3px;
    z-index: -1;
    transform: scale(0);
    transform-origin: center;
}

.text-highlight.active::after {
    animation: highlight-pulse 1.5s ease;
}

@keyframes highlight-pulse {
    0% { transform: scale(0); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 0.5; }
    100% { transform: scale(1); opacity: 0; }
}

/* Estilos para el efecto de typing */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: currentColor;
    margin-left: 2px;
    animation: typing-cursor 0.8s infinite;
    vertical-align: text-bottom;
}

@keyframes typing-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Efectos para modales */
.plane-modal {
    opacity: 0;
    display: none;
    transition: opacity 0.3s ease-in-out;
}

.plane-modal.active {
    opacity: 1;
    display: flex;
}

.plane-modal-content {
    transform: translateY(0);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* Esqueletos de carga (placeholders) */
.plane-skeleton-item {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.plane-skeleton-title {
    height: 22px;
    width: 70%;
    margin-bottom: 15px;
}

.plane-skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.plane-skeleton-text:last-child {
    width: 80%;
}

/* Transiciones para Scroll Trigger */
.gsap-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gsap-fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

.gsap-fade-left {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gsap-fade-left.active {
    opacity: 1;
    transform: translateX(0);
}

.gsap-fade-right {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gsap-fade-right.active {
    opacity: 1;
    transform: translateX(0);
}

.gsap-scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gsap-scale-in.active {
    opacity: 1;
    transform: scale(1);
}

/* Animaciones para notificaciones */
.plane-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 15px 20px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transform: translateX(120%);
}

.plane-notification.success {
    border-left: 4px solid var(--accent-2-intense);
}

.plane-notification.error {
    border-left: 4px solid var(--accent-1-intense);
}

.plane-notification.info {
    border-left: 4px solid var(--accent-5-intense);
}

.plane-notification.warning {
    border-left: 4px solid var(--accent-3-intense);
}

/* Efecto de rotación 3D para tarjetas */
.plane-card-flip {
    perspective: 1000px;
}

.plane-card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.plane-card-flip.flipped .plane-card-flip-inner {
    transform: rotateY(180deg);
}

.plane-card-front, .plane-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.plane-card-back {
    transform: rotateY(180deg);
}

/* Animación para estadísticas */
.plane-stats-counter {
    display: inline-block;
    position: relative;
    transition: transform 0.3s ease, color 0.3s ease;
}

.plane-stats-counter.updating {
    transform: scale(1.2);
    color: var(--accent-5-intense);
}

/* Estilos para efectos de rima con destello */
.rhyme-flash-effect {
    position: absolute;
    border-radius: 4px;
    pointer-events: none;
    z-index: 9999;
    background-color: var(--accent-6-intense);
    box-shadow: 0 0 20px var(--accent-6-intense);
    mix-blend-mode: screen;
    transition: none;
}

/* Media queries específicos para animaciones */
@media (max-width: 768px) {
    .plane-btn-transition-rotate:hover {
        transform: rotate(3deg) !important;
    }
    
    .plane-btn-transition-scale:hover {
        transform: scale(1.05) !important;
    }
    
    .rhyme-word.highlighted {
        transform: scale(1.03);
    }
    
    .plane-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
    }
}

/* Optimizaciones para animaciones */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .plane-btn-transition-bounce:hover,
    .plane-btn-transition-pulse:hover,
    .plane-btn-transition-scale:hover,
    .plane-btn-transition-rotate:hover,
    .plane-btn-transition-flip:hover {
        transform: none !important;
    }
    
    .plane-btn-transition-sweep:after {
        display: none !important;
    }
    
    .plane-ripple,
    .plane-particle {
        display: none !important;
    }
    
    .typing-cursor {
        animation: none !important;
    }
}
