/**
 * PWA Installation UI Styles
 * Beautiful install banner and notification styles
 */

/* ========================================
   PWA INSTALL BANNER
======================================== */

.pwa-install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
  opacity: 0;
  transition: all 0.3s ease-out;
  margin-top: 0;
  animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pwa-install-banner.show {
  display: flex;
  opacity: 1;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 8px 0;
}

.pwa-banner-icon {
  flex-shrink: 0;
  font-size: 24px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.pwa-banner-text {
  flex: 1;
  min-width: 200px;
}

.pwa-banner-text h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}

.pwa-banner-text p {
  margin: 0;
  font-size: 13px;
  opacity: 0.95;
  color: rgba(255, 255, 255, 0.9);
}

.pwa-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-install,
.btn-dismiss {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-install {
  background: rgba(255, 255, 255, 0.95);
  color: #0ea5e9;
}

.btn-install:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-install:active {
  transform: translateY(0);
}

.btn-dismiss {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-dismiss:active {
  background: rgba(255, 255, 255, 0.15);
}

/* ========================================
   PWA INSTALL BUTTON (for placement in UI)
======================================== */

.pwa-install-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.pwa-install-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.pwa-install-button:active {
  transform: translateY(0);
}

.pwa-install-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ========================================
   PWA NOTIFICATIONS
======================================== */

.pwa-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 16px 24px;
  min-width: 320px;
  max-width: 500px;
  opacity: 0;
  transform: translateY(100px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: none;
}

.pwa-notification.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(100px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.pwa-notif-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pwa-notif-content strong {
  font-size: 14px;
  color: #0f172a;
  margin: 0;
}

.pwa-notif-content p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

/* Notification Types */
.pwa-notification-success {
  border-left: 4px solid #10b981;
  background: linear-gradient(to right, rgba(16, 185, 129, 0.05), white);
}

.pwa-notification-success .pwa-notif-content strong {
  color: #10b981;
}

.pwa-notification-error {
  border-left: 4px solid #ef4444;
  background: linear-gradient(to right, rgba(239, 68, 68, 0.05), white);
}

.pwa-notification-error .pwa-notif-content strong {
  color: #ef4444;
}

.pwa-notification-info {
  border-left: 4px solid #0ea5e9;
  background: linear-gradient(to right, rgba(14, 165, 233, 0.05), white);
}

.pwa-notification-info .pwa-notif-content strong {
  color: #0ea5e9;
}

.pwa-notification-warning {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(to right, rgba(245, 158, 11, 0.05), white);
}

.pwa-notification-warning .pwa-notif-content strong {
  color: #f59e0b;
}

/* ========================================
   PWA STATUS INDICATOR (optional)
======================================== */

.pwa-status-indicator {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 999;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  }
  50% {
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.8);
  }
}

.pwa-status-indicator.offline {
  background: #ef4444;
}

.pwa-status-indicator.offline {
  animation: pulse-red 1s ease-in-out infinite;
}

@keyframes pulse-red {
  0%, 100% {
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  }
  50% {
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.8);
  }
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
======================================== */

@media (max-width: 768px) {
  .pwa-install-banner {
    padding: 10px 12px;
  }

  .pwa-banner-content {
    gap: 12px;
  }

  .pwa-banner-text h5 {
    font-size: 14px;
  }

  .pwa-banner-text p {
    font-size: 12px;
  }

  .btn-install,
  .btn-dismiss {
    padding: 6px 12px;
    font-size: 12px;
  }

  .pwa-notification {
    bottom: 16px;
    right: 16px;
    min-width: 280px;
    padding: 12px 16px;
  }

  .pwa-notif-content strong {
    font-size: 13px;
  }

  .pwa-notif-content p {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .pwa-install-banner {
    padding: 8px 10px;
  }

  .pwa-banner-content {
    gap: 10px;
    padding: 6px 0;
  }

  .pwa-banner-icon {
    font-size: 20px;
  }

  .pwa-banner-text h5 {
    font-size: 13px;
    margin-bottom: 2px;
  }

  .pwa-banner-text p {
    font-size: 11px;
  }

  .btn-install,
  .btn-dismiss {
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
  }

  .pwa-notification {
    bottom: 12px;
    right: 12px;
    left: 12px;
    min-width: unset;
    max-width: unset;
    padding: 12px 16px;
  }
}

/* ========================================
   DARK MODE SUPPORT
======================================== */

@media (prefers-color-scheme: dark) {
  .pwa-notification {
    background: #1e293b;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }

  .pwa-notif-content strong {
    color: #f1f5f9;
  }

  .pwa-notif-content p {
    color: #cbd5e1;
  }

  .pwa-notification-success,
  .pwa-notification-error,
  .pwa-notification-info,
  .pwa-notification-warning {
    background: #1e293b;
  }
}

/* ========================================
   PRINT STYLES
======================================== */

@media print {
  .pwa-install-banner,
  .pwa-notification,
  .pwa-status-indicator,
  .pwa-install-button {
    display: none !important;
  }
}
