/* styles.css - Versión corregida con colores y responsividad mejorada */

/* styles.css */
@font-face {
    font-family: 'Astralaga';
    src: url('fonts/Astralaga-Medium.woff') format('truetype');
    font-weight: 900;
    font-style: normal;
  }
  
  
  @font-face {
    font-family: 'Avenir';
    src: url('fonts/Avenir-LT-Std-55-Roman.woff') format('truetype');
    font-weight: 900;
    font-style: normal;
  }


/* Reset y configuración base */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Georgia', serif;
  overflow-x: hidden;
}

/* === ESTILOS DE ANIMACIÓN DE CARGA === */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#animation-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 0;
  padding-bottom: 62.5%;
}

#animation-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#libelula {
  position: absolute;
  transform-origin: center;
  width: 37.5%;
  height: 60%;
  z-index: 10;
  pointer-events: none;
}

#trail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#logo-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: clamp(200px, 40vw, 400px);
  height: clamp(200px, 40vw, 400px);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

#logo-inicio {
  max-width: 300%;
  max-height: 300%;
  object-fit: contain;
  width: 90%;
  height: auto;
}

/* Estilos para libélula SVG */
.st0 { fill: #cbd6e9; }
.st1 { fill: #8fa9dd; }
.st2 { opacity: .6; }
.st3 { fill: #f2e0ab; }

/* === ESTILOS PÁGINA PRINCIPAL === */
body {
      font-family: 'Georgia', serif;
       background: url(imagenes/Recurso\ 1.png);
      background-size: cover;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: flex-end; /* Formulario a la derecha */
  
    }

.main-wrapper {
  display: flex;
  background-size: cover;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 2vw, 8rem);
  gap: clamp(2rem, 8vw, 6rem);
}

.left-side {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 600px;
}

.main-logo {
  width: 130%;
  height: auto;
  max-width: 1000px;
  object-fit: contain;
}

.right-side {
  flex: 1;
  max-width: 450px;
  background: rgba(255, 255, 255, 0.95) !important; /* Forzar fondo blanco */
  color: #4B2E2E !important; /* Forzar texto oscuro */
  padding: clamp(2rem, 4vw, 2.5rem);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.right-side h2 {
  font-family: 'Georgia', serif;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
  color: #000000 !important; /* Forzar color del título */
  font-weight: 600;
  letter-spacing: 0.5px;
}

.right-side p {
  font-size: clamp(0.9rem, 2.5vw, .5rem);
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
  line-height: 1.6;
  color: #5a5a5a !important; /* Forzar color del texto */
}

#access-form {
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.right-side input[type="text"] {
  width: 100%;
  max-width: 300px;
  padding: clamp(0.75rem, 2vw, 1rem);
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
  border-radius: 50px;
  border: 2px solid #e0e0e0;
  text-align: center;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9) !important; /* Forzar fondo blanco */
  color: #333 !important; /* Forzar texto oscuro */
}

.right-side input[type="text"]:focus {
  outline: none;
  border-color: #8fa9dd;
  box-shadow: 0 0 0 3px rgba(143, 169, 221, 0.1);
  transform: translateY(-1px);
}

.right-side input[type="text"]::placeholder {
  color: #999 !important;
  font-style: italic;
}

.dragonfly {
  width: clamp(60px, 15vw, 120px);
  height: auto;
  margin-top: clamp(0.5rem, 2vw, 1rem);
  opacity: 0.8;
  transition: transform 0.3s ease;
}

.dragonfly:hover {
  transform: scale(1.05) rotate(5deg);
}

#access-form button {
  width: 100%;
  max-width: 300px;
  padding: clamp(0.75rem, 2vw, 1rem);
  border-radius: 50px;
  border: none;
  background-color: #8fa9dd;
  color: white;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

#access-form button:hover {
  background-color: #6e8fc6;
  transform: translateY(-1px);
}

/* === RESPONSIVIDAD MEJORADA === */

/* Pantallas extra grandes (1400px y más) */
@media (min-width: 1400px) {
  .main-wrapper {
    gap: 8rem;
    padding: 3rem 12rem;
  }
  
  .main-logo {
    width: 120%;
  }
}

/* Pantallas grandes (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .main-wrapper {
    gap: 6rem;
    padding: 3rem 8rem;
  }
}

/* Pantallas medianas (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .main-wrapper {
    gap: 4rem;
    padding: 2rem 4rem;
  }
  
  .main-logo {
    width: 110%;
  }
}

/* Tabletas grandes (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .main-wrapper {
    gap: 3rem;
    padding: 2rem;
  }
  
  .main-logo {
    width: 100%;
    max-width: 400px;
  }
  
  .right-side {
    max-width: 380px;
  }
}

/* Tabletas y móviles grandes (481px - 767px) */
@media (max-width: 767px) {
  body {
    overflow-y: auto;
  }
  
  .main-wrapper {
    flex-direction: column;
    padding: 1rem;
    gap: 2rem;
    justify-content: flex-start;
    min-height: 100vh;
    padding-top: 2rem;
  }
  
  .left-side {
    order: 1; /* Logo arriba en móviles */
    max-width: 300px;
    margin-bottom: 1rem;
  }
  
  .right-side {
    order: 2; /* Formulario abajo en móviles */
    max-width: 100%;
    width: 80%;
    margin: 0 auto;
  }
  
  .main-logo {
    width: 130%;
    max-width: 500px;
  }
  
  #animation-container {
    padding-bottom: 80%;
    max-width: 400px;
  }
  
  #logo {
    margin-top: 180%;
  }
}

/* Móviles (480px y menos) */
@media (max-width: 480px) {
  .main-wrapper {
    padding: 0.5rem;
    gap: 1.5rem;
    padding-top: 1.5rem;
  }
  
  .right-side {
    padding: .5rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98) !important; /* Más opaco en móviles */
    width: 85%;
  }
   
  .right-side h2 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
  }
  
  .right-side p {
    margin-bottom: 2rem;
    font-size: 0.95rem;
  }
  
  .main-logo {
    width: 130%;
    max-width: 300px;
  }
  
  .dragonfly {
  width: 40%;
  height: auto;
  margin-top: .5rem;
 
}

  
  #animation-container {
    padding-bottom: 100%;
    max-width: 300px;
  }
  
  #logo-container {
    width: 150px;
    height: 150px;
  }
  
  #logo {
    margin-top: 200%;
  }
}

/* Móviles muy pequeños (360px y menos) */
@media (max-width: 360px) {
  .right-side {
    padding: 1rem;
    margin: 0 0.5rem;
  }
  
  .right-side input[type="text"] {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  .main-logo {
    width: 80%;
    max-width: 500px;
  }
}

/* === ESTILOS PARA PÁGINAS DE EVENTO === */
/* Reset y configuración base */

   .evento-body {
      font-family: 'Georgia', serif;
      background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('imagenes/Recurso 4.png') center/cover;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: flex-end; /* Formulario a la derecha */
      padding: 20px;
      color: #333;
    }

    /* Contenedor principal del formulario */
    .form-container {
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      border-radius: 25px;
      padding: 40px 35px 20px 35px; /* Menos padding abajo para el logo */
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
      width: 100%;
      max-width: 450px;
      text-align: center;
      border: 1px solid rgba(255, 255, 255, 0.2);
      position: relative;
      animation: fadeInUp 0.6s ease-out;
      margin-right: 5%; /* Separación del borde derecho */
    }

    /* Título principal */
    .form-container h1 {
      color: #2c2c2c;
      font-size: 2rem;
      font-weight: 600;
      margin-bottom: 8px;
      letter-spacing: 0.5px;
    }

    /* Subtítulo */
    .subtitulo {
      color: #666;
      font-size: 0.95rem;
      margin-bottom: 30px;
      line-height: 1.4;
      font-weight: 400;
    }

    /* Formulario */
    #upload-form {
      display: flex;
      flex-direction: column;
      gap: 20px;
      margin-bottom: 20px; /* Espacio para el logo */
    }

    /* Campo de nombre */
    input[type="text"] {
      width: 100%;
      padding: 15px 20px;
      border: 2px solid #e0e0e0;
      border-radius: 50px;
      font-size: 1rem;
      text-align: center;
      background: rgba(255, 255, 255, 0.9);
      color: #333;
      transition: all 0.3s ease;
      outline: none;
    }

    input[type="text"]:focus {
      border-color: #8fa9dd;
      box-shadow: 0 0 0 3px rgba(143, 169, 221, 0.1);
      transform: translateY(-1px);
    }

    input[type="text"]::placeholder {
      color: #999;
      font-style: italic;
    }

    /* Campo de archivo personalizado */
    .file-input-wrapper {
      position: relative;
      overflow: hidden;
      display: inline-block;
      width: 100%;
    }

    input[type="file"] {
      position: absolute;
      left: -9999px;
      opacity: 0;
    }

    .file-input-label {
      display: block;
      padding: 15px 20px;
      border: 2px dashed #ccc;
      border-radius: 12px;
      cursor: pointer;
      background: rgba(248, 249, 250, 0.8);
      color: #666;
      font-size: 0.95rem;
      transition: all 0.3s ease;
      position: relative;
    }

    .file-input-label:hover {
      border-color: #8fa9dd;
      background: rgba(143, 169, 221, 0.05);
      color: #555;
    }

    .file-input-label i {
      font-size: 1.2rem;
      margin-right: 8px;
      color: #8fa9dd;
    }

    /* Contador de imágenes */
    #contador-imagenes {
      font-size: 0.85rem;
      color: #666;
      margin: 5px 0 0 0;
      font-weight: 500;
    }

    /* Contenedor de previsualización */
    #preview-container {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
      gap: 8px;
      margin: 20px 0;
      max-height: 200px;
      overflow-y: auto;
      padding: 10px 0;
    }

    .preview-image-wrapper {
      position: relative;
      width: 70px;
      height: 70px;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      transition: transform 0.2s ease;
      justify-self: center;
      animation: fadeIn 0.3s ease-in-out;
    }

    .preview-image-wrapper:hover {
      transform: scale(1.05);
    }

    .preview-image-wrapper img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .preview-image-wrapper button {
      position: absolute;
      top: 2px;
      right: 2px;
      background: rgba(255, 77, 77, 0.9);
      color: white;
      border: none;
      border-radius: 50%;
      width: 20px;
      height: 20px;
      font-size: 10px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
    }

    .preview-image-wrapper button:hover {
      background: #ff3333;
      transform: scale(1.1);
    }

    /* Botón de subir */
    #submit-button {
      width: 100%;
      padding: 15px 20px;
      border: none;
      border-radius: 50px;
      background: linear-gradient(135deg, #8fa9dd, #7d97d1);
      color: white;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    #submit-button:hover:not(:disabled) {
      background: linear-gradient(135deg, #7d97d1, #6b85c5);
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(143, 169, 221, 0.4);
    }

    #submit-button:disabled {
      background: #ccc;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }

    /* Indicador de carga */
    #loader {
      display: none;
      text-align: center;
      margin-top: 20px;
      color: #8fa9dd;
      font-weight: 600;
    }

    .spinner {
      display: inline-block;
      width: 20px;
      height: 20px;
      border: 2px solid #e3e3e3;
      border-top: 2px solid #8fa9dd;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-right: 10px;
    }

    /* Enlace de acceso para novios */
    .admin-link {
      margin: 15px 0 10px 0;
      text-align: center;
    }

    .admin-link a {
      color: #999;
      text-decoration: none;
      font-size: 0.85rem;
      transition: color 0.3s ease;
    }

    .admin-link a:hover {
      color: #8fa9dd;
    }

    /* Logo dentro del formulario */
    .li-logo {
      width: 300px;
      height: auto;
      opacity: 0.7;
      margin-top: 10px;
      filter: grayscale(0.2);
      transition: all 0.3s ease;
    }

    .li-logo:hover {
      opacity: 1;
      filter: grayscale(0);
    }

    /* Animaciones */
    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: scale(0.8);
      }
      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    /* Responsividad para tablets (768px - 1024px) */
    @media (max-width: 1024px) {
      body {
        justify-content: center; /* Centrado en tablets */
      }
      
      .form-container {
        margin-right: 0;
        max-width: 500px;
      }
    }

    /* Responsividad para móviles (768px y menos) */
    @media (max-width: 768px) {
      body {
        justify-content: center;
        padding: 15px;
      }

      .form-container {
        padding: 30px 25px 20px 25px;
        max-width: 100%;
        border-radius: 20px;
        margin-right: 0;
        width: 90%;
      }

      .form-container h1 {
        font-size: 1.7rem;
      }

      .subtitulo {
        font-size: 0.9rem;
        margin-bottom: 25px;
      }

      input[type="text"],
      #submit-button {
        padding: 12px 18px;
        font-size: 0.95rem;
      }

      .file-input-label {
        padding: 12px 18px;
        font-size: 0.9rem;
      }

      #preview-container {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 6px;
      }

      .preview-image-wrapper {
        width: 60px;
        height: 60px;
      }

      .li-logo {
        width: 280px;
      }
    }

    /* Responsividad para móviles pequeños (480px y menos) */
    @media (max-width: 480px) {
      body {
        padding: 10px;
      }

      .form-container {
        padding: 25px 20px 15px 25px;
        border-radius: 18px;
        width: 90%;
      }

      .form-container h1 {
        font-size: 1.5rem;
      }

      .subtitulo {
        font-size: 0.85rem;
      }

      input[type="text"],
      #submit-button {
        padding: 10px 16px;
        font-size: 0.9rem;
      }

      .file-input-label {
        padding: 10px 16px;
        font-size: 0.85rem;
      }

      #preview-container {
        grid-template-columns: repeat(4, 1fr);
        max-height: 150px;
      }

      .preview-image-wrapper {
        width: 55px;
        height: 55px;
      }

      .li-logo {
        width: 260px;
      }
    }

    /* Responsividad para móviles muy pequeños (360px y menos) */ /* Responsividad para móviles pequeños (480px y menos) */
    @media (max-width: 367px) {
      body {
        padding: 10px;
      }

      .form-container {
        padding: 25px 20px 15px 25px;
        border-radius: 18px;
        width: 90%;
      }

      .form-container h1 {
        font-size: 1.5rem;
      }

      .subtitulo {
        font-size: 0.85rem;
      }

      input[type="text"],
      #submit-button {
        padding: 10px 16px;
        font-size: 0.9rem;
      }

      .file-input-label {
        padding: 10px 16px;
        font-size: 0.85rem;
      }

      #preview-container {
        grid-template-columns: repeat(4, 1fr);
        max-height: 150px;
      }

      .preview-image-wrapper {
        width: 55px;
        height: 55px;
      }

      .li-logo {
        width: 220px;
      }
    }


/* === COMPONENTES DE CARGA === */
#loader {
  margin-top: 20px;
  font-weight: bold;
  color: #b66b7d !important;
  text-align: center;
  font-size: clamp(1rem, 3vw, 1.2rem);
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  color: #b66b7d !important;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.spinner {
  border: 4px solid #ffe6ea;
  border-top: 4px solid #b66b7d;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.favorite-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(255, 255, 255, 0.9) !important;
  color: #333 !important;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.favorite-btn:hover {
  background-color: #ffe6ea !important;
  transform: scale(1.1);
}

.favorite-btn.favorited {
  color: #e91e63 !important;
  background-color: rgba(255, 230, 234, 0.95) !important;
}

/* === MEJORAS DE ACCESIBILIDAD === */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  #libelula {
    animation: none;
  }
}

/* Éxito tras subir imágenes */
.success-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #fffaf5;
  padding: 20px;
  text-align: center;
}

.success-box {
  background: #fff;
  padding: 40px 30px;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
  border: 2px solid #f1e1e1;
  max-width: 400px;
  width: 100%;
}

.success-box h2 {
  color: #b66b7d;
  font-size: 1.6em;
  margin-bottom: 15px;
}

.success-box p {
  font-size: 1em;
  color: #555;
  margin-bottom: 25px;
}

.back-button {
  text-decoration: none;
  background-color: #b66b7d;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1em;
  transition: background 0.3s ease;
  display: inline-block;
}

.back-button:hover {
  background-color: #9b5064;
}

/* RESPONSIVO */
@media (max-width: 480px) {
  .success-box {
    padding: 30px 20px;
  }

  .success-box h2 {
    font-size: 1.3em;
  }

  .success-box p {
    font-size: 0.95em;
  }

  .back-button {
    font-size: 0.95em;
    padding: 10px 20px;
  }
}

