/* Custom styles and overrides */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #0057A0, #5532FF);
  border-radius: 6px;
  border: 2px solid #f8f9fa;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #5532FF, #0057A0);
  border: 2px solid #e9ecef;
}

/* Hero section animations */
.hero-section {
  position: relative;
  overflow: hidden;
}

/* Parallax background */
.parallax-bg {
  will-change: transform;
  transition: transform 0.1s ease-out;
}

/* Floating particles */
.floating-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.6;
  animation: float 6s ease-in-out infinite;
}

.particle-1 {
  top: 20%;
  left: 10%;
  width: 8px;
  height: 8px;
  background: #A0FF33;
  animation-delay: 0s;
  animation-duration: 8s;
}

.particle-2 {
  top: 60%;
  left: 80%;
  width: 12px;
  height: 12px;
  background: #FF6600;
  animation-delay: 2s;
  animation-duration: 10s;
}

.particle-3 {
  top: 30%;
  left: 70%;
  width: 6px;
  height: 6px;
  background: #5532FF;
  animation-delay: 4s;
  animation-duration: 7s;
}

.particle-4 {
  top: 80%;
  left: 20%;
  width: 10px;
  height: 10px;
  background: #0057A0;
  animation-delay: 1s;
  animation-duration: 9s;
}

.particle-5 {
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: #A0FF33;
  animation-delay: 3s;
  animation-duration: 6s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) translateX(0px);
    opacity: 0.6;
  }
  25% {
    transform: translateY(-20px) translateX(10px);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-40px) translateX(-5px);
    opacity: 1;
  }
  75% {
    transform: translateY(-20px) translateX(-10px);
    opacity: 0.8;
  }
}

/* Button styles */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 87, 160, 0.3);
}

.btn-secondary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 102, 0, 0.3);
}

/* Service cards hover effects */
.service-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

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

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

.service-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Project cards with enhanced microinteractions */
.project-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 87, 160, 0.1), rgba(85, 50, 255, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

.project-tag {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.project-tag::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.3s ease;
}

.project-tag:hover::before {
  left: 100%;
}

/* Enhanced hover lift effect */
.hover-lift {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

/* Tooltip styles */
.tooltip {
  position: relative;
  cursor: pointer;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(32, 34, 38, 0.95);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(160, 255, 51, 0.3);
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(32, 34, 38, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* 3D Tilt effect */
.tilt-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
  perspective: 1000px;
}

/* Enhanced geometric shapes */
.geometric-shape {
  animation: float-rotate 6s ease-in-out infinite;
}

@keyframes float-rotate {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(90deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
  75% {
    transform: translateY(-10px) rotate(270deg);
  }
}

/* Project section background enhancement */
.projects-section {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 50%, #E3F2FD 100%);
  position: relative;
}

.projects-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230057A0' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

/* Service icon enhanced hover effects */
.service-icon {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-icon:hover {
  transform: scale(1.2) rotate(5deg);
  filter: drop-shadow(0 8px 16px rgba(0, 87, 160, 0.3));
}

/* Swiper customization */
.proyectos-swiper {
  padding: 20px 0 60px 0;
}

.swiper-button-next,
.swiper-button-prev {
  color: #0057A0 !important;
  background: white;
  border-radius: 50%;
  width: 50px !important;
  height: 50px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: #0057A0;
  color: white !important;
  transform: scale(1.1);
}

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 18px !important;
  font-weight: bold;
}

.swiper-pagination {
  bottom: 10px !important;
}

.swiper-pagination-bullet {
  background: #0057A0 !important;
  opacity: 0.3;
  transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
  opacity: 1;
  transform: scale(1.3);
  background: linear-gradient(45deg, #0057A0, #5532FF) !important;
}

/* Form styling */
#contact-form input,
#contact-form select,
#contact-form textarea {
  transition: all 0.3s ease;
  border: 1px solid #d1d5db;
}

#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
  outline: none;
  border-color: #0057A0;
  box-shadow: 0 0 0 3px rgba(0, 87, 160, 0.1);
  transform: translateY(-1px);
}

/* Mobile menu animation */
#mobile-menu {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mobile-menu-open {
  transform: translateX(0) !important;
}

/* Fade in animation class */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

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

/* Loading animation */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Typography enhancements */
.font-headline {
  font-weight: 600;
  letter-spacing: -0.025em;
}

.font-body {
  font-weight: 400;
  line-height: 1.6;
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(135deg, #0057A0, #5532FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Custom focus styles */
a:focus,
button:focus {
  outline: 2px solid #0057A0;
  outline-offset: 2px;
}

/* Improved accessibility */
@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;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn-primary {
    border: 2px solid currentColor;
  }
  
  .service-card {
    border: 2px solid #000;
  }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
  /* Dark mode styles can be added here */
}

/* Additional responsive utilities */
@media (max-width: 640px) {
  .hero-section h1 {
    font-size: 2.5rem;
    line-height: 1.1;
  }
  
  .hero-section p {
    font-size: 1rem;
  }
  
  .service-card {
    padding: 1.5rem;
  }
  
  .proyectos-swiper {
    padding: 10px 0 40px 0;
  }
  
  /* Mobile navigation improvements */
  #mobile-menu {
    visibility: hidden;
    opacity: 0;
    transform: translateX(-100%) !important;
    transition: all 0.3s ease;
  }
  
  #mobile-menu.mobile-menu-open {
    visibility: visible;
    opacity: 1;
    transform: translateX(0) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  
  /* Ensure mobile menu starts hidden */
  @media (max-width: 767px) {
    #mobile-menu:not(.mobile-menu-open) {
      display: none;
    }
    
    #mobile-menu.mobile-menu-open {
      display: flex;
    }
  }
  
  /* Touch-friendly buttons */
  .btn-primary,
  .btn-secondary {
    min-height: 44px;
    padding: 12px 24px;
  }
}

/* Loading skeleton animations */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

/* Intersection Observer fallback for older browsers */
@supports not (backdrop-filter: blur(10px)) {
  .glass-effect {
    background: rgba(255, 255, 255, 0.9);
  }
  
  .mobile-menu-open {
    background: rgba(32, 34, 38, 0.95);
  }
}

/* Focus states for better accessibility */
.focus-visible {
  outline: 2px solid #0057A0;
  outline-offset: 2px;
}

/* Better form validation styling */
.field-error {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Utility classes */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.backdrop-blur {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

/* Loading spinner */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0057A0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Success/Error states */
.success {
  color: #10b981;
  background-color: #d1fae5;
  border-color: #10b981;
}

.error {
  color: #ef4444;
  background-color: #fee2e2;
  border-color: #ef4444;
}

/* Custom checkbox styling */
input[type="checkbox"] {
  appearance: none;
  background-color: #fff;
  margin: 0;
  font: inherit;
  color: #0057A0;
  width: 1rem;
  height: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  transform: translateY(-0.075em);
  display: grid;
  place-content: center;
}

input[type="checkbox"]::before {
  content: "✓";
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em #0057A0;
  transform-origin: bottom left;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background-color: #0057A0;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:focus {
  outline: 2px solid #0057A0;
  outline-offset: 2px;
}
