/**
 * NexaFrontiers Visual Enhancements
 * Scroll animations, micro-interactions, and premium effects
 * v1.0.0
 */

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

/* Base state: invisible and slightly offset */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Visible state */
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for grid children */
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }

/* Slide from left */
.animate-slide-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide from right */
.animate-slide-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale up */
.animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   HERO GLOW EFFECT
   ============================================ */
.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.15) 0%, transparent 70%);
    animation: glow-pulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.hero-glow-1 {
    top: -200px;
    right: -100px;
}

.hero-glow-2 {
    bottom: -300px;
    left: -200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    animation-delay: 2s;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Animated gradient background for hero */
.hero-gradient-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(34, 211, 238, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 60%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    animation: gradient-shift 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes gradient-shift {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Grid pattern overlay */
.hero-grid-pattern {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ============================================
   PROFESSIONAL CARD ENHANCEMENTS
   ============================================ */

/* Card glow on hover */
.card-glow {
    position: relative;
    overflow: hidden;
}

.card-glow::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
        rgba(34, 211, 238, 0.06), transparent 40%);
    pointer-events: none;
}

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

/* ============================================
   COUNTER ANIMATION (for stats)
   ============================================ */
.stat-counter {
    display: inline-block;
}

/* ============================================
   BUTTON ENHANCEMENTS
   ============================================ */
.btn-primary {
    position: relative;
    overflow: hidden;
}

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

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

/* ============================================
   SECTION DIVIDERS
   ============================================ */
.section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent, #22d3ee), transparent);
    margin: 0 auto var(--space-xl, 2rem);
    border-radius: 3px;
}

.section-divider.left {
    margin-left: 0;
}

/* ============================================
   TEXT GRADIENT
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, #22d3ee 0%, #10b981 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   BADGE / TAG
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #22d3ee;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ============================================
   HAMBURGER MENU
   ============================================ */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 500;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary, #f8fafc);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu overlay */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    z-index: 400;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav.active {
    display: flex;
    opacity: 1;
}

.mobile-nav a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #f8fafc) !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.mobile-nav a:hover {
    color: var(--accent, #22d3ee) !important;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
}

/* ============================================
   ENHANCED FOOTER
   ============================================ */
.footer-enhanced {
    background: var(--bg-secondary, #1e293b);
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.1));
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-secondary, #94a3b8) !important;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: 1rem;
    max-width: 300px;
}

.footer-column h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary, #f8fafc) !important;
    margin-bottom: 1.2rem;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 0.7rem;
}

.footer-column ul li a {
    color: var(--text-secondary, #94a3b8) !important;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    text-decoration: none !important;
}

.footer-column ul li a:hover {
    color: var(--accent, #22d3ee) !important;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 1.2rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-secondary, #94a3b8) !important;
}

.footer-social a:hover {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.3);
    color: var(--accent, #22d3ee) !important;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.1));
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: var(--text-secondary, #94a3b8) !important;
    font-size: 0.85rem;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-links a {
    color: var(--text-secondary, #94a3b8) !important;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SMOOTH PAGE LOAD
   ============================================ */
body {
    animation: page-fade-in 0.5s ease;
}

@keyframes page-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
