/* Animation styles for CtrlSketch Pro website */

/* Navbar animations */
header {
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    background: rgba(30, 38, 48, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

header.header-hidden {
    transform: translateY(-100%);
}

/* Button hover animations */
.btn-primary, .btn-cta, .btn-secondary, .btn-resource, .btn-product {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.4s ease;
}

.btn-primary:hover, .btn-cta:hover, .btn-resource:hover, .btn-product:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(232, 76, 136, 0.4);
}

.btn-primary::before, .btn-cta::before, .btn-resource::before, .btn-product::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(247, 164, 29, 0.7), 
        rgba(232, 76, 136, 0.7), 
        rgba(58, 123, 236, 0.7));
    background-size: 200% 200%;
    z-index: -1;
    transition: all 0.4s ease;
    opacity: 0;
}

.btn-primary:hover::before, .btn-cta:hover::before, .btn-resource:hover::before, .btn-product:hover::before {
    opacity: 1;
    animation: gradientMove 2s ease infinite;
}

.btn-secondary {
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--light-text);
}

.btn-secondary:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(58, 123, 236, 0.4);
}

/* Logo animation */
.logo {
    position: relative;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--ctrl-color), var(--pro-color));
    transition: width 0.3s ease;
}

.logo:hover::after {
    width: 100%;
}

/* Navigation hover effects */
.main-nav a {
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--ctrl-color);
    transition: width 0.3s ease;
}

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

/* Card hover animations */
.resource-card, .product-card, .feature-card, .tilt-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.resource-card:hover, .product-card:hover, .feature-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Interactive elements hover effects */
.social-link {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link:hover {
    transform: translateY(-5px) scale(1.1);
    background: var(--ctrl-color);
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--ctrl-color), transparent 70%);
    transform: scale(0);
    opacity: 0;
    transition: all 0.4s ease;
}

.social-link:hover::before {
    transform: scale(2);
    opacity: 0.3;
}

/* Gradient text animation */
.animated-gradient-text {
    background: linear-gradient(
        90deg,
        var(--ctrl-color),
        var(--pro-color),
        var(--accent),
        var(--pro-color),
        var(--ctrl-color)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientMove 5s linear infinite;
}

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

/* Hero section animations */
.hero {
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.2s ease-out;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease-out;
}

/* Parallax effect */
.parallax {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* Section reveal animations */
.reveal-section {
    transition: all 0.8s ease;
}

.reveal-section-hidden {
    opacity: 0;
    transform: translateY(50px);
}

.reveal-section.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for cards */
.staggered-item {
    opacity: 0;
    transform: translateY(30px);
}

.staggered-item.active {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glow effects */
.glow-on-hover {
    position: relative;
    transition: all 0.3s ease;
}

.glow-on-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--ctrl-color), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: inherit;
}

.glow-on-hover:hover::after {
    opacity: 0.4;
}

/* Animated background */
.animated-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.bg-element {
    position: absolute;
    background: linear-gradient(135deg, var(--ctrl-color), var(--pro-color));
    border-radius: 50%;
    opacity: 0.05;
    animation: float linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
    }
}

/* Glitch effect for accent text */
.glitch-text {
    position: relative;
    animation: glitchText 3s infinite;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    left: 0;
    opacity: 0.8;
}

.glitch-text::before {
    animation: glitchText1 2s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    text-shadow: 1px 0 var(--ctrl-color);
    transform: translate(-2px, -2px);
}

.glitch-text::after {
    animation: glitchText2 2s infinite;
    clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
    text-shadow: -1px 0 var(--pro-color);
    transform: translate(2px, 2px);
}

@keyframes glitchText1 {
    0% {
        transform: translate(0);
    }
    10% {
        transform: translate(-2px, -2px);
    }
    20% {
        transform: translate(2px, 2px);
    }
    30% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(2px, -2px);
    }
    50% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    70% {
        transform: translate(0);
    }
    100% {
        transform: translate(0);
    }
}

@keyframes glitchText2 {
    0% {
        transform: translate(0);
    }
    15% {
        transform: translate(2px, 2px);
    }
    25% {
        transform: translate(-2px, -2px);
    }
    35% {
        transform: translate(2px, -2px);
    }
    45% {
        transform: translate(-2px, 2px);
    }
    55% {
        transform: translate(2px, 2px);
    }
    65% {
        transform: translate(-2px, -2px);
    }
    75% {
        transform: translate(0);
    }
    100% {
        transform: translate(0);
    }
}

/* 3D card effect */
.card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-3d-content {
    transition: transform 0.5s ease;
    transform: translateZ(0);
}

.card-3d:hover .card-3d-content {
    transform: translateZ(50px);
}

/* Shimmer effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shimmerEffect 3s infinite;
}

@keyframes shimmerEffect {
    from {
        transform: rotate(30deg) translateX(-100%);
    }
    to {
        transform: rotate(30deg) translateX(100%);
    }
}

/* Loading bar animation */
.loading-bar {
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.loading-bar::before {
    content: '';
    position: absolute;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, var(--ctrl-color), var(--pro-color));
    animation: loadingAnimation 2s infinite ease-in-out;
}

@keyframes loadingAnimation {
    0% {
        left: -50%;
    }
    100% {
        left: 100%;
    }
}

/* Typing cursor animation */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--light-text);
    margin-left: 2px;
    animation: blink 1s infinite;
}

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