/**
 * Cache & Offline Notifications
 */

.cache-update-notification,
.offline-notification,
.online-notification {
  position: fixed;
  bottom: -100px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transition: bottom 0.3s ease;
  font-weight: 500;
  max-width: 300px;
}

.cache-update-notification.show,
.offline-notification.show,
.online-notification.show {
  bottom: 20px;
}

/* Cache update notification */
.cache-update-notification {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.cache-update-notification .notification-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cache-update-notification p {
  margin: 0;
  font-size: 14px;
}

.cache-update-notification button {
  padding: 6px 12px;
  background: white;
  color: #667eea;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  transition: transform 0.2s ease;
}

.cache-update-notification button:hover {
  transform: scale(1.05);
}

/* Offline notification */
.offline-notification {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.offline-notification .notification-content p {
  margin: 0;
  font-size: 14px;
}

/* Online notification */
.online-notification {
  background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
  color: #333;
}

.online-notification .notification-content p {
  margin: 0;
  font-size: 14px;
  color: #333;
}

/* Animation for entrance */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cache-update-notification.show,
.offline-notification.show,
.online-notification.show {
  animation: slideUp 0.3s ease forwards;
}

/* Responsive */
@media (max-width: 600px) {
  .cache-update-notification,
  .offline-notification,
  .online-notification {
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .cache-update-notification .notification-content {
    flex-direction: column;
    gap: 8px;
  }

  .cache-update-notification button {
    width: 100%;
  }
}

/* Skeleton loading for cached content */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Cache badge */
.cache-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #667eea;
  color: white;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.cache-badge.offline {
  background: #f5576c;
}

/* Service worker status indicator */
.sw-status {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #84fab0;
  box-shadow: 0 0 8px rgba(132, 250, 176, 0.5);
  z-index: 1000;
}

.sw-status.loading {
  background: #f5a623;
  animation: pulse 1s infinite;
}

.sw-status.error {
  background: #f5576c;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
