/* Mountain Theme Animations for Pratham Saurabh Portfolio */

/* Stars Animation */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(0.8);
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    }
}

/* Mountain Layers */
.mountains {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
}

.mountain-layer {
    position: absolute;
    bottom: 0;
    width: 120%;
    height: 60%;
}

.mountain-back {
    background: linear-gradient(45deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    clip-path: polygon(0% 100%, 20% 60%, 40% 70%, 60% 40%, 80% 50%, 100% 30%, 100% 100%);
    opacity: 0.7;
    left: -10%;
    animation: mountainFloat 20s ease-in-out infinite;
}

.mountain-mid {
    background: linear-gradient(45deg, #34495e 0%, #2c3e50 50%, #34495e 100%);
    clip-path: polygon(0% 100%, 15% 50%, 35% 60%, 55% 30%, 75% 40%, 90% 35%, 100% 100%);
    opacity: 0.8;
    height: 50%;
    left: -5%;
    animation: mountainFloat 25s ease-in-out infinite reverse;
}

.mountain-front {
    background: linear-gradient(45deg, #2c3e50 0%, #1a252f 50%, #2c3e50 100%);
    clip-path: polygon(0% 100%, 25% 40%, 45% 50%, 65% 20%, 85% 30%, 100% 100%);
    height: 40%;
    left: 0%;
    animation: mountainFloat 30s ease-in-out infinite;
}

@keyframes mountainFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Moon Animation */
.moon {
    position: absolute;
    top: 15%;
    right: 15%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, #f4f4f4, #e0e0e0);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(244, 244, 244, 0.3);
    animation: moonGlow 4s ease-in-out infinite alternate;
}

@keyframes moonGlow {
    from { 
        box-shadow: 0 0 30px rgba(244, 244, 244, 0.3);
        transform: scale(1);
    }
    to { 
        box-shadow: 0 0 50px rgba(244, 244, 244, 0.6);
        transform: scale(1.05);
    }
}

/* Clouds Animation */
.clouds {
    position: absolute;
    width: 100%;
    height: 100%;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    opacity: 0.6;
    animation: cloudFloat 20s infinite linear;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
}

.cloud1 {
    width: 80px;
    height: 30px;
    top: 20%;
    left: -100px;
    animation-duration: 25s;
}

.cloud1::before {
    width: 50px;
    height: 40px;
    top: -15px;
    left: 10px;
}

.cloud1::after {
    width: 60px;
    height: 35px;
    top: -10px;
    right: 15px;
}

.cloud2 {
    width: 60px;
    height: 25px;
    top: 30%;
    left: -80px;
    animation-duration: 30s;
    animation-delay: -10s;
}

.cloud2::before {
    width: 40px;
    height: 30px;
    top: -10px;
    left: 5px;
}

.cloud2::after {
    width: 45px;
    height: 28px;
    top: -8px;
    right: 10px;
}

@keyframes cloudFloat {
    from { transform: translateX(0); }
    to { transform: translateX(calc(100vw + 100px)); }
}

/* Title Glow Animation */
@keyframes titleGlow {
    from { 
        filter: brightness(1);
        text-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    }
    to { 
        filter: brightness(1.3);
        text-shadow: 0 0 30px rgba(0, 255, 255, 0.7), 0 0 40px rgba(255, 0, 255, 0.3);
    }
}

/* Loading Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 255, 255, 0.2);
    border-left: 4px solid #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Button Hover Animations */
.cta-button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.5);
}

/* Card Hover Animations */
.project-card,
.experience-item,
.about-section {
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 255, 255, 0.2);
}

.experience-item:hover {
    transform: translateX(10px);
    box-shadow: 0 15px 35px rgba(0, 255, 255, 0.2);
}

.about-section:hover {
    transform: translateX(5px);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.2);
}

/* Icon Item Animations */
.icon-item {
    transition: all 0.3s ease;
}

.icon-item:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 255, 255, 0.3);
}

.icon-item .icon {
    transition: all 0.3s ease;
}

.icon-item:hover .icon {
    transform: scale(1.1) rotate(5deg);
}

/* Section Transition Animations */
.section {
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section.active {
    animation: slideInUp 0.6s ease-out;
}

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

/* Navigation Link Animations */
.nav-links li a {
    position: relative;
    transition: all 0.3s ease;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

/* Pulse Animation for Important Elements */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Fade In Animation for Content */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Typewriter Animation */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid #00ffff;
    white-space: nowrap;
    animation: typewriter 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #00ffff; }
}

/* Gradient Animation for Backgrounds */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
    .moon {
        width: 60px;
        height: 60px;
        top: 10%;
        right: 10%;
    }
    
    .cloud1, .cloud2 {
        animation-duration: 20s;
    }
    
    .mountain-layer {
        animation-duration: 15s;
    }
    
    /* Reduce motion for mobile if preferred */
    @media (prefers-reduced-motion: reduce) {
        .star {
            animation: none;
            opacity: 0.7;
        }
        
        .moon {
            animation: none;
        }
        
        .cloud {
            animation: none;
        }
        
        .mountain-layer {
            animation: none;
        }
    }
}

/* Print Styles - Disable Animations */
@media print {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .mountain-background {
        display: none;
    }
}