/* Page Transition Styles */
/* Uses GSAP for animations - include via CDN */

/* Transition Overlay */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    opacity: 0;
    visibility: hidden;
}

.page-transition-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Background with blur effect */
.transition-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Centered loader container */
.transition-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}

/* Loader icon container */
.loader-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: 2.5rem;
}

/* Theme: Home - Rocket */
.theme-home .loader-icon {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    color: white;
    box-shadow: 0 10px 40px rgba(8, 145, 178, 0.3);
}

/* Theme: Login - Lock/Key */
.theme-login .loader-icon {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    box-shadow: 0 10px 40px rgba(79, 70, 229, 0.3);
}

/* Theme: Signup - Sparkle */
.theme-signup .loader-icon {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 10px 40px rgba(34, 197, 94, 0.3);
}

/* Theme: Dashboard */
.theme-dashboard .loader-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.3);
}

/* Theme: Default */
.theme-default .loader-icon {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
    box-shadow: 0 10px 40px rgba(100, 116, 139, 0.3);
}

/* Theme: Pending */
.theme-pending .loader-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 10px 40px rgba(245, 158, 11, 0.3);
}

/* Theme: Payment */
.theme-payment .loader-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.3);
}

/* Theme: Success */
.theme-success .loader-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
}

/* Loading text */
.loader-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
}

.loader-subtext {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Progress bar */
.loader-progress {
    width: 200px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0891b2, #0e7490);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.theme-login .loader-progress-bar {
    background: linear-gradient(90deg, #4f46e5, #6366f1);
}

.theme-signup .loader-progress-bar {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.theme-dashboard .loader-progress-bar {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

/* Spinner animation (using Spin.js style) */
.loader-spinner {
    width: 40px;
    height: 40px;
    position: relative;
}

.loader-spinner::before,
.loader-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.loader-spinner::before {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dots loader */
.loader-dots {
    display: flex;
    gap: 6px;
    margin-top: 0.5rem;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loader-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .loader-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
        border-radius: 16px;
    }

    .loader-text {
        font-size: 1rem;
    }

    .loader-progress {
        width: 160px;
    }
}

/* Page content fade */
.page-content {
    transition: opacity 0.3s ease;
}

.page-content.fading {
    opacity: 0;
}