/* Download Modal Overlay */
.download-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

/* Download Modal */
.download-modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Completion Modal Styles */
.completion-modal-header {
  margin-bottom: 24px;
}

.completion-modal-title {
  margin: 0 0 8px 0;
  color: var(--color-text-primary, #2c3e50);
  font-family: "Libre Baskerville", serif;
  font-size: 1.5rem;
  font-weight: normal;
}

.completion-modal-subtitle {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.completion-modal-stats {
  margin-bottom: 28px;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 8px 16px;
}

.completion-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
}

.completion-stat-item:last-child {
  border-bottom: none;
}

.completion-stat-label {
  color: var(--color-text-primary, #2c3e50);
  font-weight: 500;
}

.completion-stat-value-success {
  color: var(--color-positive-normal, #53d769);
  font-weight: bold;
}

.completion-stat-value-warning {
  color: #f59e0b;
  font-weight: bold;
}

.completion-stat-value-error {
  color: var(--color-negative-normal, #fc3d39);
  font-weight: bold;
}

.completion-modal-actions {
  margin-bottom: 24px;
}

.completion-modal-disclaimer {
  margin: 0 0 12px 0;
  color: #7b7e81ff;
  font-weight: 400;
  font-size: 0.75rem;
  font-family: var(
    --font-family-content,
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif
  );
}

.completion-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--color-default-normal, #ffffff);
  color: var(--color-recommended-normal, #5ba4fc);
  border: 2px solid var(--color-default-highlighted, #e5e5e5);
  padding: 10px 28px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  cursor: pointer;
  box-shadow: none;
  text-transform: none;
  text-align: center;
  line-height: 1.2;
  outline: none;
}

.completion-download-btn:hover {
  background-color: var(--color-recommended-normal, #5ba4fc);
  color: #fff;
  border-color: var(--color-recommended-normal, #5ba4fc);
  box-shadow: none;
  transform: none;
}

.completion-download-btn:active {
  background-color: var(--color-recommended-normal, #5ba4fc);
  color: #fff;
  border-color: var(--color-recommended-normal, #5ba4fc);
  box-shadow: none;
  transform: none;
}

.completion-download-btn:focus {
  outline: none;
  box-shadow: none;
}

.completion-modal-footer {
  color: #666;
  font-size: 0.85rem;
  line-height: 1.4;
}

.completion-modal-footer p {
  margin: 0;
  font-weight: 500;
}

.completion-modal-footer code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* Empty files and errors list styles */
.completion-details-list {
  margin-top: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #f59e0b;
}

.completion-details-list.error-list {
  border-left-color: var(--color-negative-normal, #fc3d39);
}

.completion-details-list h4 {
  margin: 0 0 12px 0;
  color: var(--color-text-primary, #2c3e50);
  font-size: 1rem;
  font-weight: 600;
}

.completion-details-list ul {
  margin: 0;
  padding-left: 20px;
}

.completion-details-list li {
  margin-bottom: 8px;
  color: #666;
  line-height: 1.4;
}

.completion-details-list li:last-child {
  margin-bottom: 0;
}

/* Tooltip Styles for Download Modal */
.download-modal .stat-value-with-tooltip {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.download-modal .stat-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333 !important;
  color: white !important;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: normal;
  max-width: 280px;
  min-width: 180px;
  white-space: normal;
  text-align: left;
  line-height: 1.3;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100001 !important;
  margin-top: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.download-modal .stat-tooltip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #333;
}

.download-modal .stat-value-with-tooltip:hover .stat-tooltip {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(-50%) translateY(4px);
  pointer-events: auto;
}

.download-modal .stat-tooltip ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.download-modal .stat-tooltip li {
  margin-bottom: 0; /* Cambiado de 4px a 0 para mejor centrado */
  padding: 6px 0; /* Aumentado de 3px a 6px para centrar la línea */
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.download-modal .stat-tooltip li:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.download-modal .stat-tooltip .file-name {
  font-weight: 600;
  color: #fff !important;
  font-size: 0.8rem;
}

.download-modal .stat-tooltip .file-message {
  font-size: 0.75rem;
  color: #ccc !important;
  margin-top: 1px;
}

/* Responsive tooltip positioning */
@media (max-width: 600px) {
  .download-modal .stat-tooltip {
    left: 0;
    right: 0;
    transform: none;
    max-width: none;
    margin: 0 12px 6px 12px;
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .download-modal .stat-tooltip::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Close button styles for download modal - matching stats modal exactly */
.download-modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: 2px solid var(--color-default-highlighted, #e6e6e6);
  color: var(--color-text-primary, #2c3e50);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.2s ease;
  z-index: 100001;
  line-height: 1;
}

.download-modal-close-btn:hover {
  background: var(--color-negative-normal, #fc3d39);
  border-color: var(--color-negative-highlighted, #e33437);
  transform: scale(1.05);
}

.download-modal-close-icon {
  width: 10px;
  height: 10px;
  filter: invert(30%);
  transition: all 0.2s ease;
}

.download-modal-close-btn:hover .download-modal-close-icon {
  filter: invert(100%);
  transform: scale(1.2);
  translate: 0.35px 0px;
}
