/* LogoTest IA v5.0 Styles */
.lti-wrapper {
  max-width: 600px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.lti-wrapper h2 {
  text-align: center;
  color: #531ACD;
  margin-bottom: 30px;
  font-size: 28px;
  font-weight: 600;
}

/* Formulario inicial */
.lti-wrapper form {
  margin-bottom: 30px;
}

.lti-wrapper form label {
  display: block;
  margin-bottom: 8px;
  color: #4A4A4A;
  font-weight: 500;
}

.lti-wrapper form input,
.lti-wrapper form select {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.lti-wrapper form input:focus,
.lti-wrapper form select:focus {
  outline: none;
  border-color: #531ACD;
  box-shadow: 0 0 0 2px rgba(83,26,205,0.1);
}

.lti-wrapper form button[type="submit"] {
  background: #531ACD;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
  margin: 30px auto 0;
}

.lti-wrapper form button[type="submit"]:hover {
  background: #4315A8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(83,26,205,0.2);
}

/* Tests */
.lti-test-item {
  margin-bottom: 40px;
  text-align: center;
  padding: 20px;
  background: #F8F9FA;
  border-radius: 12px;
}

.lti-test-item h3 {
  color: #531ACD !important;
  font-size: 24px !important;
  font-weight: 600 !important;
  margin: 60px 0 15px 0;
}

.lti-description {
  color: #666;
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 18px;
}

.lti-test-item img {
  display: block;
  margin: 20px auto;
  max-width: 200px;
  border-radius: 8px;
}

.lti-question {
  margin: 20px 0;
}

.lti-question label {
  display: block;
  margin-bottom: 10px;
  color: #4A4A4A !important;
  font-size: 18px !important;
  font-weight: 500;
}

.lti-question select {
  width: 100%;
  max-width: 400px;
  padding: 12px;
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  font-size: 16px;
  color: #4A4A4A;
  background-color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 250px;
  height: auto;
  -webkit-appearance: menulist;
  appearance: menulist;
}

.lti-question select:focus {
  outline: none;
  border-color: #531ACD;
  box-shadow: 0 0 0 2px rgba(83,26,205,0.1);
}

.lti-question select option {
  padding: 8px;
  font-size: 16px;
}

/* Botón de resultados */
#lti-show-results {
  display: block;
  margin: 30px auto;
  background: #531ACD;
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 30px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

#lti-show-results:hover {
  background: #4315A8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(83,26,205,0.2);
}

/* Resultados */
#lti-result {
  text-align: center;
  padding: 30px;
  background: #F8F9FA;
  border-radius: 12px;
  margin-top: 30px;
  animation: fadeInScale 0.7s ease-out forwards;
  opacity: 0;
}

.lti-result-stars {
  font-size: 48px;
  color: #FFC107;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1;
  opacity: 1 !important;
  animation: none !important;
}

.lti-result-stars i {
    display: inline-block !important;
    color: #FFC107 !important;
    opacity: 1 !important;
    font-size: 48px !important;
    transform: none !important;
    animation: none !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Remove any residual animation rules for individual stars */
/*
.lti-animated-star {
    transform: scale(0.8);
    animation: scaleInStar 0.4s ease-out forwards;
}

@keyframes scaleInStar {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
*/

/* Add fade-in animation to the stars container */
.lti-result-stars {
    /* Existing styles... */
    animation: fadeIn 0.6s ease-out forwards; /* Apply fade-in */
    opacity: 0; /* Start invisible for fade-in */
}

.lti-score {
  font-size: 24px;
  font-weight: 600;
  color: #531ACD;
  margin-bottom: 20px;
}

.lti-message {
  font-size: 18px;
  line-height: 1.6;
  color: #4A4A4A;
  margin: 0 auto 30px;
  max-width: 90%;
  font-weight: 500;
}

.lti-cta {
  background: #531ACD;
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 30px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.lti-cta:hover {
  background: #4315A8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(83,26,205,0.2);
  color: white;
  text-decoration: none;
}

/* Animaciones */
.success-animation {
  margin: 20px auto;
}

.checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #4BB543;
  stroke-miterlimit: 10;
  margin: 10% auto;
  box-shadow: inset 0px 0px 0px #4BB543;
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: #4BB543;
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes scale {
  0%, 100% {
    transform: none;
  }
  50% {
    transform: scale3d(1.1, 1.1, 1);
  }
}

@keyframes fill {
  100% {
    box-shadow: inset 0px 0px 0px 30px #4BB543;
  }
}

/* Pruebas específicas */
.lti-scale-images {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 30px;
  margin: 30px 0;
}

.lti-scale-item {
  text-align: center;
}

.lti-scale-item p {
  margin: 10px 0 0;
  font-size: 14px;
  color: #6C757D;
}

.lti-grayscale-img {
  filter: grayscale(100%);
}

.lti-negative-img {
  filter: invert(100%);
  background: #000;
  padding: 20px;
  border-radius: 8px;
}

/* Grid test */
.lti-grid-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 210px;
  margin: 20px auto;
  padding: 10%;
  border: 2px solid rgba(83,26,205,0.2);
  border-radius: 12px;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lti-grid-wrapper::before,
.lti-grid-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 10px;
}

/* Líneas finas de la cuadrícula (6x6 = número par de divisiones) */
.lti-grid-wrapper::before {
  background: 
    linear-gradient(to right, rgba(83,26,205,0.2) 1px, transparent 1px) 0 0 / 16.666% 100%,
    linear-gradient(to bottom, rgba(83,26,205,0.2) 1px, transparent 1px) 0 0 / 100% 16.666%;
}

/* Cruz central gruesa */
.lti-grid-wrapper::after {
  background:
    /* Línea vertical central */
    linear-gradient(to right, transparent calc(50% - 1px), rgba(83,26,205,0.4) calc(50% - 1px), rgba(83,26,205,0.4) calc(50% + 1px), transparent calc(50% + 1px)),
    /* Línea horizontal central */
    linear-gradient(to bottom, transparent calc(50% - 1px), rgba(83,26,205,0.4) calc(50% - 1px), rgba(83,26,205,0.4) calc(50% + 1px), transparent calc(50% + 1px));
}

.lti-grid-wrapper img {
  position: absolute;
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
  inset: 0;
}

/* SweetAlert2 customization */
.swal2-popup {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
  overflow-y: hidden !important; /* Hide vertical scrollbar */
}

.swal2-title {
  color: #531ACD !important;
}

.swal2-confirm {
  background: #531ACD !important;
}

.swal2-confirm:focus {
  box-shadow: 0 0 0 2px rgba(83,26,205,0.2) !important;
}

.swal2-html-container {
    overflow-y: hidden !important; /* Also hide scrollbar on the HTML container */
}

.swal2-loader {
  /* ... existing code ... */
}

.lti-wizard-next {
  background: none !important;
  border: none !important;
  color: #666 !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  cursor: pointer;
  padding: 0;
  margin-top: 18px;
  transition: color 0.2s;
}

.lti-wizard-next:hover {
  color: #531ACD !important;
  text-decoration: underline;
}

.lti-file-upload-container {
    margin-bottom: 20px;
}

.lti-drag-drop-area {
    border: 2px dashed #ccc;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background-color: #f9f9f9;
    border-radius: 8px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.lti-drag-drop-area.drag-over {
    background-color: #e0e0e0;
    border-color: #0073aa;
}

.lti-drag-drop-area p {
    margin: 0;
    color: #555;
    font-size: 1.1em;
}

/* Botones de compartir en resultados altos */
.lti-share-buttons {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.lti-share-buttons .lti-btn {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    color: white;
    transition: opacity 0.3s ease;
}

.lti-share-buttons .lti-btn:hover {
    opacity: 0.9;
    text-decoration: none;
    color: white;
}

.lti-share-twitter {
    background-color: #1DA1F2;
}

.lti-share-facebook {
    background-color: #1877F2;
}

.lti-share-whatsapp {
    background-color: #25D366;
}

.lti-share-linkedin {
    background-color: #0A66C2;
}

/* Animaciones */
/* Existing lti-fade-in, modify as needed */
.lti-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
}

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

/* Animation for result stars container */
.lti-result-stars {
  font-size: 48px;
  color: #FFC107;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1;
}

/* Animation for the result block */
#lti-result {
  text-align: center;
  padding: 30px;
  background: #F8F9FA;
  border-radius: 12px;
  margin-top: 30px;
  animation: fadeInScale 0.7s ease-out forwards;
  opacity: 0;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Animation for the progress bar fill */
.lti-wrapper .lti-test-item > div:first-child > div:last-child > div {
    /* Already has transition: width 0.4s; */
    /* Adding a subtle color pulse could be done here if desired */
    /* For now, the width transition is likely sufficient animation for progress */
}

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