/* Toast Notification System */

/* Container for all toasts - positioned in top-right */
.toast-container {
  position: fixed;
  top: 80px; /* Below navbar */
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none; /* Allow clicking through container */
}

/* Individual toast */
.toast {
  min-width: 300px;
  max-width: 400px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
  pointer-events: auto; /* Make toast clickable */
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast:hover {
  transform: translateX(-4px);
}

.toast.removing {
  animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Toast animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(400px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(400px);
  }
}

/* Toast icon */
.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

/* Toast content */
.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-message {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
}

.toast-description {
  font-size: 13px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.8);
}

/* Progress bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  transition: width linear;
}

/* Toast types */
.toast.success {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.95) 0%, rgba(56, 142, 60, 0.95) 100%);
}

.toast.success .toast-progress {
  background: rgba(255, 255, 255, 0.4);
}

.toast.error {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.95) 0%, rgba(211, 47, 47, 0.95) 100%);
}

.toast.error .toast-progress {
  background: rgba(255, 255, 255, 0.4);
}

.toast.info {
  background: linear-gradient(135deg, rgba(97, 218, 251, 0.95) 0%, rgba(33, 150, 243, 0.95) 100%);
}

.toast.info .toast-progress {
  background: rgba(255, 255, 255, 0.4);
}

.toast.warning {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.95) 0%, rgba(245, 124, 0, 0.95) 100%);
}

.toast.warning .toast-progress {
  background: rgba(255, 255, 255, 0.4);
}

/* Username Modal */
.username-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.username-modal-overlay.show {
  display: flex;
}

.username-modal-content {
  background: linear-gradient(135deg, #2c313c 0%, #232830 100%);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 400px;
  width: 90%;
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.username-modal-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  color: #61dafb;
  text-align: center;
}

.username-modal-content p {
  margin: 0 0 1.5rem 0;
  color: #aaa;
  text-align: center;
  font-size: 0.95rem;
}

.username-modal-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  margin-bottom: 1.5rem;
}

.username-modal-input:focus {
  border-color: #61dafb;
}

.username-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.username-modal-btn {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.username-modal-btn.cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.username-modal-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}

.username-modal-btn.submit {
  background: #61dafb;
  color: #000;
}

.username-modal-btn.submit:hover {
  background: #52c0e8;
  transform: scale(1.05);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .toast-container {
    right: 10px;
    left: 10px;
    top: 70px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }

  .username-modal-content {
    padding: 1.5rem;
  }
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .toast,
  .username-modal-overlay,
  .username-modal-content {
    animation-duration: 0.01ms !important;
  }
}
