/* PWA Styles */

/* Install Prompt */
.pwa-install-prompt {
  position: fixed;
  bottom: -100px;
  left: 20px;
  right: 20px;
  max-width: 400px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e5e9;
  z-index: 9999;
  transition: bottom 0.3s ease-in-out;
}

.pwa-install-prompt.show {
  bottom: 20px;
}

.pwa-install-content {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.pwa-install-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #007cba;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.pwa-install-text {
  flex: 1;
}

.pwa-install-text h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e1e1e;
}

.pwa-install-text p {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

.pwa-install-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Buttons */
.pwa-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

.pwa-btn-primary {
  background: #007cba;
  color: white;
}

.pwa-btn-primary:hover {
  background: #005a87;
}

.pwa-btn-secondary {
  background: #f6f7f7;
  color: #666;
  border: 1px solid #ddd;
}

.pwa-btn-secondary:hover {
  background: #e9ecef;
}

.pwa-btn-small {
  padding: 6px 12px;
  font-size: 12px;
  min-width: 60px;
}

/* Connection Status */
.pwa-connection-status {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  animation: slideInRight 0.3s ease-out;
}

.pwa-status-content {
  background: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e5e9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-status-offline .pwa-status-content {
  background: #dc3545;
  color: white;
  border-color: #dc3545;
}

.pwa-status-online .pwa-status-content {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

.pwa-status-text {
  font-size: 14px;
  font-weight: 500;
}

/* Update Notification */
.pwa-update-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  animation: slideInDown 0.3s ease-out;
}

.pwa-update-content {
  background: #007cba;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-update-text {
  font-size: 14px;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 480px) {
  .pwa-install-prompt {
    left: 10px;
    right: 10px;
    bottom: -120px;
  }

  .pwa-install-prompt.show {
    bottom: 10px;
  }

  .pwa-install-content {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .pwa-install-actions {
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }

  .pwa-connection-status {
    right: 10px;
    top: 10px;
  }
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .pwa-install-prompt {
    background: #2d3748;
    border-color: #4a5568;
  }

  .pwa-install-text h3 {
    color: #f7fafc;
  }

  .pwa-install-text p {
    color: #a0aec0;
  }

  .pwa-btn-secondary {
    background: #4a5568;
    color: #f7fafc;
    border-color: #718096;
  }

  .pwa-btn-secondary:hover {
    background: #2d3748;
  }

  .pwa-status-content {
    background: #2d3748;
    border-color: #4a5568;
    color: #f7fafc;
  }
}

/* Loading states */
.pwa-loading {
  opacity: 0.7;
  pointer-events: none;
}

.pwa-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007cba;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
