/**
 * @file
 * Push notification UI styles.
 */

/* Notification Permission Prompt */
.sandmark-notification-prompt {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: white;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sandmark-notification-prompt.is-visible {
  transform: translateY(0);
}

.sandmark-notification-prompt__content {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem;
  text-align: center;
}

.sandmark-notification-prompt__icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: bell-ring 2s ease infinite;
}

@keyframes bell-ring {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(15deg); }
  20% { transform: rotate(-15deg); }
  30% { transform: rotate(10deg); }
  40% { transform: rotate(-10deg); }
  50% { transform: rotate(5deg); }
  60% { transform: rotate(-5deg); }
  70% { transform: rotate(0); }
}

.sandmark-notification-prompt__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.sandmark-notification-prompt__text {
  font-size: 0.9375rem;
  color: #6b7280;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.sandmark-notification-prompt__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.sandmark-notification-prompt__btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.sandmark-notification-prompt__btn--primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.sandmark-notification-prompt__btn--primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sandmark-notification-prompt__btn--secondary {
  background: #f3f4f6;
  color: #374151;
}

.sandmark-notification-prompt__btn--secondary:hover {
  background: #e5e7eb;
}

/* Foreground Notification */
.sandmark-foreground-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  max-width: 400px;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  cursor: pointer;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sandmark-foreground-notification.is-visible {
  transform: translateX(0);
}

.sandmark-foreground-notification:hover {
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.sandmark-foreground-notification__content {
  display: flex;
  align-items: center;
  padding: 1rem;
  gap: 1rem;
}

.sandmark-foreground-notification__image {
  width: 60px;
  height: 60px;
  border-radius: 0.5rem;
  object-fit: cover;
  flex-shrink: 0;
}

.sandmark-foreground-notification__text {
  flex: 1;
  min-width: 0;
}

.sandmark-foreground-notification__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sandmark-foreground-notification__body {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sandmark-foreground-notification__close {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sandmark-foreground-notification__close:hover {
  background: #e5e7eb;
  color: #374151;
}

/* Settings Panel */
.sandmark-push-settings {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
}

.sandmark-push-settings__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
}

.sandmark-push-settings__status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.sandmark-push-settings__status-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.sandmark-push-settings__status-icon.is-enabled {
  background: #d1fae5;
}

.sandmark-push-settings__status-icon.is-disabled {
  background: #fee2e2;
}

.sandmark-push-settings__status-text {
  font-weight: 600;
  color: #374151;
}

.sandmark-push-settings__status-label {
  font-size: 0.75rem;
  color: #6b7280;
}

.sandmark-push-settings__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.sandmark-push-settings__toggle:last-child {
  border-bottom: none;
}

/* Toggle Switch */
.sandmark-toggle {
  position: relative;
  width: 3rem;
  height: 1.75rem;
  cursor: pointer;
}

.sandmark-toggle__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.sandmark-toggle__slider {
  position: absolute;
  inset: 0;
  background: #e5e7eb;
  border-radius: 1.75rem;
  transition: background 0.2s ease;
}

.sandmark-toggle__slider::after {
  content: '';
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sandmark-toggle__input:checked + .sandmark-toggle__slider {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.sandmark-toggle__input:checked + .sandmark-toggle__slider::after {
  transform: translateX(1.25rem);
}

/* Responsive */
@media (max-width: 640px) {
  .sandmark-notification-prompt__actions {
    flex-direction: column;
  }

  .sandmark-notification-prompt__btn {
    width: 100%;
  }

  .sandmark-foreground-notification {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .sandmark-notification-prompt {
    background: #1f2937;
  }

  .sandmark-notification-prompt__title {
    color: #f9fafb;
  }

  .sandmark-notification-prompt__text {
    color: #9ca3af;
  }

  .sandmark-notification-prompt__btn--secondary {
    background: #374151;
    color: #e5e7eb;
  }

  .sandmark-notification-prompt__btn--secondary:hover {
    background: #4b5563;
  }

  .sandmark-foreground-notification {
    background: #1f2937;
  }

  .sandmark-foreground-notification__title {
    color: #f9fafb;
  }

  .sandmark-foreground-notification__body {
    color: #9ca3af;
  }

  .sandmark-foreground-notification__close {
    background: #374151;
    color: #9ca3af;
  }

  .sandmark-foreground-notification__close:hover {
    background: #4b5563;
    color: #e5e7eb;
  }

  .sandmark-push-settings {
    background: #1f2937;
    border-color: #374151;
  }

  .sandmark-push-settings__title {
    color: #f9fafb;
  }

  .sandmark-push-settings__status {
    background: #111827;
  }

  .sandmark-push-settings__toggle {
    border-color: #374151;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .sandmark-notification-prompt,
  .sandmark-foreground-notification,
  .sandmark-notification-prompt__btn,
  .sandmark-toggle__slider,
  .sandmark-toggle__slider::after {
    transition: none;
  }

  .sandmark-notification-prompt__icon {
    animation: none;
  }
}
