/* AutoNarky.com Enhanced Styles with Advanced Animations */

/* Root Variables for Animations */
:root {
    --animation-duration: 0.6s;
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --blur-strength: 10px;
    --gradient-animation-speed: 8s;
}

/* Base Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

@keyframes rotate-continuous {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce-subtle {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes slide-in-blur {
    from {
        opacity: 0;
        transform: translateX(-100px);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

/* Particle Background */
.particle-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(odd) {
    animation-delay: -3s;
    animation-duration: 8s;
}

.particle:nth-child(even) {
    animation-delay: -1s;
    animation-duration: 10s;
}

/* Enhanced Navigation */
.nav-container {
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s var(--animation-timing);
}

.nav-container.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.nav-links a {
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--animation-timing);
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #0ea5e9, #3b82f6);
    transition: left 0.4s var(--animation-timing);
}

.nav-links a:hover::before {
    left: 0;
}

.nav-links a:hover {
    transform: translateY(-2px);
    color: #0ea5e9;
}

/* Hero Section Enhancements */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #1e40af 100%);
    background-size: 200% 200%;
    animation: gradient-shift var(--gradient-animation-speed) ease infinite;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

.hero-badge {
    animation: fadeInUp var(--animation-duration) var(--animation-timing) 0.2s both;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-title {
    animation: fadeInUp var(--animation-duration) var(--animation-timing) 0.4s both;
}

.hero-title .highlight {
    background: linear-gradient(45deg, #fbbf24, #f59e0b, #d97706, #fbbf24);
    background-size: 300% 300%;
    animation: gradient-shift 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    animation: fadeInUp var(--animation-duration) var(--animation-timing) 0.6s both;
}

.hero-cta {
    animation: fadeInUp var(--animation-duration) var(--animation-timing) 0.8s both;
}

.hero-stats {
    animation: fadeInUp var(--animation-duration) var(--animation-timing) 1s both;
}

.stat {
    transition: all 0.3s var(--animation-timing);
}

.stat:hover {
    transform: translateY(-5px) scale(1.05);
}

/* Enhanced Buttons */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--animation-timing);
}

.btn::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.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(-1px);
    transition: transform 0.1s;
}

/* Tool Cards with Advanced Animations */
.tool-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--animation-timing);
    opacity: 0;
    transform: translateY(40px);
}

.tool-card.animate-in {
    opacity: 1;
    transform: translateY(0);
    animation: scaleIn var(--animation-duration) var(--animation-timing);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.05) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.5s var(--animation-timing);
}

.tool-card:hover::before {
    transform: scale(1);
}

.tool-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.tool-card:hover .tool-logo {
    transform: scale(1.1) rotate(5deg);
}

.tool-logo {
    transition: all 0.3s var(--animation-timing);
}

/* Galaxy.ai Featured Section */
.galaxy-featured {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

.galaxy-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    animation: slide-in-blur 2s ease-in-out infinite alternate;
}

.galaxy-badge {
    animation: bounce-subtle 2s ease-in-out infinite;
}

/* Search Bar Enhancements */
.search-container {
    position: relative;
}

.search-input {
    transition: all 0.3s var(--animation-timing);
    backdrop-filter: blur(20px);
}

.search-input:focus {
    transform: scale(1.02);
    box-shadow: 0 10px 40px rgba(14, 165, 233, 0.3);
}

.search-suggestions {
    animation: fadeInUp 0.3s var(--animation-timing);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-suggestion {
    transition: all 0.2s var(--animation-timing);
}

.search-suggestion:hover {
    background: rgba(14, 165, 233, 0.1);
    transform: translateX(10px);
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, 
        rgba(240, 240, 240, 0.8) 25%, 
        rgba(220, 220, 220, 0.8) 50%, 
        rgba(240, 240, 240, 0.8) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(14, 165, 233, 0.1);
    border-left: 4px solid #0ea5e9;
    border-radius: 50%;
    animation: rotate-continuous 1s linear infinite;
}

/* Article Cards */
.article-card {
    transition: all 0.4s var(--animation-timing);
    opacity: 0;
    transform: translateY(30px);
}

.article-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.article-card:hover .article-image {
    transform: scale(1.1);
}

.article-image {
    transition: transform 0.5s var(--animation-timing);
}

/* Newsletter Form */
.newsletter-form {
    position: relative;
}

.newsletter-input {
    transition: all 0.3s var(--animation-timing);
}

.newsletter-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.newsletter-success {
    animation: scaleIn 0.5s var(--animation-timing);
}

/* Scroll Indicators */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #3b82f6);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.3s var(--animation-timing);
    z-index: 9999;
}

/* Parallax Elements */
.parallax {
    transform: translateZ(0);
    transition: transform 0.1s linear;
}

/* Interactive Hover Effects */
.hover-lift {
    transition: all 0.3s var(--animation-timing);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-glow {
    transition: all 0.3s var(--animation-timing);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.3);
}

/* Stagger Animation Classes */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Mobile Optimizations */
@media (max-width: 768px) {
    .tool-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .btn:hover {
        transform: translateY(-2px);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .parallax {
        transform: none !important;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .particle {
        background: rgba(14, 165, 233, 0.3);
    }
    
    .nav-container.scrolled {
        background: rgba(17, 24, 39, 0.95);
    }
    
    .loading-skeleton {
        background: linear-gradient(90deg, 
            rgba(55, 65, 81, 0.8) 25%, 
            rgba(75, 85, 99, 0.8) 50%, 
            rgba(55, 65, 81, 0.8) 75%);
    }
}

/* Print Styles */
@media print {
    .particle-bg,
    .loading-spinner,
    .scroll-indicator {
        display: none !important;
    }
    
    .tool-card,
    .article-card {
        break-inside: avoid;
        opacity: 1 !important;
        transform: none !important;
    }
}