/**
 * Service Worker Update Modal Styles
 */

/* Overlay do modal */
.sw-update-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 1rem;
}

.sw-update-modal-overlay.sw-update-modal-visible {
  opacity: 1;
  visibility: visible;
}

/* Container do modal */
.sw-update-modal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  transform: scale(0.9) translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.sw-update-modal-overlay.sw-update-modal-visible .sw-update-modal {
  transform: scale(1) translateY(0);
}

/* Header */
.sw-update-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.sw-update-modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
}

/* Body */
.sw-update-modal-body {
  padding: 1.5rem;
}

.sw-update-version {
  font-size: 1.1rem;
  color: #374151;
  margin-bottom: 1rem;
}

.sw-update-version strong {
  color: #2563eb;
  font-weight: 700;
}

.sw-update-changes {
  margin: 1rem 0;
}

.sw-update-changes p {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.sw-update-changes-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.sw-update-changes-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: #4b5563;
  line-height: 1.5;
}

.sw-update-changes-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: bold;
}

.sw-update-description {
  color: #6b7280;
  line-height: 1.6;
  margin: 1rem 0;
}

.sw-update-note {
  background-color: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 0.75rem;
  border-radius: 4px;
  margin-top: 1rem;
}

.sw-update-note small {
  color: #92400e;
  font-size: 0.875rem;
}

/* Footer */
.sw-update-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Botões */
.sw-update-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9375rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.sw-update-btn-primary {
  background-color: #2563eb;
  color: white;
}

.sw-update-btn-primary:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.sw-update-btn-primary:active {
  transform: translateY(0);
}

.sw-update-btn-secondary {
  background-color: #f3f4f6;
  color: #374151;
}

.sw-update-btn-secondary:hover {
  background-color: #e5e7eb;
}

/* Responsivo */
@media (max-width: 640px) {
  .sw-update-modal {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }

  .sw-update-modal-header h3 {
    font-size: 1.25rem;
  }

  .sw-update-modal-footer {
    flex-direction: column-reverse;
  }

  .sw-update-btn {
    width: 100%;
  }
}

/* Animação de loading (opcional, para feedback visual) */
.sw-update-btn-primary.loading {
  position: relative;
  color: transparent;
}

.sw-update-btn-primary.loading:after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: sw-update-spin 0.6s linear infinite;
}

@keyframes sw-update-spin {
  to {
    transform: rotate(360deg);
  }
}
