/* Serial Number Modal Styles */
.serial-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.serial-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.serial-modal-card {
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 3rem;
  width: 100%;
  max-width: 480px;
  text-align: center;
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(161, 140, 209, 0.15);
  position: relative;
  overflow: hidden;
}

.serial-modal-overlay.active .serial-modal-card {
  transform: translateY(0) scale(1);
}

.serial-modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.serial-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
}

.serial-modal-close:hover {
  color: #fff;
}

.serial-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, rgba(161, 140, 209, 0.2) 0%, rgba(251, 194, 235, 0.2) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbc2eb;
}

.serial-modal-title {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #a8a8a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.serial-modal-subtitle {
  color: #a0a0a0;
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.serial-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.serial-input-group span {
  color: #555;
  font-weight: bold;
  font-size: 1.5rem;
}

.serial-input {
  width: 120px;
  height: 60px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 4px;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 600;
  transition: all 0.3s ease;
  outline: none;
}

.serial-input:focus {
  border-color: #a18cd1;
  box-shadow: 0 0 20px rgba(161, 140, 209, 0.3);
  transform: translateY(-2px);
}

.serial-input:invalid {
  box-shadow: none;
}

.serial-input.error {
  border-color: #ff5f56;
  animation: shake 0.5s;
}

.serial-input.success {
  border-color: #27c93f;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.serial-btn {
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
  color: #111;
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 1rem;
  box-shadow: 0 5px 15px rgba(161, 140, 209, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.serial-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(161, 140, 209, 0.4);
}

.serial-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.serial-btn svg {
  width: 20px;
  height: 20px;
}

.serial-message {
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 20px;
  color: #ff5f56;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.serial-message.visible {
  opacity: 1;
}

.serial-message.success-msg {
  color: #27c93f;
}

/* Spinner for Loading State */
.spinner {
  border: 3px solid rgba(0,0,0,0.1);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border-left-color: #111;
  animation: spin 1s linear infinite;
  display: none;
}

.serial-btn.loading .spinner {
  display: inline-block;
}
.serial-btn.loading .btn-text-normal {
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
