/* Custom CSS for PEMA Agency Website - Optimized */

/* Font Family */
.font-grotesk {
    font-family: 'Space Grotesk', sans-serif;
}

/* Background Grid Pattern */
.bg-grid-pattern {
    background-image: 
        linear-gradient(to right, rgba(99, 102, 241, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Smooth Scrolling - only applied when not using reduced motion */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Essential Animations - reduced for better performance */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Blob animations - simplified */
@keyframes blob {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.animate-blob {
    animation: blob 7s ease-in-out infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Aspect ratio for Google Maps */
.aspect-w-16 {
    position: relative;
    padding-bottom: calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%);
    --tw-aspect-w: 16;
}

.aspect-h-7 {
    --tw-aspect-h: 7;
}

.aspect-w-16 > * {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* Hover effects - optimized */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Button hover effects - simplified */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Focus styles */
input:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Custom scrollbar - only for non-mobile */
@media (min-width: 768px) {
    ::-webkit-scrollbar {
        width: 8px;
    }

    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    ::-webkit-scrollbar-thumb {
        background: #c7d2fe;
        border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #6366f1;
    }
}

/* Mobile menu animation */
@keyframes slideDown {
    from { max-height: 0; opacity: 0; }
    to { max-height: 300px; opacity: 1; }
}

.mobile-menu-open {
    display: block !important;
    animation: slideDown 0.25s ease-out forwards;
}

/* Image hover effects - simplified */
.img-hover-zoom {
    overflow: hidden;
    border-radius: 0.5rem;
}

.img-hover-zoom img {
    transition: transform 0.4s ease;
}

.img-hover-zoom:hover img {
    transform: scale(1.05);
}

/* Service card styling */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Navigation active link indicator */
.nav-link.active {
    color: #6366f1;
    position: relative;
}

.nav-link.active:after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #6366f1;
    border-radius: 2px;
}

/* Text gradient effect */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(90deg, #6366f1, #a855f7);
}

/* Pulse animation - simplified */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

/* Form input animation */
.form-input-animation:focus {
    transform: translateY(-2px);
}

/* Fade in on scroll - using CSS only for better performance */
.fade-in-on-scroll {
    /* Default state is now visible */
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Only new elements that come into view during scrolling will animate */
.fade-in-on-scroll:not(.visible) {
    opacity: 0;
    transform: translateY(20px);
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Custom focus styles for form elements */
input:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Backdrop blur animations */
.backdrop-blur-transition {
    transition: backdrop-filter 0.3s ease;
}

.backdrop-blur-transition:hover {
    backdrop-filter: blur(8px);
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

/* Mobile menu animation */
@keyframes slideDown {
    from { max-height: 0; opacity: 0; }
    to { max-height: 500px; opacity: 1; }
}

.mobile-menu-open {
    display: block !important;
    animation: slideDown 0.3s ease-out forwards;
}

/* Image hover effects */
.img-hover-zoom {
    overflow: hidden;
    border-radius: 1rem;
}

.img-hover-zoom img {
    transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
    transform: scale(1.05);
}

/* Section transitions */
.section-transition {
    transition: all 0.5s ease;
}

/* Custom cards styling */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Header active link indicator */
.nav-link.active {
    color: #6366f1;
    position: relative;
}

.nav-link.active:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #6366f1;
    border-radius: 2px;
}

/* Text gradient effect */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(90deg, #6366f1, #a855f7);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Glowing effect */
.glow {
    transition: all 0.3s ease;
}

.glow:hover {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

/* Rotate animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-rotate {
    animation: rotate 10s linear infinite;
}

/* Number counter animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-count-up {
    animation: countUp 1s ease-out forwards;
}

/* Image overlay effect */
.image-overlay {
    position: relative;
    overflow: hidden;
}

.image-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-overlay:hover::after {
    opacity: 1;
}

/* Tailwind class extensions */
.from-indigo-600.to-purple-600 {
    background-image: linear-gradient(to right, #4f46e5, #9333ea);
}

/* Custom transitions */
.transition-all-ease {
    transition: all 0.3s ease;
}

/* Scale on hover */
.scale-on-hover {
    transition: transform 0.3s ease;
}

.scale-on-hover:hover {
    transform: scale(1.05);
}

/* Custom box shadows */
.custom-shadow {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

.custom-shadow-lg {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Background effects */
.bg-noise {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.05;
}

/* Fade in on scroll */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Partners Slider - Horizontal Scroll */
.partners-slider {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.partners-track {
  display: flex;
  animation: slideHorizontal 25s linear infinite;
  animation-play-state: running;
  width: max-content;
}

.partners-track:hover {
  animation-play-state: paused;
}

.partners-slide {
  display: flex;
  min-width: max-content;
}

@keyframes slideHorizontal {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
} 