/**
 * IT-CAFFE v3.0 - Modern Effects
 * Animated backgrounds, particles, glassmorphism
 */

/* ========================================
   ANIMATED GRADIENT BACKGROUND
   ======================================== */
.hero {
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(141, 198, 63, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(141, 198, 63, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 60%, rgba(111, 179, 45, 0.08) 0%, transparent 40%),
        var(--color-bg);
    background-size: 200% 200%, 200% 200%, 150% 150%, 100% 100%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%, 100% 50%, 50% 50%, 0% 0%; }
    25% { background-position: 50% 0%, 50% 100%, 0% 50%, 0% 0%; }
    50% { background-position: 100% 50%, 0% 50%, 50% 0%, 0% 0%; }
    75% { background-position: 50% 100%, 50% 0%, 100% 50%, 0% 0%; }
}

/* ========================================
   FLOATING PARTICLES
   ======================================== */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 25s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 20s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 28s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 22s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 24s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 26s; }
.particle:nth-child(7) { left: 70%; animation-delay: 0.5s; animation-duration: 21s; }
.particle:nth-child(8) { left: 80%; animation-delay: 2.5s; animation-duration: 23s; }
.particle:nth-child(9) { left: 90%; animation-delay: 4.5s; animation-duration: 27s; }
.particle:nth-child(10) { left: 15%; animation-delay: 1.5s; animation-duration: 19s; }
.particle:nth-child(11) { left: 25%; animation-delay: 3.5s; animation-duration: 29s; }
.particle:nth-child(12) { left: 35%; animation-delay: 0.2s; animation-duration: 18s; }
.particle:nth-child(13) { left: 45%; animation-delay: 2.2s; animation-duration: 30s; }
.particle:nth-child(14) { left: 55%; animation-delay: 4.2s; animation-duration: 17s; }
.particle:nth-child(15) { left: 65%; animation-delay: 1.2s; animation-duration: 31s; }
.particle:nth-child(16) { left: 75%; animation-delay: 3.2s; animation-duration: 16s; }
.particle:nth-child(17) { left: 85%; animation-delay: 5.2s; animation-duration: 32s; }
.particle:nth-child(18) { left: 5%; animation-delay: 0.7s; animation-duration: 15s; }
.particle:nth-child(19) { left: 95%; animation-delay: 2.7s; animation-duration: 33s; }
.particle:nth-child(20) { left: 50%; animation-delay: 4.7s; animation-duration: 14s; }

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 0.6;
        transform: translateY(10vh) scale(1);
    }
    100% {
        transform: translateY(-10vh) scale(0);
        opacity: 0;
    }
}

/* ========================================
   GLASSMORPHISM EFFECTS
   ======================================== */
.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card {
    background: rgba(22, 22, 31, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(141, 198, 63, 0.1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(141, 198, 63, 0.1), transparent);
    transition: left 0.5s ease;
}

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

.card:hover {
    border-color: rgba(141, 198, 63, 0.3);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(141, 198, 63, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ========================================
   GLOW EFFECTS
   ======================================== */
.btn-primary {
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 15px rgba(141, 198, 63, 0.3),
        0 0 30px rgba(141, 198, 63, 0.1);
}

.btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

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

.btn-primary:hover {
    box-shadow: 
        0 6px 25px rgba(141, 198, 63, 0.5),
        0 0 50px rgba(141, 198, 63, 0.3);
    transform: translateY(-3px) scale(1.02);
}

/* ========================================
   HERO ENHANCEMENTS
   ======================================== */
.hero-badge {
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(141, 198, 63, 0.2);
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(141, 198, 63, 0.2);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(141, 198, 63, 0.4);
        transform: scale(1.02);
    }
}

.hero-title .accent {
    position: relative;
    display: inline-block;
}

.hero-title .accent::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: 2px;
    animation: underlineGrow 1s ease-out 0.5s both;
}

@keyframes underlineGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.hero-stat {
    padding: var(--space-4);
    background: rgba(141, 198, 63, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(141, 198, 63, 0.1);
    transition: all 0.3s ease;
}

.hero-stat:hover {
    background: rgba(141, 198, 63, 0.1);
    border-color: rgba(141, 198, 63, 0.3);
    transform: translateY(-5px);
}

/* ========================================
   SECTION DECORATIONS
   ======================================== */
.section-title {
    position: relative;
    display: inline-block;
}

.section-header .section-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: 2px;
}

/* ========================================
   CARD ICONS ANIMATION
   ======================================== */
.card-icon {
    position: relative;
    transition: all 0.4s ease;
}

.card-icon::before {
    content: "";
    position: absolute;
    inset: -5px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.3s ease;
}

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

.card:hover .card-icon::before {
    opacity: 0.5;
}

/* ========================================
   TECH GRID ANIMATIONS
   ======================================== */
.tech-item {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tech-item:hover {
    transform: translateY(-10px) scale(1.05);
    background: rgba(141, 198, 63, 0.1);
    border-color: rgba(141, 198, 63, 0.3);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.tech-item:hover i {
    color: var(--color-primary);
    transform: scale(1.2);
    transition: all 0.3s ease;
}

/* ========================================
   CTA SECTION EFFECTS
   ======================================== */
.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 50%, rgba(141, 198, 63, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 70% 50%, rgba(141, 198, 63, 0.1) 0%, transparent 30%);
    animation: ctaGlow 10s ease-in-out infinite alternate;
}

@keyframes ctaGlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-10%, -10%); }
}

/* ========================================
   SCROLL INDICATOR
   ======================================== */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    animation: bounce 2s ease-in-out infinite;
}

.scroll-indicator .mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--color-primary);
    border-radius: 13px;
    position: relative;
}

.scroll-indicator .mouse::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 2px;
    animation: scrollWheel 1.5s ease-in-out infinite;
}

@keyframes scrollWheel {
    0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.5; transform: translateX(-50%) translateY(10px); }
}

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

/* ========================================
   LOGO ANIMATION
   ======================================== */
.logo-img {
    animation: logoFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(141, 198, 63, 0.3));
}

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

.logo:hover .logo-img {
    animation: logoSpin 0.6s ease;
}

@keyframes logoSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   FOOTER ENHANCEMENTS
   ======================================== */
.footer {
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

.footer-links a {
    position: relative;
    display: inline-block;
}

.footer-links a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

/* ========================================
   CURSOR GLOW EFFECT
   ======================================== */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(141, 198, 63, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    mix-blend-mode: screen;
}

/* ========================================
   ANIMATED GRID BACKGROUND
   ======================================== */
.hero-grid {
    background-image: 
        linear-gradient(rgba(141, 198, 63, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(141, 198, 63, 0.05) 1px, transparent 1px);
    background-size: clamp(40px, 5vw, 80px) clamp(40px, 5vw, 80px);
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    animation: gridPulse 4s ease-in-out infinite;
}

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

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
    .scroll-indicator {
        display: none;
    }
    
    .particle {
        width: 3px;
        height: 3px;
    }
    
    .cursor-glow {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   CERTIFICATE CARDS (inline fallback)
   ======================================== */
.certificate-card,
.product-card {
    background: rgba(22, 22, 31, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(141, 198, 63, 0.15);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.certificate-card:hover,
.product-card:hover {
    transform: translateY(-8px);
    border-color: rgba(141, 198, 63, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 60px rgba(141, 198, 63, 0.1);
}

/* Logo img ensure visible */
.logo-img {
    width: clamp(36px, 3vw, 48px);
    height: auto;
    display: block;
}

.footer-logo .logo-img {
    width: 40px;
}

/* Enhanced Product Cards Visibility */
.products-grid .product-card {
    min-height: 420px;
    background: rgba(30, 30, 40, 0.95) !important;
    border: 1px solid rgba(141, 198, 63, 0.2) !important;
}

.products-grid .product-card .product-image {
    background: linear-gradient(135deg, #1a1a2e 0%, #16161f 100%) !important;
}

.products-grid .product-card .product-image-placeholder {
    color: var(--color-primary);
    opacity: 0.5 !important;
}

.products-grid .product-card .product-content {
    background: rgba(22, 22, 31, 0.98);
}
