/* ============================================
   ENHANCED UI STYLES - Beautiful Portfolio Upgrades
   Building upon the existing premium foundation
   ============================================ */

/* ============================================
   🎨 ENHANCED COLOR PALETTE
   ============================================ */
:root {
    /* Refined primary backgrounds - deeper, richer blacks */
    --bg-primary-enhanced: #020204;
    --bg-secondary-enhanced: #050508;
    --bg-tertiary-enhanced: #0a0a15;
    
    /* Enhanced accent colors */
    --accent-rose: #f43f5e;
    --accent-rose-light: #fb7185;
    --accent-amber: #f59e0b;
    --accent-amber-light: #fbbf24;
    --accent-emerald: #10b981;
    --accent-emerald-light: #34d399;
    
    /* Enhanced gradients */
    --gradient-sunset: linear-gradient(135deg, #f43f5e 0%, #f59e0b 50%, #8b5cf6 100%);
    --gradient-ocean: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
    --gradient-aurora: linear-gradient(135deg, #10b981 0%, #3b82f6 50%, #8b5cf6 100%);
    --gradient-fire: linear-gradient(135deg, #f43f5e 0%, #f59e0b 100%);
    --gradient-ice: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    
    /* Enhanced glass effects */
    --glass-bg-enhanced: rgba(255, 255, 255, 0.04);
    --glass-bg-hover-enhanced: rgba(255, 255, 255, 0.09);
    --glass-border-enhanced: rgba(255, 255, 255, 0.1);
    --glass-border-glow: rgba(139, 92, 246, 0.3);
    
    /* Enhanced shadows */
    --shadow-glow-enhanced: 0 0 60px rgba(139, 92, 246, 0.3);
    --shadow-glow-gold-enhanced: 0 0 60px rgba(245, 158, 11, 0.25);
    --shadow-neon-purple: 0 0 40px rgba(139, 92, 246, 0.4), 0 0 80px rgba(139, 92, 246, 0.2);
    --shadow-neon-gold: 0 0 40px rgba(245, 158, 11, 0.4), 0 0 80px rgba(245, 158, 11, 0.2);
    
    /* Enhanced transitions */
    --transition-ultra-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   ✨ ENHANCED HERO SECTION
   ============================================ */
.hero {
    position: relative;
    overflow: visible;
}

/* Animated mesh gradient background */
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
    animation: mesh-rotate 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes mesh-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced hero title with text shadow */
.hero-title {
    text-shadow: 
        0 0 40px rgba(139, 92, 246, 0.3),
        0 0 80px rgba(139, 92, 246, 0.1);
    position: relative;
    z-index: 1;
}

/* Animated gradient text enhancement */
.gradient-text {
    background-size: 300% 300%;
    animation: gradient-flow-enhanced 6s ease infinite;

}

@keyframes gradient-flow-enhanced {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 0%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 100%; }
    100% { background-position: 0% 50%; }
}

/* ============================================
   💎 ENHANCED GLASS CARDS
   ============================================ */
.glass-card {
    position: relative;
    overflow: hidden;
}

/* Animated border gradient on hover */
.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(139, 92, 246, 0.4) 50%,
        rgba(245, 158, 11, 0.4) 70%,
        transparent 80%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-ultra-smooth);
    z-index: 1;
}

.glass-card:hover::before {
    opacity: 1;
    animation: border-shimmer 3s linear infinite;
}

@keyframes border-shimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Inner glow effect */
.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(139, 92, 246, 0.1) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity var(--transition-ultra-smooth);
    pointer-events: none;
}

.glass-card:hover::after {
    opacity: 1;
}

/* ============================================
   🌟 ENHANCED BUTTONS
   ============================================ */
.btn-primary {
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on hover */
.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.btn-primary:hover::after {
    animation: btn-shimmer 1.5s ease-in-out;
}

@keyframes btn-shimmer {
    0% { transform: translateX(-100%) rotate(45deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%) rotate(45deg); opacity: 0; }
}

/* Pulse ring animation */
.btn-primary::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid rgba(139, 92, 246, 0.5);
    opacity: 0;
    animation: btn-pulse 2s ease-in-out infinite;
}

@keyframes btn-pulse {
    0%, 100% { transform: scale(1); opacity: 0; }
    50% { transform: scale(1.05); opacity: 0.5; }
}

.btn-primary:hover::before {
    animation: none;
    transform: scale(1.08);
    opacity: 0.8;
    border-color: rgba(245, 158, 11, 0.6);
}

/* ============================================
   🎭 ENHANCED PORTFOLIO CARDS
   ============================================ */
.featured-card,
.portfolio-item {
    position: relative;
}

/* Holographic overlay effect */
.featured-card::before,
.portfolio-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.1) 0%,
        rgba(245, 158, 11, 0.1) 25%,
        rgba(6, 182, 212, 0.1) 50%,
        rgba(16, 185, 129, 0.1) 75%,
        rgba(139, 92, 246, 0.1) 100%
    );
    background-size: 400% 400%;
    animation: holographic 8s ease infinite;
    opacity: 0;
    transition: opacity var(--transition-ultra-smooth);
    z-index: 2;
    pointer-events: none;
}

.featured-card:hover::before,
.portfolio-item:hover::before {
    opacity: 1;
}

@keyframes holographic {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Enhanced overlay with blur */
.portfolio-overlay {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: linear-gradient(
        180deg,
        rgba(3, 3, 5, 0.6) 0%,
        rgba(3, 3, 5, 0.95) 100%
    );
}

/* ============================================
   💫 ENHANCED TESTIMONIALS
   ============================================ */
.testimonial-card {
    position: relative;
}

/* Animated quote mark */
.testimonial-card::before {
    font-size: 8rem;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.2;
    animation: quote-float 6s ease-in-out infinite;
}

@keyframes quote-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

/* Star rating animation */
.testimonial-rating i {
    animation: star-twinkle 3s ease-in-out infinite;
    display: inline-block;
}

.testimonial-rating i:nth-child(1) { animation-delay: 0s; }
.testimonial-rating i:nth-child(2) { animation-delay: 0.2s; }
.testimonial-rating i:nth-child(3) { animation-delay: 0.4s; }
.testimonial-rating i:nth-child(4) { animation-delay: 0.6s; }
.testimonial-rating i:nth-child(5) { animation-delay: 0.8s; }

@keyframes star-twinkle {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.5));
    }
    50% { 
        transform: scale(1.2);
        filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.8));
    }
}

/* ============================================
   🎪 ENHANCED CTA SECTION
   ============================================ */
.cta-section {
    position: relative;
    overflow: hidden;
}

/* Animated background particles */
.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
    animation: cta-particles 20s linear infinite;
    pointer-events: none;
}

@keyframes cta-particles {
    0% { background-size: 100% 100%, 100% 100%, 100% 100%; }
    50% { background-size: 150% 150%, 120% 120%, 130% 130%; }
    100% { background-size: 100% 100%, 100% 100%, 100% 100%; }
}

/* CTA content glow */
.cta-content {
    position: relative;
    z-index: 1;
}

.cta-content h2 {
    text-shadow: 
        0 0 40px rgba(139, 92, 246, 0.3),
        0 0 80px rgba(139, 92, 246, 0.1);
}

/* ============================================
   🌌 ENHANCED BACKGROUND ORBS
   ============================================ */
.orb {
    filter: blur(120px);
    mix-blend-mode: screen;
}

.orb-1 {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    animation: orb1-float 25s ease-in-out infinite;
}

.orb-2 {
    background: linear-gradient(135deg, #f59e0b, #f43f5e);
    animation: orb2-float 20s ease-in-out infinite;
}

.orb-3 {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    animation: orb3-float 30s ease-in-out infinite;
}

@keyframes orb1-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(100px, -50px) scale(1.1); }
    50% { transform: translate(-50px, 100px) scale(0.95); }
    75% { transform: translate(50px, 50px) scale(1.05); }
}

@keyframes orb2-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-80px, 60px) scale(1.05); }
    50% { transform: translate(60px, -80px) scale(0.9); }
    75% { transform: translate(-40px, -40px) scale(1.1); }
}

@keyframes orb3-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(60px, 80px) scale(1.1); }
    50% { transform: translate(-80px, -60px) scale(0.95); }
    75% { transform: translate(40px, -80px) scale(1.05); }
}

/* ============================================
   ✨ ENHANCED SCROLL INDICATOR
   ============================================ */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
    50% { transform: translateX(-50%) translateY(10px); opacity: 1; }
}

.scroll-indicator span {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.scroll-indicator .mouse {
    width: 24px;
    height: 36px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.scroll-indicator .mouse::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent-gold);
    border-radius: 50%;
    animation: scroll-wheel 2s ease-in-out infinite;
}

@keyframes scroll-wheel {
    0%, 100% { opacity: 1; top: 6px; }
    50% { opacity: 0; top: 18px; }
}

/* ============================================
   🎨 ENHANCED SECTION DIVIDERS
   ============================================ */
.section-divider {
    position: relative;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(139, 92, 246, 0.3) 20%,
        rgba(245, 158, 11, 0.3) 50%,
        rgba(139, 92, 246, 0.3) 80%,
        transparent 100%
    );
    margin: 80px 0;
}

.section-divider::before {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-gold);
    font-size: 1.2rem;
    background: var(--bg-primary);
    padding: 0 20px;
    animation: divider-glow 3s ease-in-out infinite;
}

@keyframes divider-glow {
    0%, 100% { text-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
    50% { text-shadow: 0 0 30px rgba(245, 158, 11, 0.8), 0 0 60px rgba(245, 158, 11, 0.4); }
}

/* ============================================
   🌈 ENHANCED SKILL PILLS
   ============================================ */
.skill-pill {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-bounce);
}

/* Liquid fill effect on hover */
.skill-pill::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, transparent, rgba(245, 158, 11, 0.3));
    transition: height var(--transition-bounce);
}

.skill-pill:hover::after {
    height: 100%;
}

.skill-pill:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(245, 158, 11, 0.3),
        0 0 0 1px rgba(245, 158, 11, 0.5);
}

/* ============================================
   💎 ENHANCED LOADING ANIMATIONS
   ============================================ */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Apply animations to key elements */
.hero-content {
    animation: fade-in-up 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-visual {
    animation: scale-in 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.3s;
}

/* ============================================
   🎯 ENHANCED FOCUS STATES
   ============================================ */
*:focus-visible {
    outline: 2px solid var(--accent-purple);
    outline-offset: 4px;
    border-radius: 4px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 4px;
}

/* ============================================
   📱 RESPONSIVE ENHANCEMENTS
   ============================================ */
@media (max-width: 768px) {
    /* Reduce effects on mobile for performance */
    .orb {
        opacity: 0.2;
    }
    
    .glass-card::before {
        display: none;
    }
    
    .hero::before {
        display: none;
    }
    
    /* Keep important animations */
    .gradient-text {
        animation-duration: 8s;
    }
}

/* ============================================
   🎨 DARK MODE PERFECTION
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary-enhanced: #010103;
        --bg-secondary-enhanced: #040407;
    }
}

/* ============================================
   ⚡ PERFORMANCE OPTIMIZATIONS
   ============================================ */
.will-animate {
    will-change: transform, opacity;
}

/* Hardware acceleration for smooth animations */
.glass-card,
.btn,
.featured-card,
.portfolio-item {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ============================================
   🌟 LOADING STATE ENHANCEMENTS
   ============================================ */
.loading-skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   🎯 SKILLS GRID CENTERING
   Center the bottom row of cards
   ============================================ */
.skills-section .skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(20px, 3vw, 36px);
    max-width: 1280px;
    margin: 0 auto;
}

.skills-section .skills-grid .skill-card {
    max-width: 363px;
}

@media (min-width: 1200px) {
    .skills-section .skills-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: clamp(20px, 3vw, 36px);
        max-width: 1280px;
        margin: 0 auto;
        justify-items: center;
    }
    
    .skills-section .skills-grid .skill-card {
        width: 100%;
        max-width: 280px;
    }
}

/* ============================================
   🎭 HOVER STATE ENHANCEMENTS
   ============================================ */
/* Magnetic hover effect for interactive elements */
.magnetic-hover {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.magnetic-hover:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(139, 92, 246, 0.3),
        0 0 0 1px rgba(139, 92, 246, 0.2);
}

/* Remove homepage rotating neon glow decoration */
body.home .hero-content::before,
body.home .hero-content::after,
body.home .hero-visual::before,
body.home .hero-visual::after,
body.home .floating-shape,
body.home .floating-shape-1,
body.home .floating-shape-2,
body.home .hero::before {
    display: none !important;
    animation: none !important;
    opacity: 0 !important;
}

/* ============================================
   🎪 SPECIAL EFFECTS
   ============================================ */
/* Particle effect container */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-gold);
    border-radius: 50%;
    opacity: 0;
    animation: particle-float linear infinite;
}

@keyframes particle-float {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1);
    }
}