/* Page Loading Animations - Universal System */

/* Loading Screen */
.page-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #0a0a0a 100%);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    overflow: hidden;
}

/* Matrix-style background particles */
.page-loading-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 0, 255, 0.05) 0%, transparent 50%);
    animation: matrixPulse 4s ease-in-out infinite;
}

@keyframes matrixPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.page-loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Loading Spinner - Hacker Style */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 149, 255, 0.2);
    border-top: 3px solid #0095ff;
    border-right: 3px solid #00ffff;
    border-bottom: 3px solid #ff00ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
    box-shadow: 
        0 0 20px rgba(0, 149, 255, 0.5),
        inset 0 0 20px rgba(0, 149, 255, 0.1);
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 1px solid rgba(255, 0, 255, 0.4);
    border-radius: 50%;
    animation: reverseSpin 1.5s linear infinite;
}

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

@keyframes reverseSpin {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Loading Text - Hacker Style */
.loading-text {
    color: #0095ff;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 20px;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
    text-shadow: 
        0 0 10px rgba(0, 149, 255, 0.8),
        0 0 20px rgba(0, 149, 255, 0.4),
        0 0 30px rgba(0, 149, 255, 0.2);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

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

/* Page Content Animations - Hacker Style */
.page-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    position: relative;
}

.page-content.loaded {
    opacity: 1;
    transform: translateY(0);
}

.page-content.loaded::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #0095ff, #00ffff, #ff00ff);
    background-size: 200% 100%;
    animation: scanLine 3s ease-in-out infinite;
    z-index: 1000;
}

@keyframes scanLine {
    0% { 
        background-position: -200% 0;
        opacity: 0;
    }
    50% { 
        opacity: 1;
    }
    100% { 
        background-position: 200% 0;
        opacity: 0;
    }
}

/* Staggered Content Animations */
.content-stagger {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.content-stagger.loaded {
    opacity: 1;
    transform: translateY(0);
}

.content-stagger:nth-child(1) { transition-delay: 0.1s; }
.content-stagger:nth-child(2) { transition-delay: 0.2s; }
.content-stagger:nth-child(3) { transition-delay: 0.3s; }
.content-stagger:nth-child(4) { transition-delay: 0.4s; }
.content-stagger:nth-child(5) { transition-delay: 0.5s; }
.content-stagger:nth-child(6) { transition-delay: 0.6s; }

/* Navigation Animation */
.navbar, header {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.navbar.loaded, header.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Card Animations - Hacker Style */
.card, .event-card, .team-card, .achievement-card {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.card.loaded, .event-card.loaded, .team-card.loaded, .achievement-card.loaded {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.card.loaded::before, .event-card.loaded::before, .team-card.loaded::before, .achievement-card.loaded::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 149, 255, 0.1), transparent);
    animation: cardScan 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes cardScan {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Hero Section Animation */
.hero-section, .home-container {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.hero-section.loaded, .home-container.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Form Animations */
.form-container {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.form-container.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Button Animations - Hacker Style */
.btn, .cta-button {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.btn.loaded, .cta-button.loaded {
    opacity: 1;
    transform: translateY(0);
}

.btn.loaded::before, .cta-button.loaded::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 149, 255, 0.3), transparent);
    animation: buttonGlow 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes buttonGlow {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Footer Animation */
footer {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

footer.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Progress Bar - Hacker Style */
.loading-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #0095ff, #00ffff, #ff00ff, #0095ff);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressGlow 2s ease-in-out infinite;
    box-shadow: 
        0 0 10px rgba(0, 149, 255, 0.8),
        0 0 20px rgba(0, 149, 255, 0.4);
}

@keyframes progressGlow {
    0%, 100% { 
        background-position: 0% 50%;
        box-shadow: 
            0 0 10px rgba(0, 149, 255, 0.8),
            0 0 20px rgba(0, 149, 255, 0.4);
    }
    50% { 
        background-position: 100% 50%;
        box-shadow: 
            0 0 15px rgba(0, 255, 255, 0.8),
            0 0 30px rgba(0, 255, 255, 0.4);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .loading-spinner {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }
    
    .loading-text {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
    
    .page-content {
        transform: translateY(20px);
    }
}

/* Hacker-style glitch effect for text */
.loading-text.glitch {
    animation: glitch 0.3s ease-in-out infinite;
}

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

/* Matrix rain effect for background */
.matrix-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.matrix-rain::before {
    content: '01';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 200%;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(0, 149, 255, 0.1) 50%, 
        transparent 100%);
    animation: matrixRain 3s linear infinite;
    font-family: 'Courier New', monospace;
    font-size: 20px;
    color: #0095ff;
    text-shadow: 0 0 10px rgba(0, 149, 255, 0.8);
    white-space: pre-wrap;
    line-height: 20px;
}

@keyframes matrixRain {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .page-loading-screen {
        background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .page-loading-screen,
    .loading-spinner,
    .page-content,
    .content-stagger,
    .navbar,
    header,
    .card,
    .event-card,
    .team-card,
    .achievement-card,
    .hero-section,
    .home-container,
    .form-container,
    .btn,
    .cta-button,
    footer {
        animation: none;
        transition: opacity 0.3s ease-out;
    }
    
    .loading-spinner {
        animation: spin 2s linear infinite;
    }
} 