/**
 * Wrestling Lucha Party - Loading & Animation Styles
 * Professional loading states, spinners, and transitions
 */

/* ====================
   LOADING SPINNER
   ==================== */

.wlp-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top-color: var(--color-secondary, #FFD700);
    border-radius: 50%;
    animation: wlp-spin 0.8s linear infinite;
}

.wlp-spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.wlp-spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

@keyframes wlp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dual Ring Spinner */
.wlp-spinner-dual {
    display: inline-block;
    width: 64px;
    height: 64px;
}

.wlp-spinner-dual:after {
    content: " ";
    display: block;
    width: 46px;
    height: 46px;
    margin: 8px;
    border-radius: 50%;
    border: 5px solid var(--color-primary, #E74C3C);
    border-color: var(--color-primary, #E74C3C) transparent var(--color-secondary, #FFD700) transparent;
    animation: wlp-spin-dual 1.2s linear infinite;
}

@keyframes wlp-spin-dual {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====================
   LOADING OVERLAY
   ==================== */

.wlp-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wlp-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.wlp-loading-content {
    text-align: center;
    color: white;
}

.wlp-loading-content .wlp-spinner-dual {
    margin-bottom: 20px;
}

.wlp-loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 15px;
    color: var(--color-secondary, #FFD700);
}

.wlp-loading-subtext {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
}

/* ====================
   PROGRESS BAR
   ==================== */

.wlp-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.wlp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary, #E74C3C), var(--color-secondary, #FFD700));
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wlp-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    animation: wlp-progress-shine 2s infinite;
}

@keyframes wlp-progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ====================
   SKELETON LOADERS
   ==================== */

.wlp-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: wlp-skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.wlp-skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.wlp-skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.wlp-skeleton-card {
    height: 200px;
    border-radius: 12px;
}

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

/* ====================
   PULSE ANIMATION
   ==================== */

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

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

/* ====================
   SUCCESS ANIMATIONS
   ==================== */

.wlp-success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: var(--color-success, #4caf50);
    stroke-miterlimit: 10;
    margin: 20px auto;
    box-shadow: inset 0 0 0 var(--color-success, #4caf50);
    animation: wlp-checkmark-fill 0.4s ease-in-out 0.4s forwards, 
               wlp-checkmark-scale 0.3s ease-in-out 0.9s both;
}

.wlp-success-checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: var(--color-success, #4caf50);
    fill: none;
    animation: wlp-checkmark-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.wlp-success-checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: wlp-checkmark-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes wlp-checkmark-stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes wlp-checkmark-scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes wlp-checkmark-fill {
    100% { box-shadow: inset 0 0 0 40px var(--color-success, #4caf50); }
}

/* ====================
   FADE TRANSITIONS
   ==================== */

.wlp-fade-in {
    animation: wlp-fadeIn 0.3s ease-in;
}

.wlp-fade-out {
    animation: wlp-fadeOut 0.3s ease-out;
}

@keyframes wlp-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wlp-fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ====================
   SLIDE TRANSITIONS
   ==================== */

.wlp-slide-up {
    animation: wlp-slideUp 0.4s ease-out;
}

.wlp-slide-down {
    animation: wlp-slideDown 0.4s ease-out;
}

@keyframes wlp-slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes wlp-slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ====================
   BOUNCE ANIMATION
   ==================== */

.wlp-bounce {
    animation: wlp-bounce 1s infinite;
}

@keyframes wlp-bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

/* ====================
   BUTTON STATES
   ==================== */

.wlp-btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.wlp-btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: wlp-spin 0.6s linear infinite;
}

/* ====================
   UTILITY CLASSES
   ==================== */

.wlp-hidden {
    display: none !important;
}

.wlp-invisible {
    visibility: hidden !important;
}

.wlp-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.wlp-blur {
    filter: blur(4px);
    pointer-events: none;
}
