/* Advanced Effects CSS */

/* 3. Gradient Text Animations */
.section-title {
    background: linear-gradient(45deg, #6366f1, #8b5cf6, #06b6d4, #6366f1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift-text 8s ease infinite;
}

@keyframes gradient-shift-text {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 4. Floating Cards Effect */
.project-card,
.skill-category {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

.project-card:hover,
.skill-category:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(5deg);
}

.project-card::before,
.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    z-index: -1;
}

.project-card:hover::before,
.skill-category:hover::before {
    opacity: 1;
}

/* 7. Skill Bars with Animation */
.skill-progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
    position: relative;
}

.skill-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
    background-size: 200% 100%;
    border-radius: 10px;
    width: 0%;
    transition: width 2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progress-glow 3s ease infinite;
    position: relative;
}

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

@keyframes progress-glow {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 8. Parallax Scrolling */
.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    background: radial-gradient(circle at 30% 50%, rgba(99, 102, 241, 0.1), transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.1), transparent 50%);
    will-change: transform;
}

/* 10. Color-Shifting Background */
body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    background-size: 400% 400%;
    animation: background-shift 30s ease infinite;
}

@keyframes background-shift {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 50% 50%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 50%; }
}

/* 5. Cursor Trail Effect */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: screen;
    animation: trail-fade 1s ease-out forwards;
}

@keyframes trail-fade {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* 9. Typewriter Effect Styles */
.typewriter-text {
    overflow: hidden;
    border-right: 3px solid #6366f1;
    white-space: nowrap;
    animation: blink-caret 0.75s step-end infinite;
    display: inline-block;
}

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

/* Enhanced Buttons with Glow */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    animation: pulse-glow 2s ease infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 30px rgba(99, 102, 241, 0.6); }
}

/* Smooth Animations */
* {
    scroll-behavior: smooth;
}

/* Enhanced Glass Effect */
.glass-box {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .project-card:hover,
    .skill-category:hover {
        transform: translateY(-8px);
    }
    
    /* Disable 3D transforms on mobile for better performance */
    .project-card,
    .skill-category {
        transform-style: flat;
    }
    
    /* Simplify animations on mobile */
    @keyframes background-shift {
        0%, 100% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
    }
}

@media (max-width: 480px) {
    .project-card:hover,
    .skill-category:hover {
        transform: translateY(-5px);
    }
    
    /* Reduce animation intensity on small screens */
    .cursor-trail {
        display: none;
    }
    
    .btn::before {
        display: none;
    }
    
    @keyframes pulse-glow {
        0%, 100% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.3); }
        50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.5); }
    }
}
