/* Enhanced Animations and Effects for Portfolio */

/* Custom Cursor Styles */
* {
    cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iNCIgZmlsbD0iIzNhODZmZiIgZmlsbC1vcGFjaXR5PSIwLjYiLz4KPGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMiIgZmlsbD0iIzNhODZmZiIvPgo8L3N2Zz4=') 12 12, auto;
}

a, button, .clickable {
    cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iNiIgZmlsbD0iIzAwZjVkNCIgZmlsbC1vcGFjaXR5PSIwLjQiLz4KPGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMyIgZmlsbD0iIzAwZjVkNCIvPgo8L3N2Zz4=') 12 12, pointer;
}

/* Sticky Navigation with Color Change */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
}

.header.scrolled {
    background: rgba(17, 34, 64, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(58, 134, 255, 0.1);
}

.header.scrolled .nav {
    padding: 0.8rem 0;
}

.header.scrolled .logo {
    transform: scale(0.9);
    color: var(--accent-color);
}

/* Animated Social Icons */
.social-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    border: 2px solid transparent;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 50%;
}

.social-link i {
    position: relative;
    z-index: 2;
    font-size: 1.2rem;
    transition: all 0.4s ease;
}

.social-link:hover {
    transform: translateY(-8px) scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(58, 134, 255, 0.4);
}

.social-link:hover::before {
    opacity: 1;
}

.social-link:hover i {
    color: white;
    transform: rotateY(360deg) scale(1.2);
}

/* Animated skill icons */
.skill-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1.5rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.skill-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translate(-50%, -50%);
}

.skill-icon:hover::before {
    width: 120%;
    height: 120%;
}

.skill-icon:hover {
    transform: translateY(-5px) rotateY(15deg);
    box-shadow: 0 15px 40px rgba(58, 134, 255, 0.3);
}

.skill-icon:hover i,
.skill-icon:hover img {
    color: white;
    filter: brightness(0) invert(1);
    transform: scale(1.2) rotateZ(10deg);
    z-index: 2;
    position: relative;
}

/* Image Hover Zoom Effect */
.project-image,
.project-video,
.about-image {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-image img,
.project-video iframe,
.project-video video,
.about-image img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-image:hover img,
.project-video:hover iframe,
.project-video:hover video,
.about-image:hover img {
    transform: scale(1.15) rotate(2deg);
}

.project-image::after,
.project-video::after,
.about-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(58, 134, 255, 0.2), rgba(0, 245, 212, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-image:hover::after,
.project-video:hover::after,
.about-image:hover::after {
    opacity: 1;
}

/* Glassmorphism Effects */
.card-glassmorphism,
.demo-card,
.project-card,
.experience-card {
    background: rgba(17, 34, 64, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-glassmorphism:hover,
.demo-card:hover,
.project-card:hover,
.experience-card:hover {
    background: rgba(17, 34, 64, 0.2);
    border-color: rgba(58, 134, 255, 0.3);
    box-shadow: 0 15px 60px rgba(58, 134, 255, 0.2);
    transform: translateY(-10px);
}

/* Enhanced Shadow Effects */
.shadow-glow {
    box-shadow: 
        0 0 20px rgba(58, 134, 255, 0.3),
        0 0 40px rgba(58, 134, 255, 0.2),
        0 0 80px rgba(58, 134, 255, 0.1);
}

.shadow-glow-accent {
    box-shadow: 
        0 0 20px rgba(0, 245, 212, 0.3),
        0 0 40px rgba(0, 245, 212, 0.2),
        0 0 80px rgba(0, 245, 212, 0.1);
}

/* Animated Buttons */
.btn {
    position: relative;
    overflow: hidden;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2));
    border-radius: 50%;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translate(-50%, -50%);
}

.btn:hover::before {
    width: 300%;
    height: 300%;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(58, 134, 255, 0.4);
}

.btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* Floating Animation for Icons */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating-icon {
    animation: float 3s ease-in-out infinite;
}

.floating-icon:nth-child(2) {
    animation-delay: 0.5s;
}

.floating-icon:nth-child(3) {
    animation-delay: 1s;
}

.floating-icon:nth-child(4) {
    animation-delay: 1.5s;
}

/* Pulse Animation for Important Elements */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(58, 134, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(58, 134, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(58, 134, 255, 0);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Text Glow Effect */
.text-glow {
    text-shadow: 
        0 0 5px rgba(58, 134, 255, 0.5),
        0 0 10px rgba(58, 134, 255, 0.3),
        0 0 15px rgba(58, 134, 255, 0.2);
}

.text-glow-accent {
    text-shadow: 
        0 0 5px rgba(0, 245, 212, 0.5),
        0 0 10px rgba(0, 245, 212, 0.3),
        0 0 15px rgba(0, 245, 212, 0.2);
}

/* Gradient Border Animation */
@keyframes gradient-border {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-border {
    position: relative;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--secondary-color), var(--primary-color));
    background-size: 400% 400%;
    animation: gradient-border 3s ease infinite;
    border-radius: 16px;
    padding: 2px;
}

.gradient-border > * {
    background: var(--bg-primary);
    border-radius: 14px;
}

/* Loading Spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(58, 134, 255, 0.3);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 0.15em solid var(--accent-color);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-color); }
}

/* Slide up animation for cards */
@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

/* Parallax Background Effect */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

.parallax-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8), rgba(17, 34, 64, 0.9));
}

/* Enhanced focus states for accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus {
    outline: 3px solid rgba(58, 134, 255, 0.5);
    outline-offset: 2px;
}

/* Smooth scrolling behavior */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .social-link:hover,
    .skill-icon:hover {
        transform: translateY(-4px) scale(1.05);
    }
    
    .project-image:hover img,
    .project-video:hover iframe,
    .about-image:hover img {
        transform: scale(1.08) rotate(1deg);
    }
    
    .btn:hover {
        transform: translateY(-2px) scale(1.02);
    }
    
    .custom-cursor,
    .custom-cursor-hover {
        cursor: auto !important;
    }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .floating-icon {
        animation: none;
    }
    
    .pulse-animation {
        animation: none;
    }
    
    .typewriter {
        animation: none;
        border-right: none;
    }
}
