/**
 * CuiveMedia Homepage Animation Styles
 * Animated Gradient Background & Visual Effects
 */

/* ========================================
   ANIMATED HERO WITH BACKGROUND IMAGE
   ======================================== */

.hero-section {
    position: relative;
    overflow: hidden;
    /* Hintergrundbild beibehalten */
    background: url('../images/hero-background.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Animiertes Gradient-Overlay über dem Bild */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(-45deg,
        rgba(26, 26, 46, 0.85),
        rgba(22, 33, 62, 0.8),
        rgba(15, 52, 96, 0.75),
        rgba(26, 26, 46, 0.85),
        rgba(45, 19, 44, 0.8),
        rgba(26, 26, 46, 0.85)
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    pointer-events: none;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 100% 50%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Lichteffekte und Akzente */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(204, 51, 0, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(57, 153, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    animation: accentPulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes accentPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Hero content z-index */
.hero-section .container {
    position: relative;
    z-index: 1;
}

/* Hero letter styling */
.hero-letter {
    display: inline-block;
    will-change: transform, opacity;
}

/* ========================================
   SERVICE CARDS ENHANCED STYLES
   ======================================== */

.service-card {
    will-change: transform, box-shadow;
    transition: box-shadow 0.3s ease;
    perspective: 1000px;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #cc3300, #e64a19, #ff6b35);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    border-radius: 8px 8px 0 0;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    will-change: transform;
    transition: color 0.3s ease;
}

.service-card:hover .service-icon {
    color: #cc3300;
}

/* Icon glow effect */
.service-icon i {
    position: relative;
}

.service-card:hover .service-icon i::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(204, 51, 0, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: iconGlow 1.5s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.5;
    }
}

/* ========================================
   STATS COUNTER SECTION
   ======================================== */

.stats-counter {
    position: relative;
    overflow: hidden;
}

.stats-counter::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.counter-item {
    will-change: transform, opacity;
}

.counter-item h2 {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ========================================
   SECTION TITLES
   ======================================== */

.section-title {
    will-change: transform, opacity;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #cc3300, #e64a19);
    border-radius: 2px;
}

/* ========================================
   TESTIMONIALS
   ======================================== */

.testimonial {
    will-change: transform, opacity;
    position: relative;
    overflow: hidden;
}

.testimonial::before {
    content: '\201C';
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 80px;
    font-family: Georgia, serif;
    color: rgba(204, 51, 0, 0.1);
    line-height: 1;
    pointer-events: none;
}

.testimonial:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

/* Star animation */
.testimonial .fa-star,
.testimonial .fa-star-half-alt {
    will-change: transform;
    transition: transform 0.2s ease;
}

.testimonial:hover .fa-star,
.testimonial:hover .fa-star-half-alt {
    animation: starBounce 0.5s ease;
}

@keyframes starBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ========================================
   CTA SECTION
   ======================================== */

.py-5.bg-dark.text-white {
    position: relative;
    overflow: hidden;
}

.py-5.bg-dark.text-white::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(204, 51, 0, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(57, 153, 255, 0.1) 0%, transparent 50%);
    animation: ctaGlow 6s ease-in-out infinite alternate;
}

@keyframes ctaGlow {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.py-5.bg-dark.text-white .container {
    position: relative;
    z-index: 1;
}

/* CTA Button pulse */
.py-5.bg-dark .cta-button {
    position: relative;
    overflow: visible;
}

/* ========================================
   ABOUT SECTION
   ======================================== */

.py-5.bg-light .col-lg-6 {
    will-change: transform, opacity;
}

.py-5.bg-light .d-flex {
    will-change: transform, opacity;
}

.py-5.bg-light .fa-check-circle {
    will-change: transform;
}

/* Image hover effect */
.py-5.bg-light img {
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.py-5.bg-light img:hover {
    transform: scale(1.03) rotate(1deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

/* ========================================
   SMOOTH SCROLL BEHAVIOR
   ======================================== */

html {
    scroll-behavior: smooth;
}

/* ========================================
   BUTTON HOVER EFFECTS
   ======================================== */

.btn-outline-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-outline-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(204, 51, 0, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-outline-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   LOADING ANIMATION (optional)
   ======================================== */

.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loading.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #cc3300;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-section {
        animation: none;
        background: #1a1a2e;
    }
}

/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
    .hero-section::after {
        display: none; /* Disable light beam on mobile for performance */
    }

    @keyframes gradientShift {
        0%, 100% {
            background-position: 0% 50%;
        }
        50% {
            background-position: 100% 50%;
        }
    }
}
