/* Custom styles for Método IP Landing Page */

/* ===== Base Styles ===== */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Prevent horizontal overflow globally */
* {
  box-sizing: border-box;
  max-width: 100%;
}

/* Container fixes */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}

/* Loading Screen */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

/* ===== Typography ===== */
.glow-text {
  text-shadow: 0 0 10px rgba(220, 38, 38, 0.5), 0 0 20px rgba(220, 38, 38, 0.3);
}

.text-glow {
  animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
  0% {
    text-shadow: 0 0 5px rgba(220, 38, 38, 0.5), 0 0 10px rgba(220, 38, 38, 0.3);
  }
  100% {
    text-shadow: 0 0 10px rgba(220, 38, 38, 0.8), 0 0 20px rgba(220, 38, 38, 0.5), 0 0 30px rgba(220, 38, 38, 0.3);
  }
}

/* ===== Hero Section with Banner ===== */
#home {
  background-attachment: fixed !important;
}

/* Mobile banner optimization */
@media (max-width: 768px) {
  #home {
    background-attachment: scroll !important;
    background-size: cover !important;
    background-position: center center !important;
  }
}

/* ===== Button Styles ===== */
.btn-primary {
  @apply bg-accent text-white font-bold py-3 px-6 rounded-lg hover:bg-danger transition-all duration-300 shadow-md flex items-center justify-center;
}

.btn-primary-large {
  @apply bg-accent text-white font-bold py-4 px-8 rounded-lg hover:bg-danger transition-all duration-300 shadow-lg flex items-center justify-center text-lg;
}

.btn-primary-header {
  @apply bg-accent text-white font-bold py-2 px-6 rounded-lg hover:bg-danger transition-all duration-300 shadow-md flex items-center justify-center;
}

.btn-secondary {
  @apply bg-transparent text-accent border-2 border-accent font-bold py-3 px-6 rounded-lg hover:bg-accent/10 transition-all duration-300 flex items-center justify-center;
}

.btn-secondary-large {
  @apply bg-transparent text-accent border-2 border-accent font-bold py-4 px-8 rounded-lg hover:bg-accent/10 transition-all duration-300 flex items-center justify-center text-lg;
}

/* Button hover effects */
.btn-primary:hover,
.btn-primary-large:hover,
.btn-primary-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(220, 38, 38, 0.4);
}

.btn-secondary:hover,
.btn-secondary-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(220, 38, 38, 0.2);
}

/* ===== Header Styles ===== */
.header-scrolled {
  @apply bg-primary/95 py-2 shadow-lg;
  backdrop-filter: blur(10px);
}

/* Hamburger Menu */
.hamburger {
  width: 24px;
  height: 18px;
  position: relative;
  cursor: pointer;
}

.hamburger span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background: white;
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.hamburger span:nth-child(1) {
  top: 0px;
}

.hamburger span:nth-child(2) {
  top: 8px;
}

.hamburger span:nth-child(3) {
  top: 16px;
}

.hamburger.active span:nth-child(1) {
  top: 8px;
  transform: rotate(135deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.hamburger.active span:nth-child(3) {
  top: 8px;
  transform: rotate(-135deg);
}

/* Navigation Links */
.nav-link {
  position: relative;
  padding-bottom: 5px;
}

.nav-underline {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #dc2626;
  transition: width 0.3s ease;
}

.nav-underline-active {
  width: 100%;
}

/* ===== Hero Section ===== */
/* Floating Shapes */
.floating-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  animation: float 15s infinite ease-in-out;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.8) 0%, rgba(0, 0, 0, 0) 70%);
  top: 10%;
  left: 10%;
}

.shape-2 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.6) 0%, rgba(0, 0, 0, 0) 70%);
  bottom: 20%;
  right: 15%;
}

.shape-3 {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.5) 0%, rgba(0, 0, 0, 0) 70%);
  top: 40%;
  right: 25%;
}

.shape-4 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.4) 0%, rgba(0, 0, 0, 0) 70%);
  bottom: 10%;
  left: 25%;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(20px, 20px);
  }
  100% {
    transform: translate(0, 0);
  }
}

/* Particles */
.particle {
  position: absolute;
  background-color: #dc2626;
  border-radius: 50%;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-100px) translateX(20px);
    opacity: 0;
  }
}

/* Typing Animation */
.typing-animation {
  border-right: 4px solid #dc2626;
  white-space: nowrap;
  overflow: hidden;
  animation: blinkCursor 1s step-end infinite;
}

@keyframes blinkCursor {
  0%, 50% {
    border-color: #dc2626;
  }
  51%, 100% {
    border-color: transparent;
  }
}

/* ===== About Section ===== */
/* Feature Cards */
.feature-card {
  @apply bg-primary/50 p-8 rounded-xl shadow-lg border border-accent/20 relative overflow-hidden transition-all duration-300;
}

.feature-card-hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  border-color: rgba(220, 38, 38, 0.4);
}

.feature-icon {
  @apply bg-accent/20 w-16 h-16 rounded-full flex items-center justify-center mb-6 text-accent transition-all duration-300;
}

.feature-card:hover .feature-icon {
  @apply bg-accent/30;
  transform: scale(1.1);
}

.feature-number {
  @apply text-6xl font-black text-accent/10 absolute bottom-4 right-4 transition-all duration-300;
}

.feature-card:hover .feature-number {
  @apply text-accent/20;
  transform: scale(1.2);
}

/* Benefit Items */
.benefit-item {
  @apply mb-6 transition-all duration-300;
}

.benefit-item-hover {
  transform: translateX(10px);
}

.benefit-check {
  @apply bg-accent/20 w-8 h-8 rounded-full flex items-center justify-center mr-4 text-accent flex-shrink-0 transition-all duration-300;
}

.benefit-item:hover .benefit-check {
  @apply bg-accent text-white;
  transform: scale(1.1);
}

/* ===== Video Section ===== */
.video-container {
  transition: transform 0.3s ease;
}

.video-container:hover {
  transform: scale(1.02);
}

.play-button-large {
  position: relative;
}

.play-button-large::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: rgba(220, 38, 38, 0.5);
  animation: pulse 2s infinite;
  z-index: -1;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.5);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* ===== Contact Section ===== */
/* Contact section centering */
#contact {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

/* Form Styles */
.form-group {
  @apply mb-4;
}

.form-label {
  @apply block text-sm font-medium text-gray-300 mb-1;
}

.form-input {
  @apply w-full px-4 py-3 bg-primary/70 border border-gray-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-accent text-white transition-all duration-300;
}

.form-input:focus {
  @apply border-accent;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.form-checkbox {
  @apply h-4 w-4 text-accent focus:ring-accent border-gray-700 rounded transition-all duration-300;
}

/* Contact Benefits */
.contact-benefit {
  @apply flex items-start mb-6 transition-all duration-300;
}

.contact-benefit:hover {
  transform: translateX(5px);
}

.contact-benefit-icon {
  @apply bg-accent/20 w-10 h-10 rounded-full flex items-center justify-center mr-4 text-accent flex-shrink-0 transition-all duration-300;
}

.contact-benefit:hover .contact-benefit-icon {
  @apply bg-accent text-white;
}

/* ===== Footer Section ===== */
.footer-link {
  @apply text-gray-300 hover:text-accent transition-colors duration-300 inline-block;
  position: relative;
  padding-left: 15px;
}

.footer-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #dc2626;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.footer-link:hover::before {
  opacity: 1;
  transform: translateY(-50%) scale(1.2);
}

.social-icon {
  @apply w-10 h-10 bg-accent/20 rounded-full flex items-center justify-center text-accent hover:bg-accent hover:text-white transition-all duration-300;
}

.social-icon:hover {
  transform: translateY(-3px);
}

/* ===== Animations ===== */
/* Pulse Animation */
@keyframes pulseRed {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

.animate-pulse-red {
  animation: pulseRed 2s infinite;
}

/* Reveal Animation */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Logo Animation */
.logo-animation {
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.8s ease;
}

.logo-animated {
  opacity: 1;
  transform: translateY(0);
}

/* Floating CTA */
#floating-cta {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.show-floating-cta {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
  .feature-card,
  .benefit-item {
    transform: none !important;
  }

  .shape {
    opacity: 0.05;
  }
}

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

::-webkit-scrollbar-track {
  background: #0f172a;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #b91c1c;
}

/* ===== Mobile Responsiveness Enhancements ===== */

/* Mobile-first button adjustments */
.btn-primary,
.btn-primary-large,
.btn-primary-header,
.btn-secondary,
.btn-secondary-large {
  min-height: 44px; /* iOS touch target minimum */
  touch-action: manipulation;
}

/* Mobile typography adjustments */
@media (max-width: 640px) {
  /* Prevent horizontal overflow */
  body, html {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* Force all elements to respect viewport width */
  * {
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  /* Container adjustments for mobile */
  .container,
  .max-w-7xl,
  .max-w-6xl,
  .max-w-5xl,
  .max-w-4xl,
  .max-w-3xl,
  .max-w-2xl,
  .max-w-xl {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Section padding adjustments */
  section {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Image containment */
  img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Text size adjustments for mobile */
  h1, h2, h3, h4, h5, h6 {
    word-break: break-word;
    hyphens: auto;
  }

  /* Grid adjustments for mobile */
  .grid {
    gap: 0.5rem !important;
  }

  /* Button adjustments for mobile */
  button, a[role="button"], .btn-primary, .btn-secondary {
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto !important;
    display: block !important;
    text-align: center !important;
  }

  /* Reduce glow effect on mobile for performance */
  .glow-text {
    text-shadow: 0 0 5px rgba(220, 38, 38, 0.5);
  }

  /* Keep typing animation on all devices */
  .typing-animation {
    border-right: 4px solid #dc2626;
    white-space: nowrap;
    overflow: hidden;
    animation: blinkCursor 1s step-end infinite;
  }

  /* Reduce other heavy animations on mobile only */
  .text-glow {
    animation: none; /* Disable glow animation on mobile */
  }

  /* Adjust hero section for mobile */
  #home {
    min-height: 100vh;
    padding-top: 80px;
    background-attachment: scroll !important;
    background-size: cover !important;
    background-position: center center !important;
  }

  /* Mobile-specific spacing */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Feature cards mobile adjustments */
  .feature-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }

  .feature-number {
    font-size: 3rem;
    bottom: 0.5rem;
    right: 0.5rem;
  }

  /* Mobile form adjustments */
  .form-input {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 0.875rem;
  }

  /* Contact section mobile centering */
  #contact {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
  }

  /* Ensure form container is centered */
  #contact .max-w-lg {
    margin: 0 auto;
    width: 100%;
    max-width: 400px;
  }

  /* Mobile video player */
  .video-container {
    margin: 0 -1rem;
  }

  /* Disable hover effects on mobile */
  .feature-card:hover,
  .benefit-item:hover,
  .contact-benefit:hover {
    transform: none;
  }

  /* Mobile hamburger menu */
  .hamburger {
    width: 20px;
    height: 15px;
  }

  .hamburger span {
    height: 2px;
  }

  .hamburger span:nth-child(2) {
    top: 6px;
  }

  .hamburger span:nth-child(3) {
    top: 12px;
  }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
  /* Tablet-specific adjustments */
  .hero-title {
    font-size: 3.5rem;
  }

  .feature-card {
    padding: 2rem;
  }

  /* Tablet grid adjustments */
  .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Contact form centering for tablet */
  #contact {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #contact .max-w-lg {
    max-width: 500px;
  }
}

/* Desktop contact form centering */
@media (min-width: 1025px) {
  #contact {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #contact .max-w-lg {
    max-width: 600px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .btn-primary:hover,
  .btn-primary-large:hover,
  .btn-secondary:hover,
  .btn-secondary-large:hover {
    transform: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }

  .social-icon:hover {
    transform: none;
  }

  .footer-link:hover::before {
    transform: translateY(-50%);
    opacity: 0.6;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize for retina displays */
  .glow-text {
    text-shadow: 0 0 8px rgba(220, 38, 38, 0.6), 0 0 16px rgba(220, 38, 38, 0.4);
  }
}

/* Landscape mobile adjustments */
@media (max-width: 896px) and (orientation: landscape) {
  #home {
    min-height: 100vh;
    padding-top: 60px;
    padding-bottom: 2rem;
  }

  .hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  .stats-grid {
    margin-bottom: 2rem;
  }
}

/* Floating CTA mobile positioning */
@media (max-width: 640px) {
  #floating-cta {
    bottom: 1rem;
    right: 1rem;
  }

  #floating-cta a {
    width: 56px;
    height: 56px;
    padding: 1rem;
  }

  #floating-cta svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* Accessibility improvements for mobile */
@media (max-width: 640px) {
  /* Larger touch targets */
  .nav-link {
    padding: 0.75rem 0;
    font-size: 1.125rem;
  }

  /* Better contrast for small screens */
  .text-gray-300 {
    color: #e5e7eb;
  }

  .text-gray-400 {
    color: #d1d5db;
  }
}

/* Performance optimizations for mobile */
@media (max-width: 640px) {
  /* Reduce animations on mobile for better performance */
  .floating-shapes {
    display: none;
  }

  #particles-container {
    display: none;
  }

  .animate-bounce {
    animation-duration: 2s;
  }

  .animate-pulse {
    animation-duration: 3s;
  }
}

/* Safe area adjustments for notched devices */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  #main-header {
    padding-top: env(safe-area-inset-top);
  }
}

/* ===== Contact Form Styles ===== */
#contact-form {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#contact-form input:focus {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

#contact-form input::placeholder {
  transition: opacity 0.3s ease;
}

#contact-form input:focus::placeholder {
  opacity: 0.5;
}

/* Error state styling */
#contact-form .border-red-500 {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

/* Form animations */
#contact-form .form-group {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Notification styles */
.notification {
  max-width: 400px;
  z-index: 9999;
}

@media (max-width: 640px) {
  .notification {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}

/* Success Popup Styles */
.success-popup {
  animation: fadeInOverlay 0.3s ease-out;
}

@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.success-popup div {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.success-popup button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -5px rgba(220, 38, 38, 0.4);
}

@media (max-width: 640px) {
  .success-popup div {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }
  
  .success-popup h3 {
    font-size: 1.5rem;
  }
  
  .success-popup p {
    font-size: 1rem;
  }
}
