/* PWA Install Banner and Offline Mode Styling */
/* brave new art - Red (#FF0000), Black (#0D0D0D), White (#FFFFFF) */

/* Install Banner */
.pwa-banner {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  background: #0D0D0D;
  border-top: 2px solid #FF0000;
  padding: 1.5rem;
  box-shadow: 0 -4px 20px rgba(255, 0, 0, 0.2);
  z-index: 9999;
  transform: translateY(0);
  transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-banner--visible {
  bottom: 0;
}

.pwa-banner__content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pwa-banner__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: #FF0000;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

.pwa-banner__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: #FFFFFF;
}

.pwa-banner__text strong {
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
}

.pwa-banner__text span {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.pwa-banner__install {
  padding: 0.75rem 1.5rem;
  background: #FF0000;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pwa-banner__install:hover {
  background: #FF0000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.pwa-banner__install:active {
  transform: translateY(0);
}

.pwa-banner__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pwa-banner__close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .pwa-banner {
    padding: 1rem;
  }
  
  .pwa-banner__content {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .pwa-banner__icon {
    width: 40px;
    height: 40px;
  }
  
  .pwa-banner__text {
    flex: 1 1 100%;
    order: 2;
  }
  
  .pwa-banner__install {
    order: 3;
    flex: 1;
  }
  
  .pwa-banner__close {
    order: 1;
    margin-left: auto;
  }
}

/* Network Status Notifications */
.network-notification {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #0D0D0D;
  color: #FFFFFF;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 2px solid #FF0000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  font-weight: 400;
  transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.network-notification--visible {
  top: 1rem;
}

.network-notification--success {
  border-color: #FF0000;
  box-shadow: 0 4px 20px rgba(255, 0, 0, 0.2);
}

.network-notification--warning {
  border-color: #FF0000;
  box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3);
}

.network-notification--info {
  border-color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

/* Offline Mode Indicator */
.offline-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    45deg,
    #FF0000,
    #FF0000 10px,
    #0D0D0D 10px,
    #0D0D0D 20px
  );
  z-index: 9998;
  animation: offline-stripe 1s linear infinite;
}

@keyframes offline-stripe {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 28.28px 0;
  }
}

/* PWA Mode Adjustments */
.pwa-mode {
  /* Add safe area insets for notched devices */
  --safe-area-inset-top: env(safe-area-inset-top);
  --safe-area-inset-bottom: env(safe-area-inset-bottom);
}

.pwa-mode body {
  padding-top: var(--safe-area-inset-top, 0);
  padding-bottom: var(--safe-area-inset-bottom, 0);
}

/* Loading skeleton for offline cached content */
.content-loading {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s ease-in-out infinite;
}

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

/* Update Available Notification */
.update-notification {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: #0D0D0D;
  border: 2px solid #FF0000;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 1rem;
  transform: translateY(150%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.update-notification--visible {
  transform: translateY(0);
}

.update-notification__message {
  flex: 1;
}

.update-notification__button {
  padding: 0.5rem 1rem;
  background: #FF0000;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.update-notification__button:hover {
  background: #FF0000;
}

/* iOS specific styles */
@supports (-webkit-touch-callout: none) {
  .pwa-banner {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }
}
