/* ============================================
   GESTION-DE-PIEZAS3.CSS
   Modales: Todos los estilos relacionados con modales
   ============================================ */

/* Modal base styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(15, 23, 42, 0.85) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  border-radius: 1.5rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(59, 130, 246, 0.3) inset, 0 0 80px rgba(59, 130, 246, 0.15);
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #3b82f6 20%, #2563eb 50%, #3b82f6 80%, transparent 100%);
  border-radius: 1.5rem 1.5rem 0 0;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0.08), transparent);
}

.modal-header h3 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #60a5fa;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.7), 0 0 40px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.8);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.75rem;
  cursor: pointer;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  transform: rotate(90deg) scale(1.05);
}

.modal-body {
  padding: 2rem;
}

.section-subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-subtitle::before {
  content: "";
  width: 4px;
  height: 1.25rem;
  background: linear-gradient(to bottom, #3b82f6, #2563eb);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.characteristics-section,
.engineer-selection-section,
.calculated-section {
  margin-bottom: 2rem;
}

.characteristics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.characteristic-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.characteristic-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.characteristic-item:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.characteristic-item:hover::before {
  opacity: 1;
}

.characteristic-item.calculated {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.1), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.characteristic-item.calculated::before {
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.8), transparent);
  opacity: 1;
  animation: slideRight 2s ease-in-out infinite;
}

@keyframes slideRight {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.characteristic-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.characteristic-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
  letter-spacing: -0.02em;
}

.characteristic-value.highlight {
  color: #60a5fa;
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.9);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,
  100% {
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.9);
  }
  50% {
    text-shadow: 0 0 20px rgba(59, 130, 246, 1), 0 0 40px rgba(59, 130, 246, 0.6), 0 2px 8px rgba(0, 0, 0, 0.9);
  }
}

.engineer-select {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.05));
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 0.75rem;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%233b82f6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
}

.engineer-select:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.engineer-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 0 30px rgba(59, 130, 246, 0.3);
}

.engineer-select option {
  background: #0f172a;
  color: #ffffff;
  padding: 1rem;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  padding: 2rem;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(59, 130, 246, 0.05), transparent);
}

.modal-actions .btn-primary {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.75rem;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4), 0 0 0 1px rgba(220, 38, 38, 0.2);
}

.modal-actions .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6), 0 0 0 1px rgba(220, 38, 38, 0.3);
}

.modal-actions .btn-secondary {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.75rem;
}

.modal-actions .btn-primary:disabled {
  background: rgba(220, 38, 38, 0.3);
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.modal-actions .btn-primary:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Speed-up modal specific styles */
.speed-up-modal {
  max-width: 650px;
}

.speed-up-modal .modal-header h3 {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #3b82f6;
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
  margin: 0;
}

.modal-description {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 0.9375rem;
}

.code-input-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.code-input-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-input {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 0.75rem;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

.code-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.code-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}

.code-input-hint {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin: 0;
}

/* Nuevos estilos para modal de confirmación rediseñado */
.confirmation-modal {
  max-width: 550px;
}

.confirmation-info-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.acceleration-warning {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 1rem;
  text-align: center;
}

.acceleration-warning svg {
  color: #3b82f6;
  filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.6));
  animation: electricPulse 2s ease-in-out infinite;
}

@keyframes electricPulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.6));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 25px rgba(59, 130, 246, 0.9));
  }
}

.acceleration-warning p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.125rem;
  line-height: 1.6;
  margin: 0;
}

.acceleration-warning strong {
  color: #60a5fa;
  font-size: 1.5rem;
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
}

.confirmation-question {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  text-align: center;
}

.confirmation-question p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.warning-note {
  color: #fbbf24 !important;
  font-size: 0.9375rem !important;
  font-weight: 500 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.piece-technical-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.technical-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
}

.info-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #60a5fa;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.failure-value {
  color: #f87171;
  text-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
}

/* Nuevos estilos para modal de animación rediseñado */
.animation-modal-redesign {
  max-width: 500px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.animation-header {
  padding: 2rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0.1), transparent);
  text-align: center;
}

.animation-header h3 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #60a5fa;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.7);
  margin: 0;
  letter-spacing: -0.02em;
}

.animation-body {
  padding: 2.5rem;
}

.time-progress-display {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.time-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
}

.time-label-small {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.time-value-display {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  font-family: "Courier New", monospace;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.time-value-display.new-time {
  color: #4ade80;
  text-shadow: 0 0 15px rgba(74, 222, 128, 0.6);
}

.countdown-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}

.countdown-circle {
  position: relative;
  width: 200px;
  height: 200px;
}

.countdown-circle svg {
  transform: rotate(-90deg);
}

.countdown-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.75rem;
  font-weight: 900;
  color: #3b82f6;
  font-family: "Courier New", monospace;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
  letter-spacing: 0.05em;
}

.animation-footer {
  padding: 2rem;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  background: linear-gradient(to top, rgba(59, 130, 246, 0.05), transparent);
  display: flex;
  justify-content: center;
}

.btn-accept-animation {
  padding: 1rem 3rem;
  font-size: 1.125rem;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  animation: fadeInUp 0.5s ease;
}

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

.btn-accept-animation:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.btn-cancel,
.btn-apply-code {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-apply-code {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-apply-code:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

/* Manufacturing info modal specific styles */
.manufacturing-info-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.large-timer-display {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 1rem;
  text-align: center;
}

.timer-value-large {
  font-size: 3rem;
  font-weight: 900;
  color: #3b82f6;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
  font-family: "Courier New", monospace;
  letter-spacing: 0.1em;
}

/* Delete confirmation modal */
.delete-modal {
  max-width: 500px;
}

.delete-modal .modal-header {
  border-bottom-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(to bottom, rgba(239, 68, 68, 0.08), transparent);
}

.delete-modal .modal-header h3 {
  color: #ef4444;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.7), 0 0 40px rgba(239, 68, 68, 0.4), 0 2px 8px rgba(0, 0, 0, 0.8);
}

.delete-warning {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: center;
  text-align: center;
}

.delete-warning svg {
  color: #ef4444;
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5));
}

.delete-warning p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  line-height: 1.6;
  margin: 0;
}

.delete-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.delete-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
