/**
 * PWA Components Styles
 * Styles for install button, connection status, and offline banner
 */

/* ============================================
   Connection Status Indicator
   ============================================ */

.connection-status {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  z-index: 1000;
  transition: all 0.3s ease;
}

.connection-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  transition: background 0.3s ease;
}

.connection-status.connected .status-dot {
  background: #2BAC76; /* Success Green */
  box-shadow: 0 0 4px rgba(43, 172, 118, 0.5);
}

.connection-status.connecting .status-dot {
  background: #F2C744; /* Yellow */
  animation: pulse 1.5s ease-in-out infinite;
}

.connection-status.offline .status-dot {
  background: #E01E5A; /* Error Red */
}

.connection-status .status-text {
  font-weight: 500;
  color: #1D1C1D;
}

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

/* ============================================
   Offline Banner
   ============================================ */

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  background: #E01E5A; /* Error Red */
  color: white;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  animation: slideDown 0.3s ease-out;
}

.offline-banner svg {
  flex-shrink: 0;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   PWA Install Button
   ============================================ */

.pwa-install-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #4A154B; /* Primary Purple */
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(74, 21, 75, 0.3);
  transition: all 0.2s ease;
  z-index: 999;
}

.pwa-install-btn:hover {
  background: #3F0E40; /* Darker purple */
  box-shadow: 0 6px 16px rgba(74, 21, 75, 0.4);
  transform: translateY(-2px);
}

.pwa-install-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(74, 21, 75, 0.3);
}

.pwa-install-btn svg {
  flex-shrink: 0;
}

/* ============================================
   PWA Install Success Toast
   ============================================ */

.pwa-install-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #2BAC76; /* Success Green */
  color: white;
  border-radius: 8px;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1002;
  opacity: 0;
  transition: all 0.3s ease;
}

.pwa-install-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.pwa-install-toast svg {
  flex-shrink: 0;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet and below */
@media (max-width: 768px) {
  .connection-status {
    top: 8px;
    right: 8px;
    font-size: 13px;
    padding: 6px 10px;
  }

  .connection-status .status-text {
    display: none; /* Show only dot on mobile */
  }

  .offline-banner {
    font-size: 13px;
    padding: 10px 16px;
  }

  .pwa-install-btn {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 14px;
  }

  .pwa-install-toast {
    max-width: 90%;
    font-size: 14px;
  }
}

/* Mobile only */
@media (max-width: 480px) {
  .offline-banner {
    font-size: 12px;
    padding: 8px 12px;
  }

  .offline-banner svg {
    width: 16px;
    height: 16px;
  }

  .pwa-install-btn span {
    display: none; /* Show only icon on very small screens */
  }

  .pwa-install-btn {
    padding: 12px;
    border-radius: 50%;
  }
}

/* Standalone mode (when installed as PWA) */
@media (display-mode: standalone) {
  .pwa-install-btn {
    display: none !important; /* Never show install button in installed app */
  }
}
