/* ===== APLICACIONESTI - INDEX PAGE STYLES ===== */

/* ===== HERO BUTTONS ===== */
.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.btn-primary {
  background: var(--gradient-accent);
  color: white;
  padding: 18px 36px;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 120, 212, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  padding: 18px 36px;
  border: 2px solid var(--text-secondary);
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-secondary:hover {
  border-color: var(--microsoft-blue);
  color: var(--microsoft-blue);
  transform: translateY(-2px);
}

.btn-white {
  background: white;
  color: var(--microsoft-blue);
  padding: 18px 36px;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

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

/* ===== TECH STACK ===== */
.tech-stack {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 25px;
  background: var(--gradient-card);
  border-radius: 12px;
  border: 1px solid rgba(120, 135, 148, 0.1);
  transition: all 0.3s ease;
}

.tech-item:hover {
  transform: translateY(-5px);
  border-color: var(--microsoft-blue);
  box-shadow: 0 10px 25px rgba(0, 120, 212, 0.2);
}

.tech-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* ===== SERVICES GRID ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 60px;
}

.service-card {
  background: var(--gradient-card);
  border: 1px solid rgba(120, 135, 148, 0.1);
  border-radius: 16px;
  padding: 40px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover {
  transform: translateY(-10px);
  border-color: var(--microsoft-blue);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.service-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  font-size: 28px;
}

.service-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.service-card p {
  color: var(--text-secondary);
  margin-bottom: 25px;
  line-height: 1.7;
}

.service-features {
  list-style: none;
}

.service-features li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}

.service-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-green);
  font-weight: bold;
}

/* ===== MICROSOFT TECH SECTION ===== */
.microsoft-tech {
  background: var(--secondary-dark);
  border-radius: 20px;
  padding: 60px;
  margin: 80px 0;
  border: 1px solid rgba(120, 135, 148, 0.1);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.tech-card {
  background: var(--accent-dark);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(120, 135, 148, 0.1);
}

.tech-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.tech-card h4 {
  color: var(--microsoft-blue);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.tech-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===== STATS SECTION ===== */
.stats-section {
  background: var(--secondary-dark);
  border-radius: 20px;
  padding: 60px;
  margin: 80px 0;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.stat-item {
  padding: 20px;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--microsoft-blue);
  margin-bottom: 10px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
}

/* ===== CTA SECTION ===== */
.cta-section {
  background: var(--gradient-accent);
  border-radius: 20px;
  padding: 80px 60px;
  text-align: center;
  margin: 80px 0;
}

.cta-section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: white;
}

.cta-section p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 40px;
}

/* ===== CONTACT FORM ===== */
.contact-form {
  max-width: 500px;
  margin: 40px auto 0;
  background: rgba(26, 26, 46, 0.95);
  padding: 32px 28px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.contact-form h3 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 18px;
  text-align: center;
}

.contact-form label {
  color: #b8c5d1;
  font-weight: 500;
  display: block;
  margin-bottom: 6px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #16213e;
  background: #1a1a2e;
  color: #fff;
  margin-bottom: 18px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--microsoft-blue);
  outline: none;
}

.contact-form button {
  width: 100%;
  background: var(--gradient-accent);
  color: #fff;
  font-weight: 600;
  padding: 14px 0;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.contact-form button:hover {
  background: var(--azure-blue);
}

#form-msg {
  margin-top: 16px;
  text-align: center;
  font-size: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 300px;
  }

  .tech-stack {
    gap: 20px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .microsoft-tech,
  .cta-section {
    padding: 40px 30px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  .contact-form {
    margin: 40px 20px 0;
    padding: 25px 20px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .contact-form::-webkit-scrollbar {
    width: 4px;
  }

  .contact-form::-webkit-scrollbar-track {
    background: rgba(120, 135, 148, 0.1);
  }

  .contact-form::-webkit-scrollbar-thumb {
    background: var(--microsoft-blue);
    border-radius: 2px;
  }

  .contact-form button {
    margin-top: 10px;
    padding: 16px 0;
    font-size: 1rem;
    min-height: 48px;
    position: sticky;
    bottom: 0;
    z-index: 10;
  }

  .contact-form button::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(26, 26, 46, 0.95), transparent);
    pointer-events: none;
  }

  /* Optimizar iframe de citas en móvil */
  .cta-section iframe {
    height: 400px;
    margin-top: 30px;
  }

  .cta-section h3:last-of-type {
    margin-top: 40px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .tech-grid {
    grid-template-columns: 1fr;
  }

  .contact-form {
    margin: 30px 15px 0;
    padding: 20px 15px;
    max-height: 55vh;
  }

  .contact-form button {
    padding: 14px 0;
    font-size: 0.95rem;
    min-height: 44px;
  }

  .cta-section iframe {
    height: 350px;
    margin-top: 25px;
  }

  .cta-section h3:last-of-type {
    margin-top: 30px;
  }

  /* Formulario del chatbot en pantallas pequeñas */
  .chatbot-form {
    max-height: 45vh !important;
    height: 45vh !important;
    padding: 12px !important;
  }

  .chatbot-options {
    max-height: 25vh !important;
    padding: 12px 15px !important;
  }

  .chatbot-messages {
    padding: 12px 15px !important;
    min-height: 120px !important;
  }

  .chatbot-form {
    max-height: 40vh !important;
    height: 40vh !important;
    padding: 10px !important;
  }

  .form-group {
    margin-bottom: 8px !important;
  }

  .form-group input,
  .form-group textarea {
    padding: 8px 10px !important;
    font-size: 16px !important; /* Prevenir zoom en iOS */
    min-height: 42px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .form-actions {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px 0 !important;
  }

  .btn-submit,
  .btn-cancel {
    width: 100% !important;
    min-height: 48px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    padding: 12px 16px !important;
  }

  .form-header h4 {
    font-size: 12px !important;
    margin-bottom: 4px !important;
  }

  .form-header p {
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  .form-group label {
    font-size: 11px !important;
    margin-bottom: 4px !important;
    font-weight: 500 !important;
  }

  /* Mejorar el área de la sección de contacto en móvil */
  .cta-section {
    padding: 30px 20px;
  }

  .cta-section .container {
    padding: 0;
  }

  /* Asegurar que el formulario tenga suficiente espacio */
  .contact-form {
    position: relative;
    z-index: 5;
  }

  /* Mejorar el scroll del área de contacto */
  .cta-section {
    overflow: visible;
  }

  /* ===== FORMULARIO DEL CHATBOT EN MÓVIL - ESTILOS CRÍTICOS ===== */
  .chatbot-form {
    max-height: 35vh !important;
    height: 35vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 12px !important;
    position: relative !important;
    z-index: 1000 !important;
    margin: 10px 0 !important;
    border-radius: 8px !important;
    background: rgba(26, 26, 46, 0.95) !important;
    border: 1px solid rgba(120, 135, 148, 0.2) !important;
    flex-shrink: 0 !important;
  }

  /* Mostrar formulario cuando tenga la clase 'show' */
  .chatbot-form.show {
    display: block !important;
  }

  /* Mejorar scrollbar del formulario del chatbot */
  .chatbot-form::-webkit-scrollbar {
    width: 6px !important;
  }

  .chatbot-form::-webkit-scrollbar-track {
    background: rgba(120, 135, 148, 0.1) !important;
    border-radius: 3px !important;
  }

  .chatbot-form::-webkit-scrollbar-thumb {
    background: var(--microsoft-blue) !important;
    border-radius: 3px !important;
    border: 1px solid rgba(120, 135, 148, 0.2) !important;
  }

  .chatbot-form::-webkit-scrollbar-thumb:hover {
    background: var(--azure-blue) !important;
  }

  /* Asegurar que el chatbot tenga altura suficiente */
  .chatbot-container {
    max-height: 80vh !important;
    min-height: 500px !important;
    height: 80vh !important;
  }

  /* Hacer que los botones estén siempre visibles */
  .form-actions {
    position: sticky !important;
    bottom: 0 !important;
    background: var(--secondary-dark) !important;
    padding: 15px 0 !important;
    margin: 10px -10px -10px -10px !important;
    border-top: 2px solid var(--microsoft-blue) !important;
    z-index: 1001 !important;
    border-radius: 0 0 8px 8px !important;
    backdrop-filter: blur(10px) !important;
  }

  /* Área de mensajes del chatbot (abajo) */
  .chatbot-messages {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 15px 20px !important;
    min-height: 150px !important;
  }

  /* Área de opciones del chatbot (arriba) */
  .chatbot-options {
    max-height: 30vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 15px 20px !important;
    flex-shrink: 0 !important;
  }

  .chatbot-options::-webkit-scrollbar {
    width: 4px !important;
  }

  .chatbot-options::-webkit-scrollbar-track {
    background: rgba(120, 135, 148, 0.1) !important;
  }

  .chatbot-options::-webkit-scrollbar-thumb {
    background: var(--microsoft-blue) !important;
    border-radius: 2px !important;
  }

  /* Asegurar que el formulario no se oculte detrás de otros elementos */
  .chatbot-form.show {
    display: block !important;
  }

  /* Mejorar la transición del formulario */
  .chatbot-form {
    animation: slideDown 0.3s ease !important;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .chatbot-form::-webkit-scrollbar {
    width: 3px;
  }

  .chatbot-form::-webkit-scrollbar-track {
    background: rgba(120, 135, 148, 0.1);
  }

  .chatbot-form::-webkit-scrollbar-thumb {
    background: var(--microsoft-blue);
    border-radius: 2px;
  }

  .form-actions {
    margin-top: 15px;
    padding-bottom: 10px;
  }

  .btn-submit,
  .btn-cancel {
    min-height: 44px;
    font-size: 0.9rem;
    position: sticky;
    bottom: 0;
    z-index: 10;
  }

  .btn-submit::after,
  .btn-cancel::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 0;
    right: 0;
    height: 15px;
    background: linear-gradient(to bottom, var(--secondary-dark), transparent);
    pointer-events: none;
  }

  /* Optimizaciones para móviles muy pequeños */
  @media (max-width: 360px) {
    .contact-form {
      margin: 20px 10px 0;
      padding: 18px 12px;
      max-height: 50vh;
    }

    .contact-form input,
    .contact-form textarea {
      padding: 10px;
      font-size: 16px; /* Prevenir zoom en iOS */
    }

    .contact-form button {
      padding: 12px 0;
      font-size: 0.9rem;
      min-height: 42px;
    }

    .cta-section iframe {
      height: 300px;
      margin-top: 20px;
    }

    .cta-section h3:last-of-type {
      margin-top: 25px;
      font-size: 1.1rem;
    }

    /* Formulario del chatbot en pantallas muy pequeñas */
    .chatbot-form {
      max-height: 40vh !important;
      height: 40vh !important;
      padding: 10px !important;
    }

    .chatbot-options {
      max-height: 20vh !important;
      padding: 10px 12px !important;
    }

    .chatbot-messages {
      padding: 10px 12px !important;
      min-height: 100px !important;
    }

    .chatbot-form {
      max-height: 35vh !important;
      height: 35vh !important;
      padding: 8px !important;
    }

    .form-group input,
    .form-group textarea {
      padding: 8px !important;
      font-size: 16px !important;
      min-height: 40px !important;
    }

    .btn-submit,
    .btn-cancel {
      min-height: 44px !important;
      font-size: 0.9rem !important;
      padding: 10px 12px !important;
    }

    .form-header h4 {
      font-size: 11px !important;
      margin-bottom: 3px !important;
    }

    .form-header p {
      font-size: 9px !important;
      line-height: 1.1 !important;
    }

    .form-group label {
      font-size: 10px !important;
      margin-bottom: 3px !important;
    }

    .chatbot-container {
      min-height: 480px !important;
    }

    .form-group {
      margin-bottom: 6px !important;
    }
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ===== SPECIFIC ANIMATIONS ===== */
.service-card:nth-child(even) {
  animation: slideInLeft 0.6s ease-out;
}

.service-card:nth-child(odd) {
  animation: slideInRight 0.6s ease-out;
}

.tech-item {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: backwards;
}

.tech-item:nth-child(1) {
  animation-delay: 0.1s;
}

.tech-item:nth-child(2) {
  animation-delay: 0.2s;
}

.tech-item:nth-child(3) {
  animation-delay: 0.3s;
}

.tech-item:nth-child(4) {
  animation-delay: 0.4s;
}

.logo-icon {
  height: 40px;
  width: auto;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 120, 212, 0.2));
}

.logo-icon:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px rgba(0, 120, 212, 0.3));
}

.service-card:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
  transition: all 0.3s ease;
}

.tech-card:hover h4 {
  color: var(--azure-blue);
  transition: color 0.3s ease;
}

/* Added for cleaning inline styles */
.contact-form textarea {
    resize: vertical;
}

.contact-form button {
    background: linear-gradient(135deg, #0078d4 0%, #6a4c93 100%);
}

.iframe-container {
  max-width: 700px;
  margin: 60px auto 0;
}

.iframe-container h3 {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 18px;
  text-align: center;
}

.iframe-container iframe {
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  background: #fff;
  border: 0;
}

.footer-section .contact-heading {
  margin-top: 20px;
}