/* ========================================
   SKELETON SCREENS & MICRO-INTERACTIONS
   TracktomotoR Enhanced UX
   ======================================== */

/* ========================================
   1. SKELETON SCREENS
   ======================================== */

.skeleton {
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
    border-radius: 8px;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.02) 20%,
        rgba(0, 255, 255, 0.05) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Skeleton para imágenes */
.image-skeleton {
    position: relative;
    background: #0a0a0a;
    overflow: hidden;
}

.image-skeleton::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 255, 255, 0.1);
    border-top-color: rgba(0, 255, 255, 0.5);
    border-radius: 50%;
    animation: skeleton-rotate 1s linear infinite;
}

@keyframes skeleton-rotate {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Skeleton para texto */
.text-skeleton {
    height: 16px;
    background: linear-gradient(90deg, #1a1a1a 25%, #222 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin: 8px 0;
}

.text-skeleton.title {
    height: 24px;
    width: 70%;
}

.text-skeleton.subtitle {
    height: 14px;
    width: 50%;
    opacity: 0.6;
}

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

/* Aplicar a elementos mientras cargan */
.gallery-image.loading,
.merch-image.loading {
    position: relative;
    background: #0a0a0a;
    min-height: 300px;
}

.gallery-image.loading::after,
.merch-image.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 33%,
        rgba(0, 255, 255, 0.1) 50%,
        transparent 67%
    );
    animation: shimmer-load 1.5s infinite;
}

@keyframes shimmer-load {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   2. BLUR PROGRESSIVE LOAD
   ======================================== */

.progressive-image {
    filter: blur(20px);
    transition: filter 0.5s ease-out;
}

.progressive-image.loaded {
    filter: blur(0);
}

/* ========================================
   3. RIPPLE EFFECT
   ======================================== */

.ripple-effect {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.ripple-effect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple-effect:active::before {
    width: 300px;
    height: 300px;
    opacity: 0;
}

/* Ripple para botones oscuros */
.btn-primary.ripple,
.track-play.ripple {
    position: relative;
    overflow: hidden;
}

.ripple-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========================================
   4. HOVER MAGNETIC EFFECT
   ======================================== */

.magnetic-hover {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magnetic-hover:hover {
    transform: scale(1.05) translateY(-2px);
}

/* ========================================
   5. PULSE ANIMATION
   ======================================== */

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.pulse-glow {
    position: relative;
}

.pulse-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: inherit;
    opacity: 0.5;
    filter: blur(10px);
    animation: pulse-glow-animation 2s infinite;
}

@keyframes pulse-glow-animation {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* ========================================
   6. LOADING DOTS
   ======================================== */

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #00ffff;
    border-radius: 50%;
    animation: dot-pulse 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dot-pulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   7. AUDIO PREVIEW HOVER
   ======================================== */

.track-item {
    position: relative !important;
    transition: all 0.3s ease;
    overflow: visible;
}

.track-preview-indicator {
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #00ffff;
    font-size: 12px;
}

.track-item:hover .track-preview-indicator {
    opacity: 1;
    animation: preview-pulse 1s infinite;
}

@keyframes preview-pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

/* Preview Progress Bar */
.preview-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ffff, #ff00ff);
    width: 0;
    transition: width 5s linear;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.track-item.previewing .preview-progress {
    width: 100%;
}

/* Audio Wave Animation */
.audio-wave {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.3s;
}

.track-item.previewing .audio-wave {
    opacity: 1;
}

.audio-wave span {
    display: inline-block;
    width: 3px;
    height: 20px;
    background: linear-gradient(180deg, #00ffff, #0099cc);
    animation: wave 1s infinite ease-in-out;
}

.audio-wave span:nth-child(1) { animation-delay: 0s; }
.audio-wave span:nth-child(2) { animation-delay: 0.1s; }
.audio-wave span:nth-child(3) { animation-delay: 0.2s; }
.audio-wave span:nth-child(4) { animation-delay: 0.3s; }
.audio-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

/* ========================================
   8. TOUCH FEEDBACK
   ======================================== */

@media (hover: none) {
    .touch-feedback {
        -webkit-tap-highlight-color: rgba(0, 255, 255, 0.1);
    }

    .touch-feedback:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
}

/* ========================================
   9. SMOOTH APPEAR ANIMATION
   ======================================== */

.appear {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.appear.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   10. GLITCH HOVER EFFECT
   ======================================== */

.glitch-hover {
    position: relative;
    transition: all 0.3s;
}

.glitch-hover:hover {
    animation: glitch-small 0.3s;
}

@keyframes glitch-small {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

/* ========================================
   11. LOADING PERCENTAGE
   ======================================== */

.load-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

.loading .load-percentage {
    opacity: 1;
}

/* ========================================
   12. SUCCESS CHECKMARK
   ======================================== */

.success-check {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #00ff00;
    position: relative;
    opacity: 0;
    transform: scale(0);
    animation: success-pop 0.5s forwards;
}

@keyframes success-pop {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-check::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
}

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

@media (max-width: 768px) {
    .skeleton::after {
        animation-duration: 1.5s;
    }

    .audio-wave {
        display: none; /* Simplificar en móvil */
    }

    .track-preview-indicator {
        display: none; /* Preview no disponible en móvil */
    }
}