/* Custom CSS for Grupo KHAL Landing Page */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse-slow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Apply animations */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade in on scroll */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Navbar scroll effect */
.navbar-scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Custom button hover effects */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
}

.btn-hover-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-hover-effect:hover::before {
    left: 100%;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Timeline custom styles */
.timeline-line {
    background: linear-gradient(to bottom, #4f46e5, #0ea5e9);
}

.timeline-dot {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Product card enhancements */
.product-card {
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover::before {
    opacity: 1;
}

/* Loading animation */
.loading {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.loading.loaded {
    opacity: 1;
}

/* Parallax effect */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* Prevent parallax layout issues - completely disabled */
#home {
    transform: none !important;
}

/* Mobile menu animations */
.mobile-menu-enter {
    transform: translateY(-100%);
    opacity: 0;
}

.mobile-menu-enter-active {
    transform: translateY(0);
    opacity: 1;
    transition: all 0.3s ease;
}

.mobile-menu-exit {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu-exit-active {
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Counter animation */
.counter-animation {
    transition: all 0.3s ease;
}

/* Ripple effect for buttons */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Enhanced focus states for accessibility */
.focus-visible:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dark-mode-support {
        background-color: #1f2937;
        color: #f9fafb;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .high-contrast {
        border: 2px solid #000000;
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-float {
        animation: none;
    }

    .fade-in-on-scroll {
        opacity: 1;
        transform: none;
    }
}

/* Touch device optimizations */
.touch-device .product-card:hover {
    transform: none;
}

.touch-device .stat-card:hover {
    transform: none;
}

.touch-device .btn:hover {
    transform: none;
}

/* Prevent text selection on mobile */
@media (max-width: 768px) {
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    /* Allow text selection for specific elements */
    p,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    span,
    a {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .gradient-text {
        color: black !important;
        -webkit-text-fill-color: black !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3730a3, #0369a1);
}

/* Selection styles */
::selection {
    background: rgba(79, 70, 229, 0.2);
    color: #1e293b;
}

::-moz-selection {
    background: rgba(79, 70, 229, 0.2);
    color: #1e293b;
}

/* Focus ring for better accessibility */
*:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Button states */
.btn:active {
    transform: translateY(1px);
}

/* Enhanced mobile responsiveness */
@media (max-width: 640px) {
    .mobile-optimized {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .mobile-spacing {
        padding: 1rem;
        margin: 0.5rem;
    }

    /* Hero section mobile adjustments */
    .hero-mobile {
        padding: 2rem 1rem;
        min-height: 100vh;
    }

    .hero-mobile h1 {
        font-size: 2.5rem !important;
        line-height: 1.1;
        margin-bottom: 1.5rem;
    }

    .hero-mobile p {
        font-size: 1rem !important;
        margin-bottom: 2rem;
    }

    .hero-stats-mobile {
        gap: 1.5rem !important;
        margin-bottom: 2rem;
    }

    .hero-stat-mobile {
        font-size: 1.5rem !important;
    }

    .hero-cta-mobile {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .hero-cta-mobile a {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }

    /* Navigation mobile improvements */
    .nav-mobile {
        padding: 0 1rem;
    }

    .nav-mobile .logo {
        font-size: 1.5rem;
    }

    .mobile-menu-mobile {
        padding: 1rem;
    }

    .mobile-menu-mobile a {
        padding: 1rem;
        font-size: 1.1rem;
        border-bottom: 1px solid #f3f4f6;
    }

    /* Stats section mobile */
    .stats-mobile {
        padding: 3rem 1rem;
    }

    .stats-mobile h2 {
        font-size: 2rem !important;
        margin-bottom: 1rem;
    }

    .stats-mobile p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .stats-grid-mobile {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .stat-card-mobile {
        padding: 1.5rem;
    }

    .stat-card-mobile .stat-number {
        font-size: 2rem !important;
    }

    /* Timeline mobile */
    .timeline-mobile {
        padding: 3rem 1rem;
    }

    .timeline-mobile h2 {
        font-size: 2rem !important;
    }

    .timeline-line-mobile {
        display: none;
    }

    .timeline-item-mobile {
        flex-direction: column !important;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .timeline-content-mobile {
        width: 100% !important;
        margin: 0 !important;
        padding: 1.5rem;
    }

    .timeline-dot-mobile {
        display: none;
    }

    /* Products mobile */
    .products-mobile {
        padding: 3rem 1rem;
    }

    .products-mobile h2 {
        font-size: 2rem !important;
    }

    .products-grid-mobile {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .product-card-mobile {
        margin: 0;
    }

    .product-header-mobile {
        padding: 1.5rem;
    }

    .product-header-mobile .product-icon {
        font-size: 2.5rem;
    }

    .product-header-mobile h3 {
        font-size: 1.5rem;
    }

    .product-body-mobile {
        padding: 1.5rem;
    }

    .product-features-mobile {
        margin-bottom: 1.5rem;
    }

    .product-features-mobile li {
        margin-bottom: 0.5rem;
    }

    /* Footer mobile */
    .footer-mobile {
        padding: 3rem 1rem 2rem;
    }

    .footer-content-mobile {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .footer-section-mobile h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .footer-section-mobile p,
    .footer-section-mobile a {
        font-size: 0.95rem;
    }

    /* General mobile improvements */
    .container-mobile {
        padding: 0 1rem;
    }

    .section-title-mobile {
        font-size: 2rem !important;
        line-height: 1.2;
    }

    .section-subtitle-mobile {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Button improvements for mobile */
    .btn-mobile {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        border-radius: 0.5rem;
    }

    /* Spacing adjustments */
    .py-mobile {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .mb-mobile {
        margin-bottom: 1.5rem;
    }

    .gap-mobile {
        gap: 1rem;
    }
}

/* Tablet responsiveness */
@media (min-width: 641px) and (max-width: 1024px) {
    .tablet-container {
        padding: 0 2rem;
    }

    .tablet-hero h1 {
        font-size: 3.5rem !important;
    }

    .tablet-hero p {
        font-size: 1.25rem !important;
    }

    .tablet-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem;
    }

    .tablet-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem;
    }

    .tablet-timeline {
        max-width: 100%;
    }

    .tablet-timeline-item {
        flex-direction: column !important;
        gap: 1.5rem;
    }

    .tablet-timeline-content {
        width: 100% !important;
        margin: 0 !important;
    }

    .tablet-timeline-line {
        display: none;
    }

    .tablet-timeline-dot {
        display: none;
    }
}

@media (max-width: 1024px) {
    .timeline-mobile .relative.max-w-4xl {
        max-width: 100%;
    }

    .timeline-mobile .space-y-12 {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .timeline-item-mobile {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.5rem;
        margin-bottom: 2rem;
    }

    .timeline-item-mobile>div {
        width: 100% !important;
        padding: 0 !important;
    }

    .timeline-content-mobile {
        margin: 0 auto !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border-radius: 1rem;
        padding: 1.5rem 1rem;
    }

    .timeline-dot-mobile {
        margin: 1rem auto !important;
        left: 0 !important;
        right: 0 !important;
        position: static !important;
    }

    .timeline-line-mobile {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 3px !important;
        min-height: 100% !important;
        height: 100% !important;
    }
}

@media (max-width: 640px) {
    .timeline-content-mobile {
        padding: 1rem 0.5rem;
        font-size: 0.95rem;
    }

    .timeline-dot-mobile {
        width: 18px !important;
        height: 18px !important;
    }

    .timeline-line-mobile {
        width: 2px !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .small-mobile-hero h1 {
        font-size: 2rem !important;
    }

    .small-mobile-hero p {
        font-size: 0.9rem !important;
    }

    .small-mobile-stats {
        gap: 1rem !important;
    }

    .small-mobile-stat {
        font-size: 1.25rem !important;
    }

    .small-mobile-nav {
        padding: 0 0.75rem;
    }

    .small-mobile-nav .logo {
        font-size: 1.25rem;
    }

    .small-mobile-section {
        padding: 2rem 0.75rem;
    }

    .small-mobile-card {
        padding: 1rem;
    }

    .small-mobile-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .landscape-mobile-hero {
        min-height: 80vh;
        padding: 1rem;
    }

    .landscape-mobile-hero h1 {
        font-size: 2rem !important;
        margin-bottom: 1rem;
    }

    .landscape-mobile-hero p {
        font-size: 0.9rem !important;
        margin-bottom: 1rem;
    }

    .landscape-mobile-stats {
        gap: 1rem !important;
        margin-bottom: 1rem;
    }

    .landscape-mobile-cta {
        gap: 0.5rem;
    }

    .landscape-mobile-cta a {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Performance optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Custom utility classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.backdrop-blur-custom {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Neon glow effect */
.neon-glow {
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.5);
}

.neon-glow:hover {
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.8);
}