/* Custom styles beyond Tailwind */
html {
  scroll-behavior: smooth;
}

.resource-item {
  transition: all 0.2s ease;
}

.resource-item:hover {
  transform: translateY(-2px);
}

/* Animation for QR Scanner */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

.pulse-animation {
  animation: pulse 2s infinite;
}

/* Loading spinner */
.spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 3px solid #3b82f6;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

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

/* Fade in animation for new items */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Dark mode toggle */
.dark-mode-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #3b82f6;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  z-index: 100;
}

.dark-mode-toggle svg {
  width: 24px;
  height: 24px;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  max-width: 90%;
  padding: 12px 16px;
  border-radius: 8px;
  background-color: #3b82f6;
  color: white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: fadeInUp 0.3s, fadeOut 0.3s 2.7s forwards;
  text-align: center;
}

@keyframes fadeInUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

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

/* QR code styling */
.qr-code {
  background-color: white;
  padding: 10px;
  border-radius: 8px;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Offline badge styling */
.offline-badge {
  padding: 2px 8px;
  border-radius: 4px;
  background-color: #fee2e2;
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Enhanced Data Transfer Animation */
.data-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  background-color: #3b82f6;
  border-radius: 50%;
  opacity: 0.8;
  z-index: 1000;
  box-shadow: 0 0 5px #3b82f6, 0 0 10px #3b82f6;
  pointer-events: none;
}

.data-particle.byte {
  width: 4px;
  height: 4px;
  background-color: #10b981;
  box-shadow: 0 0 5px #10b981, 0 0 10px #10b981;
}

.data-particle.bit {
  width: 3px;
  height: 3px;
  background-color: #f59e0b;
  box-shadow: 0 0 4px #f59e0b, 0 0 8px #f59e0b;
}

.data-particle.packet {
  width: 6px;
  height: 6px;
  background-color: #8b5cf6;
  box-shadow: 0 0 6px #8b5cf6, 0 0 12px #8b5cf6;
}

.data-stream {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.6), rgba(59, 130, 246, 0.8), rgba(59, 130, 246, 0.6));
  opacity: 0.7;
  z-index: 999;
  border-radius: 1px;
  transform-origin: left center;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
  pointer-events: none;
}

@keyframes particleBlink {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0.4; }
}

@keyframes particlePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes particleFadeOut {
  0% { opacity: 0.8; }
  100% { opacity: 0; }
}

@keyframes streamStretch {
  0% { transform: scaleX(0); opacity: 0.7; }
  50% { opacity: 1; }
  100% { transform: scaleX(1); opacity: 0.7; }
}

.transfer-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.resource-transfer-animation {
  position: absolute;
  z-index: 1001;
  transition: all 1.5s cubic-bezier(0.215, 0.610, 0.355, 1.000);
  transform-origin: center;
  pointer-events: none;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-transfer-animation::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(59, 130, 246, 0) 70%);
  border-radius: 50%;
  z-index: -1;
  animation: pulse 2s infinite;
}

.data-binary {
  position: absolute;
  font-family: monospace;
  font-size: 10px;
  color: rgba(59, 130, 246, 0.8);
  text-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
  pointer-events: none;
  z-index: 1000;
  opacity: 0.8;
  animation: particleFadeOut 1.5s forwards;
  white-space: nowrap;
}