/* ========================================
   KARAPETYAN & KHAYAT - ANIMATIONS
   ======================================== */

/* ========================================
   Scroll Reveal Animations
   ======================================== */

/* Base state for animated elements */
[data-animate] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].animated {
    opacity: 1;
    transform: none;
}

/* Fade In */
[data-animate="fade-in"] {
    opacity: 0;
}

[data-animate="fade-in"].animated {
    opacity: 1;
}

/* Fade In Up */
[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
}

[data-animate="fade-up"].animated {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Down */
[data-animate="fade-down"] {
    opacity: 0;
    transform: translateY(-30px);
}

[data-animate="fade-down"].animated {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Left */
[data-animate="fade-left"] {
    opacity: 0;
    transform: translateX(-30px);
}

[data-animate="fade-left"].animated {
    opacity: 1;
    transform: translateX(0);
}

/* Fade In Right */
[data-animate="fade-right"] {
    opacity: 0;
    transform: translateX(30px);
}

[data-animate="fade-right"].animated {
    opacity: 1;
    transform: translateX(0);
}

/* Scale In */
[data-animate="scale-in"] {
    opacity: 0;
    transform: scale(0.9);
}

[data-animate="scale-in"].animated {
    opacity: 1;
    transform: scale(1);
}

/* Animation Delays */
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="500"] { transition-delay: 0.5s; }
[data-delay="600"] { transition-delay: 0.6s; }
[data-delay="700"] { transition-delay: 0.7s; }
[data-delay="800"] { transition-delay: 0.8s; }

/* ========================================
   Hover Animations
   ======================================== */

/* Button Shine Effect */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::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.5s ease;
}

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

/* Card Hover Glow */
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
    box-shadow: 0 0 30px rgba(201, 162, 39, 0.2);
}

.card:hover::after {
    opacity: 1;
}

/* Service Icon Rotation */
.service-icon {
    transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.service-card:hover .service-icon {
    transform: rotateY(180deg);
    border-color: var(--color-secondary-light);
}

/* Team Image Hover */
.team-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 50%, rgba(201, 162, 39, 0.3) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.team-card:hover .team-image::after {
    opacity: 1;
}

/* Link Underline Animation */
.animated-link {
    position: relative;
    display: inline-block;
}

.animated-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-secondary);
    transition: width var(--transition-normal);
}

.animated-link:hover::after {
    width: 100%;
}

/* ========================================
   Loading Animations
   ======================================== */

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(201, 162, 39, 0.2);
    border-top-color: var(--color-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

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

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   Hero Animations
   ======================================== */

/* Hero Content Entry */
.hero-content {
    animation: heroFadeIn 1s ease forwards;
}

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

/* Hero Subtitle */
.hero-subtitle {
    animation: heroSubtitle 1s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

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

/* Hero Title */
.hero h1 {
    animation: heroTitle 1s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

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

/* Hero Description */
.hero-description {
    animation: heroDesc 1s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

@keyframes heroDesc {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hero Buttons */
.hero .btn-group {
    animation: heroButtons 1s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

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

/* ========================================
   Testimonial Slider Animations
   ======================================== */

.testimonials-slider {
    position: relative;
}

.testimonial-slide {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.testimonial-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

/* ========================================
   Gold Line Animation
   ======================================== */

.gold-line {
    position: relative;
    overflow: hidden;
}

.gold-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: goldLineShine 3s ease-in-out infinite;
}

@keyframes goldLineShine {
    0%, 100% {
        left: -100%;
    }
    50% {
        left: 200%;
    }
}

/* ========================================
   Number Counter Animation
   ======================================== */

.counter {
    display: inline-block;
}

.counter.counting {
    animation: countPulse 0.3s ease;
}

@keyframes countPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ========================================
   Form Focus Animations
   ======================================== */

.form-input,
.form-textarea,
.form-select {
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    transform: translateY(-2px);
}

/* ========================================
   Success/Error State Animations
   ======================================== */

.form-success {
    animation: successFade 0.5s ease;
}

@keyframes successFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* ========================================
   Cookie Banner Animation
   ======================================== */

.cookie-banner {
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ========================================
   Page Transition
   ======================================== */

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-transition.active {
    opacity: 1;
}

/* ========================================
   Scroll Progress Indicator
   ======================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-secondary-light));
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ========================================
   Floating Elements
   ======================================== */

.float {
    animation: float 3s ease-in-out infinite;
}

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

/* ========================================
   Stagger Children Animation
   ======================================== */

.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.animated > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.animated > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.animated > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.animated > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.animated > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.animated > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-children.animated > * {
    opacity: 1;
    transform: translateY(0);
}
