/* ============================================
   GESTION-DE-PIEZAS2.CSS
   Contenido principal: Secciones, tarjetas, temporizadores, notificaciones
   ============================================ */

/* Content Section */
.content-section {
  padding: 2rem 0 3rem;
  min-height: 80vh;
  position: relative;
  z-index: 1;
}

.gestion-piezas-section {
  background: transparent;
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 97, 255, 0.1));
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-radius: 50%;
  margin-bottom: var(--space-lg);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.6);
  }
}

.page-icon-wrapper svg {
  color: var(--color-primary);
  filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.8));
}

.page-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  text-align: center;
  text-transform: uppercase;
}

.page-title span {
  display: block;
}

.page-title .highlight {
  background: linear-gradient(135deg, var(--color-primary), #7b61ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
}

.page-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
  text-align: center;
  letter-spacing: 0.05em;
}

/* Pieces Sections */
.pieces-section {
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 1rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.section-icon {
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon.pending {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
  border: 2px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.section-icon.manufacturing {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.2));
  border: 2px solid rgba(59, 130, 246, 0.4);
  color: #3b82f6;
}

.section-icon.completed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
  border: 2px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.section-title {
  flex: 1;
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.pieces-count {
  font-size: 2rem;
  font-weight: 800;
  color: #3b82f6;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  min-width: 3rem;
  text-align: right;
}

.pieces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.piece-card {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 1rem;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.piece-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
  border-color: rgba(59, 130, 246, 0.4);
}

.piece-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.piece-icon-large {
  font-size: 2rem;
}

.piece-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #3b82f6;
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
  margin-bottom: 1.25rem;
}

.piece-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

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

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

.piece-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
}

.piece-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
}

.piece-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* Clickable piece cards in pending section */
.piece-card.clickable {
  cursor: pointer;
}

.piece-card.clickable:hover {
  border-color: #3b82f6;
  box-shadow: 0 15px 50px rgba(59, 130, 246, 0.4);
}

/* Manufacturing timer styles */
.piece-timer {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 0.5rem;
  text-align: center;
}

.timer-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timer-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #3b82f6;
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
  font-family: "Courier New", monospace;
}

.engineer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #3b82f6;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Notification System */
.notification {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 10000; /* Increased z-index from 100 to 10000 to ensure notifications appear above modals (which have z-index: 1000) */
  min-width: 300px;
  max-width: 400px;
  background: rgba(0, 0, 0, 0.95);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideIn 0.3s ease;
}

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

.notification-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notification-message {
  flex: 1;
  color: #ffffff;
  font-size: 0.875rem;
}

.notification-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: background 0.2s;
}

.notification-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.notification.success {
  border-left: 4px solid #3b82f6;
}

.notification.error {
  border-left: 4px solid #ef4444;
}

/* Styles for manufacturing and completed piece cards */
.piece-card-manufacturing {
  position: relative;
}

/* Redesigned completed piece styles with professional stat boxes */
.piece-card-completed {
  position: relative;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
  border: 2px solid rgba(16, 185, 129, 0.3);
}

.piece-card-completed:hover {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 15px 50px rgba(16, 185, 129, 0.3);
}

.piece-timer-large {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  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;
}

.large-piece-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.large-piece-icon {
  font-size: 3rem;
}

.large-piece-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: #3b82f6;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

.large-timer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timer-value-large {
  font-size: 2.5rem;
  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;
}

.start-time-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.completed-piece-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
}

.completed-piece-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.completed-piece-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.4));
}

.completed-piece-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #10b981;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
  text-align: center;
  margin: 0;
}

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

.completed-stat-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.3s ease;
}

.completed-stat-box:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

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

.completed-stat-value {
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.02em;
}

.completed-stat-value.performance {
  color: #10b981;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}

.completed-stat-value.failure {
  color: #3b82f6;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

.completed-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.2));
  border: 2px solid rgba(16, 185, 129, 0.5);
  border-radius: 0.75rem;
  font-size: 1rem;
  color: #10b981;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.completed-badge svg {
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.6));
}

/* Delete design button */
.delete-design-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.delete-design-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: rgba(239, 68, 68, 0.6);
  transform: scale(1.1);
}

.delete-design-btn svg {
  flex-shrink: 0;
}

/* Additional utility styles */
.btn-cancel {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.btn-apply-code {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #10b981;
  color: #ffffff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
}

.btn-apply-code:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-apply-code svg {
  flex-shrink: 0;
}
