/**
 * 🌟 PLAYDEX SMOOTH TRANSITIONS & LOADING SPINNER
 * Система плавних переходів та спінера завантаження
 */

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

#playdex-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(26, 26, 46, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#playdex-spinner.active {
    opacity: 1;
    visibility: visible;
}

/* Основний спінер */
.spinner-container {
    text-align: center;
    color: white;
}

.spinner-ring {
    display: inline-block;
    width: 64px;
    height: 64px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid #00d4ff;
    border-right: 4px solid #0099cc;
    animation: playdex-spin 1.2s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
    margin-bottom: 16px;
}

.spinner-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 12px;
    animation: playdex-pulse 2s ease-in-out infinite;
}

/* Анімації */
@keyframes playdex-spin {
    0% { 
        transform: rotate(0deg); 
    }
    100% { 
        transform: rotate(360deg); 
    }
}

@keyframes playdex-pulse {
    0%, 100% { 
        opacity: 0.6; 
    }
    50% { 
        opacity: 1; 
    }
}

/* ========================================
   PAGE TRANSITION EFFECTS
======================================== */

body {
    transition: opacity 0.3s ease;
}

.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
}

/* Плавне затемнення при переходах */
.page-fade-out {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

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

@media (max-width: 768px) {
    .spinner-ring {
        width: 48px;
        height: 48px;
        border-width: 3px;
    }
    
    .spinner-text {
        font-size: 12px;
    }
}

/* ========================================
   DARK THEME SUPPORT
======================================== */

@media (prefers-color-scheme: dark) {
    #playdex-spinner {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(16, 16, 32, 0.95) 100%);
    }
}

/* ========================================
   ALTERNATIVE SPINNER STYLES
======================================== */

/* Стиль 2: Точки */
.spinner-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.spinner-dots div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #00d4ff;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.spinner-dots div:nth-child(1) {
    left: 8px;
    animation: dots1 0.6s infinite;
}

.spinner-dots div:nth-child(2) {
    left: 8px;
    animation: dots2 0.6s infinite;
}

.spinner-dots div:nth-child(3) {
    left: 32px;
    animation: dots2 0.6s infinite;
}

.spinner-dots div:nth-child(4) {
    left: 56px;
    animation: dots3 0.6s infinite;
}

@keyframes dots1 {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes dots3 {
    0% { transform: scale(1); }
    100% { transform: scale(0); }
}

@keyframes dots2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(24px, 0); }
}

/* Стиль 3: Pulse */
.spinner-pulse {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #00d4ff;
    border-radius: 100%;
    animation: scale-out 1.0s infinite ease-in-out;
}

@keyframes scale-out {
    0% {
        transform: scale(0);
    } 
    100% {
        transform: scale(1.0);
        opacity: 0;
    }
}
