/* PWA Styling */

/* Install Button */
.pwa-install-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  animation: slideUp 0.3s ease-out;
}

.pwa-install-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.pwa-install-button:active {
  transform: scale(0.95);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Online Status Indicator */
.pwa-online-status {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 99999;
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.pwa-online-status.online {
  background: rgba(34, 197, 94, 0.9);
  color: white;
  animation: slideInLeft 0.3s ease-out;
}

.pwa-online-status.offline {
  background: rgba(239, 68, 68, 0.9);
  color: white;
  animation: slideInLeft 0.3s ease-out, pulse 2s infinite;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* Responsive */
@media (max-width: 768px) {
  .pwa-install-button {
    bottom: 10px;
    right: 10px;
    padding: 10px 16px;
    font-size: 12px;
  }

  .pwa-online-status {
    top: 10px;
    left: 10px;
    font-size: 11px;
    padding: 8px 12px;
  }
}

/* Refresh Button */
.pwa-refresh-button {
  display: inline-block;
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.pwa-refresh-button:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

.pwa-refresh-button.loading {
  opacity: 0.6;
  cursor: not-allowed;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Loading State */
.pwa-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* Cache indicator */
.pwa-cached-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #fbbf24;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
  title: "Tato data jsou z cache";
}

/* Toast notifications */
.pwa-toast {
  position: fixed;
  bottom: 100px;
  right: 20px;
  background: #333;
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  z-index: 99998;
  animation: slideUp 0.3s ease-out;
  max-width: 300px;
  word-wrap: break-word;
}

.pwa-toast.success {
  background: #22c55e;
}

.pwa-toast.error {
  background: #ef4444;
}

.pwa-toast.warning {
  background: #f59e0b;
}

.pwa-toast.info {
  background: #3b82f6;
}

/* Modal Overlay */
.pwa-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.pwa-modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.pwa-modal-content h2 {
  margin-bottom: 12px;
  color: #333;
  font-size: 20px;
}

.pwa-modal-content p {
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

.pwa-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.pwa-modal-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.pwa-modal-buttons .primary {
  background: #667eea;
  color: white;
}

.pwa-modal-buttons .primary:hover {
  background: #5568d3;
}

.pwa-modal-buttons .secondary {
  background: #f0f0f0;
  color: #333;
}

.pwa-modal-buttons .secondary:hover {
  background: #e0e0e0;
}
