/* ========================================
   FrameWeb - Custom Styles
   ======================================== */

/* Base Styles */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

html {
  scrollbar-color: #2563eb #ffffff;
}

/* ========================================
   Animations
   ======================================== */

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Fade in up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Scale animation for hover effects */
@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.scale-in {
  animation: scaleIn 0.3s ease-out forwards;
}

/* ========================================
   Utility Classes
   ======================================== */

/* Hide scrollbar but keep functionality */
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Text gradient effect */
.text-gradient {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   Component Styles
   ======================================== */

/* Navbar shadow on scroll */
.navbar-scrolled {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Form input focus styles */
input:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Button hover effects */
.btn-primary {
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

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

.card-hover:hover {
  transform: translateY(-4px);
}

/* ========================================
   Responsive Adjustments
   ======================================== */

/* Marker Underline Effect */
.marker-underline {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.marker-underline::after {
  content: '';
  position: absolute;
  left: -2px;
  bottom: 2px;
  width: 0;
  height: 14px;
  background-color: rgba(37, 99, 235, 0.15); /* Slightly Adjusted Color */
  z-index: -1;
  transform: rotate(-0.5deg);
  transition: width 1s cubic-bezier(0.65, 0, 0.35, 1) 0.5s; /* Delay added here */
  pointer-events: none;
}

.marker-underline.aos-animate::after {
  width: calc(100% + 8px);
}

@media (max-width: 768px) {
  .marker-underline::after {
    height: 8px;
    bottom: 3px;
  }
}

/* ========================================
   Typing Effect Styles
   ======================================== */
#typing-text::after {
  content: '|';
  animation: blink 0.7s infinite;
  color: #2563eb;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  nav,
  footer,
  .no-print {
    display: none !important;
  }

  body {
    font-size: 12pt;
  }

  a {
    text-decoration: none;
    color: inherit;
  }
}

/* ========================================
   Notifications (Toasts)
   ======================================== */

/* Contenedor de Toasts */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

/* Base del Toast */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
  max-width: 420px;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

/* Iconos y Colores */
.toast-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon.success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.toast-icon.error { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; }
.toast-icon.warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }

.toast-content { flex: 1; padding-top: 2px; }
.toast-title { font-weight: 700; font-size: 1rem; color: #111827; margin-bottom: 4px; }
.toast-message { font-size: 0.875rem; color: #6b7280; line-height: 1.5; }

/* Botón Cerrar */
.toast-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.toast-close:hover { background: #f3f4f6; color: #374151; }

/* Barra de Progreso */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  animation: toastProgress linear forwards;
}

.toast-progress.success { background: linear-gradient(90deg, #10b981, #059669); }
.toast-progress.error { background: linear-gradient(90deg, #ef4444, #dc2626); }
.toast-progress.warning { background: linear-gradient(90deg, #f59e0b, #d97706); }

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* Responsive (Móvil) */
@media (max-width: 640px) {
  .toast-container {
    top: auto;
    bottom: 24px;
    left: 16px;
    right: 16px;
  }
  .toast { max-width: 100%; }
}
