/* =================================================================
   LEAP TECHNOLOGY - WEBSITE STYLES
   Custom animations and effects to complement Tailwind CSS
   ================================================================= */

:root {
    --primary-color: #11999e;
    --primary-color-dark: #0f8084;
}

/* =================================================================
   HERO SECTION STYLES
   ================================================================= */

/* Hero Background */
.hero-bg {
    background: linear-gradient(135deg, #0a0f1c 0%, #1a1f3a 25%, #2a2f4a 50%, #1a1f3a 75%, #0a0f1c 100%);
    position: relative;
    will-change: auto;
}

/* Animated Network Background */
.network-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(17, 153, 158, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(15, 128, 132, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(20, 163, 168, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 60% 30%, rgba(17, 153, 158, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 10% 80%, rgba(15, 128, 132, 0.1) 0%, transparent 35%),
        radial-gradient(circle at 90% 70%, rgba(20, 163, 168, 0.1) 0%, transparent 45%),
        radial-gradient(circle at 30% 10%, rgba(17, 153, 158, 0.08) 0%, transparent 25%);
    animation: networkPulse 6s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes networkPulse {
    0%, 100% { opacity: 0.4; transform: scale(1) rotate(0deg); }
    25% { opacity: 0.7; transform: scale(1.03) rotate(1deg); }
    50% { opacity: 0.9; transform: scale(1.08) rotate(0deg); }
    75% { opacity: 0.6; transform: scale(1.02) rotate(-1deg); }
}

/* =================================================================
   PARTICLE ANIMATION SYSTEM
   ================================================================= */

/* Particle Container */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Base Particle Styles */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Cyan/Green particles */
.particle:nth-child(1) {
    width: 6px;
    height: 6px;
    top: 15%;
    left: 8%;
    background: rgba(17, 153, 158, 0.3);
    animation: float1 5s ease-in-out infinite;
}

.particle:nth-child(2) {
    width: 8px;
    height: 8px;
    top: 65%;
    left: 15%;
    background: rgba(17, 153, 158, 0.25);
    animation: float2 7s ease-in-out infinite 1s;
}

.particle:nth-child(3) {
    width: 4px;
    height: 4px;
    top: 35%;
    left: 85%;
    background: rgba(15, 128, 132, 0.3);
    animation: float3 6s ease-in-out infinite 2s;
}

.particle:nth-child(4) {
    width: 7px;
    height: 7px;
    top: 85%;
    left: 75%;
    background: rgba(20, 163, 168, 0.25);
    animation: float1 8s ease-in-out infinite 3s;
}

.particle:nth-child(5) {
    width: 5px;
    height: 5px;
    top: 25%;
    left: 55%;
    background: rgba(17, 153, 158, 0.3);
    animation: float2 6s ease-in-out infinite 4s;
}

.particle:nth-child(6) {
    width: 9px;
    height: 9px;
    top: 75%;
    left: 35%;
    background: rgba(15, 128, 132, 0.2);
    animation: float3 7s ease-in-out infinite 5s;
}

/* Additional particles for more dynamics */
.particle:nth-child(7) {
    width: 3px;
    height: 3px;
    top: 45%;
    left: 25%;
    background: rgba(20, 163, 168, 0.3);
    animation: float1 9s ease-in-out infinite 1.5s;
}

.particle:nth-child(8) {
    width: 6px;
    height: 6px;
    top: 55%;
    left: 90%;
    background: rgba(17, 153, 158, 0.2);
    animation: float2 5s ease-in-out infinite 2.5s;
}

.particle:nth-child(9) {
    width: 4px;
    height: 4px;
    top: 10%;
    left: 45%;
    background: rgba(15, 128, 132, 0.3);
    animation: float3 8s ease-in-out infinite 3.5s;
}

.particle:nth-child(10) {
    width: 8px;
    height: 8px;
    top: 90%;
    left: 60%;
    background: rgba(20, 163, 168, 0.25);
    animation: float1 6s ease-in-out infinite 4.5s;
}

.particle:nth-child(11) {
    width: 5px;
    height: 5px;
    top: 20%;
    left: 70%;
    background: rgba(17, 153, 158, 0.25);
    animation: float2 7s ease-in-out infinite 0.5s;
}

.particle:nth-child(12) {
    width: 7px;
    height: 7px;
    top: 80%;
    left: 20%;
    background: rgba(6, 182, 212, 0.6);
    animation: float3 9s ease-in-out infinite 1.2s;
}

@keyframes float1 {
    0%, 100% { transform: translateY(0px) translateX(0px); opacity: 0.3; }
    25% { transform: translateY(-30px) translateX(15px); opacity: 0.9; }
    50% { transform: translateY(-15px) translateX(-8px); opacity: 0.6; }
    75% { transform: translateY(-45px) translateX(25px); opacity: 1; }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); opacity: 0.2; }
    33% { transform: translateY(-25px) translateX(-15px) rotate(120deg); opacity: 0.8; }
    66% { transform: translateY(-40px) translateX(30px) rotate(240deg); opacity: 1; }
}

@keyframes float3 {
    0%, 100% { transform: translateY(0px) translateX(0px) scale(1); opacity: 0.4; }
    50% { transform: translateY(-50px) translateX(-25px) scale(1.3); opacity: 1; }
}

/* Tech Grid Pattern Overlay */
.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(17, 153, 158, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 153, 158, 0.06) 1px, transparent 1px),
        linear-gradient(45deg, rgba(15, 128, 132, 0.03) 1px, transparent 1px),
        linear-gradient(-45deg, rgba(20, 163, 168, 0.03) 1px, transparent 1px);
    background-size: 40px 40px, 40px 40px, 60px 60px, 60px 60px;
    animation: gridMove 15s linear infinite;
    opacity: 0.6;
    will-change: transform;
}

@keyframes gridMove {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(20px, 20px) rotate(0.5deg); }
    100% { transform: translate(40px, 40px) rotate(0deg); }
}

/* =================================================================
   ENHANCED PARTICLE EFFECTS
   ================================================================= */

/* Enhanced Particles with Glow Effects */
.particle {
    box-shadow: 0 0 8px currentColor;
}

.particle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, currentColor 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0.3;
    animation: particleGlow 3s ease-in-out infinite alternate;
}

@keyframes particleGlow {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.2; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.4; }
}

/* Mouse Interaction Effect */
.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(17, 153, 158, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    opacity: 0;
    will-change: transform, opacity;
}

.hero-bg:hover::after {
    opacity: 1;
}

/* =================================================================
   MORPHING SVG ELEMENTS
   ================================================================= */

.morphing-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}


/* Enhanced Animation Timing */
.particle:nth-child(odd) {
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.particle:nth-child(even) {
    animation-timing-function: cubic-bezier(0.55, 0.06, 0.68, 0.19);
}

/* Performance Optimizations */
@media (prefers-reduced-motion: no-preference) {
    .morphing-elements svg {
        will-change: transform;
    }
}

/* =================================================================
   GENERAL ANIMATIONS & KEYFRAMES
   ================================================================= */

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

@keyframes glow {
    from { box-shadow: 0 0 20px -10px var(--primary-color); }
    to { box-shadow: 0 0 30px -5px var(--primary-color); }
}

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

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

/* =================================================================
   NAVIGATION COMPONENTS
   ================================================================= */

/* Hamburger Menu Animation */
.hamburger-line {
    left: 50%;
    transform: translateX(-50%);
}

.hamburger-line:nth-child(1) {
    top: 50%;
    transform: translateX(-50%) translateY(-6px);
}

.hamburger-line:nth-child(2) {
    top: 50%;
    transform: translateX(-50%) translateY(-1px);
}

.hamburger-line:nth-child(3) {
    top: 50%;
    transform: translateX(-50%) translateY(4px);
}

/* Improved hamburger to X animation */
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 48px;
    margin: 0;
    padding: 0;
    position: relative;
}

.hamburger-container {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =================================================================
   GLOBAL UI ENHANCEMENTS
   ================================================================= */

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--primary-color-dark));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0d7a7f, #0a6b70);
}

/* Focus Management */
*:focus {
    outline: none;
}

/* Glass Morphism Effects */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Text Selection */
::selection {
    background: rgba(17, 153, 158, 0.2);
    color: #1e293b;
}

/* =================================================================
   ACCESSIBILITY & PERFORMANCE
   ================================================================= */

/* 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;
        scroll-behavior: auto !important;
    }
    
    .services-track {
        animation: none !important;
    }
    
    .particle,
    .network-animation,
    .morphing-elements svg {
        animation: none !important;
        opacity: 0.3 !important;
    }
}

/* =================================================================
   SERVICES SECTION
   ================================================================= */

/* Interactive Services Grid */
.services-grid-container {
    position: relative;
}

.service-card {
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.service-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.service-card:nth-child(1) {
    animation-delay: 100ms;
}

.service-card:nth-child(2) {
    animation-delay: 200ms;
}

.service-card:nth-child(3) {
    animation-delay: 300ms;
}

.service-card:nth-child(4) {
    animation-delay: 400ms;
}

.service-card:nth-child(5) {
    animation-delay: 500ms;
}

.service-card:nth-child(6) {
    animation-delay: 600ms;
}

/* Service card entrance animation */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card {
    animation: cardFadeIn 0.6s ease-out forwards;
    opacity: 0;
}

/* Floating animation for service cards */
.service-card:hover {
    animation: serviceFloat 2s ease-in-out infinite;
}

@keyframes serviceFloat {
    0%, 100% { transform: translateY(-8px) scale(1.02); }
    50% { transform: translateY(-12px) scale(1.02); }
}

/* Enhanced hover effects */
.service-card:hover .relative {
    transform: scale(1.02);
}

/* Staggered grid animation on load */
.services-grid-container .grid {
    animation: gridFadeIn 0.8s ease-out;
}

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

/* =================================================================
   ROTATING SERVICES ANIMATION
   ================================================================= */

/* Container with Fade Edges */
.rotating-services-container {
    mask: linear-gradient(90deg, transparent, white 10%, white 90%, transparent);
    -webkit-mask: linear-gradient(90deg, transparent, white 10%, white 90%, transparent);
    padding: 12px 0;
}

.services-track {
    width: max-content;
    animation: scrollServices 30s linear infinite;
}

.service-square {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    transform-style: preserve-3d;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.service-square:hover {
    transform: scale(1.02);
}

.service-content {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    padding: 20px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    align-items: center;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.premium-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(255, 255, 255, 0.06) 50%, 
        rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px) saturate(180%);
    color: #ffffff;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(17, 153, 158, 0.05) 0%, 
        rgba(15, 128, 132, 0.03) 50%, 
        rgba(17, 153, 158, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.premium-card:hover::before {
    opacity: 1;
}

.premium-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent);
    transition: left 0.6s ease;
}

.premium-card:hover::after {
    left: 100%;
}

.premium-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.12),
        0 6px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    border-color: rgba(17, 153, 158, 0.2);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.08) 50%, 
        rgba(255, 255, 255, 0.06) 100%);
}

.service-icon {
    padding: 14px;
    background: linear-gradient(135deg, 
        rgba(17, 153, 158, 0.08) 0%, 
        rgba(15, 128, 132, 0.08) 100%);
    border: 1px solid rgba(17, 153, 158, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    justify-self: center;
    align-self: center;
}

.premium-card:hover .service-icon {
    background: linear-gradient(135deg, 
        rgba(17, 153, 158, 0.1) 0%, 
        rgba(15, 128, 132, 0.1) 100%);
    border-color: rgba(17, 153, 158, 0.2);
    transform: scale(1.05);
}

.service-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    align-self: center;
    justify-self: center;
}

.service-description {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.4;
    align-self: center;
    justify-self: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@keyframes scrollServices {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-180px * 6 - 32px * 6));
    }
}

/* Pause animation on hover */
.rotating-services-container:hover .services-track {
    animation-play-state: paused;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .service-square {
        width: 160px;
        height: 160px;
    }
    
    .service-content {
        padding: 18px;
        gap: 10px;
    }
    
    .service-title {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .service-description {
        font-size: 11px;
        line-height: 1.3;
        -webkit-line-clamp: 3;
    }
    
    @keyframes scrollServices {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-160px * 6 - 32px * 6));
        }
    }
}


/* Connecting lines animation */
.connecting-lines line {
    stroke-dasharray: 5, 5;
    animation: dashMove 2s linear infinite;
}

@keyframes dashMove {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 10; }
}

/* Hexagon background pattern animation */
#hexPattern polygon {
    animation: hexPulse 4s ease-in-out infinite;
}

@keyframes hexPulse {
    0%, 100% { stroke-opacity: 0.1; }
    50% { stroke-opacity: 0.2; }
}

/* =================================================================
   SCROLL TO TOP BUTTON
   ================================================================= */

#scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =================================================================
   SPECIAL COMPONENTS
   ================================================================= */

/* Local Perth Badge */
.local-stamp {
    position: absolute;
    bottom: 40px;
    right: 40px;
    z-index: 15;
}

.stamp-content {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.12) 0%, 
        rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stamp-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(17, 153, 158, 0.03) 0%, 
        rgba(15, 128, 132, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stamp-content:hover::before {
    opacity: 1;
}

.stamp-icon {
    flex-shrink: 0;
    padding: 4px;
    background: linear-gradient(135deg, 
        rgba(17, 153, 158, 0.1) 0%, 
        rgba(15, 128, 132, 0.1) 100%);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.stamp-text {
    font-weight: 600;
    line-height: 1.2;
}

.stamp-main {
    font-size: 11px;
    letter-spacing: 0.3px;
    opacity: 0.9;
}

.stamp-sub {
    font-size: 10px;
    opacity: 0.7;
    letter-spacing: 0.2px;
}

/* Subtle hover effect */
.stamp-content:hover {
    transform: translateY(-2px);
    border-color: rgba(17, 153, 158, 0.25);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Mobile positioning */
@media (max-width: 768px) {
    .local-stamp {
        bottom: 30px;
        right: 20px;
    }
    
    .stamp-content {
        padding: 6px 10px;
        gap: 4px;
    }
    
    .stamp-main {
        font-size: 10px;
    }
    
    .stamp-sub {
        font-size: 9px;
    }
}

/* =================================================================
   FORM STYLES
   ================================================================= */

/* Form input focus animation */
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(17, 153, 158, 0.2);
    border-color: var(--primary-color) !important;
}

/* Custom select arrow */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25em;
    padding-right: 2.5rem;
}

/* Form submission button animation */
button[type="submit"] {
    position: relative;
    overflow: hidden;
}

button[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease, opacity 0.5s ease;
}

button[type="submit"]:active::after {
    transform: translate(-50%, -50%) scale(100);
    opacity: 0;
}
