/**
 * Update Notification Styles
 *
 * Styles for PWA update notifications:
 * - Toast notifications (non-intrusive)
 * - Modal prompts (critical updates)
 * - Animations (smooth transitions)
 */

/* ============================================================================
   TOAST NOTIFICATION
   ========================================================================== */

.update-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
  z-index: 1000;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 400px;
  font-size: 14px;
  line-height: 1.4;
  backdrop-filter: blur(10px);
}

.update-notification-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.update-notification-content p {
  margin: 0;
  font-weight: 500;
}

.update-notification-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.update-btn-reload,
.update-btn-dismiss {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.update-btn-reload {
  background: white;
  color: #667eea;
}

.update-btn-reload:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.update-btn-reload:active {
  transform: translateY(0);
}

.update-btn-dismiss {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 8px;
  min-width: 28px;
}

.update-btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .update-notification {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .update-notification-actions {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .update-btn-reload {
    flex-grow: 1;
  }
}

/* ============================================================================
   MODAL OVERLAY & CONTENT
   ========================================================================== */

.update-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(2px);
}

.update-modal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  margin: 20px;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.update-modal-content {
  padding: 32px 24px;
}

.update-modal-content h2 {
  margin: 0 0 16px 0;
  font-size: 22px;
  color: #333;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.update-modal-content p {
  margin: 0 0 12px 0;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.update-changelog {
  margin: 16px 0;
  padding-left: 20px;
  list-style: none;
  color: #555;
  font-size: 13px;
}

.update-changelog li {
  margin: 8px 0;
  padding-left: 20px;
  position: relative;
}

.update-changelog li:before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #667eea;
  font-weight: bold;
}

.update-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

.update-btn-now,
.update-btn-later {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.update-btn-now {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  flex-grow: 1;
}

.update-btn-now:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.update-btn-now:active {
  transform: translateY(0);
}

.update-btn-later {
  background: #f0f0f0;
  color: #333;
  flex-grow: 1;
}

.update-btn-later:hover {
  background: #e0e0e0;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .update-modal-content {
    padding: 24px 16px;
  }

  .update-modal-content h2 {
    font-size: 20px;
  }

  .update-modal-actions {
    flex-direction: column;
    gap: 10px;
  }

  .update-btn-now,
  .update-btn-later {
    width: 100%;
  }
}

/* ============================================================================
   TEMPORARY TOAST
   ========================================================================== */

.update-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
  animation: slideDown 0.3s ease;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(10px);
}

/* ============================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes slideUp {
  from {
    transform: translateY(120px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .update-notification,
  .update-modal,
  .update-toast,
  .update-btn-reload,
  .update-btn-now {
    animation: none !important;
    transition: none !important;
  }
}

@media (prefers-color-scheme: dark) {
  .update-modal {
    background: #2a2a2a;
    color: #fff;
  }

  .update-modal-content h2 {
    color: #fff;
  }

  .update-modal-content p {
    color: #ccc;
  }

  .update-changelog {
    color: #bbb;
  }

  .update-btn-later {
    background: #3a3a3a;
    color: #fff;
  }

  .update-btn-later:hover {
    background: #4a4a4a;
  }
}

/* ============================================================================
   HIGH CONTRAST MODE
   ========================================================================== */

@media (prefers-contrast: more) {
  .update-notification {
    border: 2px solid white;
  }

  .update-modal {
    border: 3px solid #333;
  }

  .update-btn-reload,
  .update-btn-now,
  .update-btn-later {
    border: 2px solid currentColor;
  }
}
