/* IA Trading Academy Madrid - Custom Styles */

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

/* Body scroll lock for mobile menu */
body.menu-open {
  overflow: hidden;
}

/* Base font size */
body {
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #4f46e5;
  color: #fff;
  padding: 0.75rem 1.5rem;
  z-index: 100;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  top: 0;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Mobile menu transitions */
#mobile-menu {
  transition: opacity 0.3s ease, visibility 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

#mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

#mobile-menu.hidden {
  display: none;
}

#mobile-menu:not(.hidden) {
  display: flex;
}

/* Nav active link underline */
nav a.active-link {
  color: #4f46e5;
  position: relative;
}

/* Hero gradient animation */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-gradient-animated {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* Card hover lift */
.card-hover:hover {
  transform: translateY(-4px);
}

.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Button press effect */
button:active,
a[role='button']:active {
  transform: scale(0.98);
}

/* Form input styles */
input[type='text'],
input[type='email'],
input[type='tel'],
textarea,
select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type='text']:focus,
input[type='email']:focus,
input[type='tel']:focus,
textarea:focus,
select:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Form validation styles */
input:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

input:valid:not(:placeholder-shown) {
  border-color: #22c55e;
}

/* Cookie banner animation */
#cookie-banner {
  animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Image lazy load fade-in */
img {
  transition: opacity 0.3s ease;
}

img[loading='lazy'] {
  opacity: 0;
}

img[loading='lazy'].loaded {
  opacity: 1;
}

/* Responsive typography adjustments */
@media (max-width: 640px) {
  h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }
}

/* Print styles */
@media print {
  nav,
  #cookie-banner,
  #mobile-menu,
  footer {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
  }
}

/* Selection color */
::selection {
  background-color: #4f46e5;
  color: #fff;
}

/* Reduced motion */
@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;
  }
}
