/* Advanced visual effects for portfolio */

/* Particle background */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

/* Gradient overlays */
.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05), rgba(114, 9, 183, 0.05));
    opacity: 0.6;
    z-index: -1;
    pointer-events: none;
    animation: gradientMove 15s ease infinite;
}

body.dark-mode .gradient-overlay {
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.05), rgba(114, 9, 183, 0.05));
}

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

/* Custom cursor effects */
.custom-cursor {
    position: fixed;
    width: 30px;
    height: 30px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    transform: translate3d(0, 0, 0);
    transition: transform 0.1s ease, width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
    z-index: 9999;
    opacity: 0.7;
    mix-blend-mode: difference;
}

.cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    transform: translate3d(0, 0, 0);
    transition: transform 0.15s ease-out, width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
    z-index: 9999;
    opacity: 0.8;
}

.custom-cursor.cursor-hover {
    width: 50px;
    height: 50px;
    border-color: var(--accent-color);
    opacity: 0.5;
}

.cursor-dot.cursor-hover {
    width: 4px;
    height: 4px;
    background-color: var(--accent-light);
}

/* Enhanced card effects */
.pulse-slight {
    animation: pulseSlightly 0.5s ease;
}

@keyframes pulseSlightly {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Enhanced Hover Effects */
.project-card {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.5s ease;
}

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

.skill-item:hover {
    transform: translateY(-8px) scale(1.05);
}

.skill-item:hover .skill-icon {
    color: var(--accent-color);
    animation: pulse 1s infinite;
}

.cert-card:hover, 
.achievement-card:hover, 
.responsibility-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(67, 97, 238, 0.2);
}

/* Button hover animations */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: -1;
}

.btn:hover:after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Timeline animations */
.timeline-content {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.timeline-content:hover {
    transform: translateY(-8px) scale(1.03);
}

/* Section background enhancement */
section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 300% 300%;
    background-image: linear-gradient(
        -45deg, 
        rgba(67, 97, 238, 0.05) 0%, 
        rgba(67, 97, 238, 0.02) 25%, 
        rgba(114, 9, 183, 0.02) 51%, 
        rgba(114, 9, 183, 0.05) 100%
    );
    animation: gradientAnimation 15s ease infinite;
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

body.dark-mode section::before {
    background-image: linear-gradient(
        -45deg, 
        rgba(76, 201, 240, 0.05) 0%, 
        rgba(76, 201, 240, 0.02) 25%, 
        rgba(114, 9, 183, 0.02) 51%, 
        rgba(114, 9, 183, 0.05) 100%
    );
}

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

/* Dark mode transition */
body {
    transition: background-color 0.5s ease, color 0.5s ease;
}

.dark-mode-toggle + .toggle-label {
    transition: background 0.4s ease;
}

body.dark-mode .dark-mode-special {
    text-shadow: 0 0 10px var(--primary-color);
}

/* Animated underline for navigation */
.main-nav a {
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.main-nav a:hover::after {
    width: 70%;
}

.main-nav a.active::after {
    width: 70%;
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .custom-cursor, .cursor-dot {
        display: none;
    }
}

/* Theme Change Transition and Notification */
body {
    transition: background-color 0.8s ease, color 0.8s ease;
}

.theme-notification {
    animation: fadeInOut 0.8s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    font-weight: 500;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    20% { opacity: 1; transform: translate(-50%, 0); }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* Improve dark mode toggle transitions */
.toggle-label {
    transition: background 0.5s ease;
}

.toggle-ball {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dark-mode-toggle:checked + .toggle-label .toggle-ball {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
