/* UI Enhancements - Loading, Errors, Onboarding */

/* Loading Spinner */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 224, 255, 0.2);
  border-top-color: #00e0ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loader-content {
  text-align: center;
  color: #fff;
}

.loader-content p {
  margin-top: 1rem;
  font-size: 1.1rem;
}

/* Error States */
.error-state, .synapse-error, .synapse-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: #fff;
  min-height: 200px;
}

.error-state i, .synapse-error i {
  font-size: 3rem;
  color: #ff6b6b;
  margin-bottom: 1rem;
}

.synapse-empty i {
  font-size: 4rem;
  color: #00e0ff;
  margin-bottom: 1rem;
}

.error-state p, .synapse-error p, .synapse-empty p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.8);
}

.synapse-empty h3 {
  color: #00e0ff;
  margin-bottom: 0.5rem;
}

.retry-btn {
  background: #00e0ff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-btn:hover {
  background: #00f0ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 224, 255, 0.4);
}

/* Dashboard Error */
.dashboard-error {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.error-content {
  text-align: center;
  color: #fff;
  max-width: 500px;
  padding: 2rem;
}

.error-content i {
  font-size: 4rem;
  color: #ff6b6b;
  margin-bottom: 1rem;
}

.error-content h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

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

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

/* Onboarding Modal */
.onboarding-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.3s ease;
}

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

.onboarding-content {
  background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
  border: 1px solid rgba(0, 224, 255, 0.3);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 224, 255, 0.2);
}

.onboarding-header {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.onboarding-header h2 {
  color: #00e0ff;
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00e0ff, #00f0ff);
  transition: width 0.3s ease;
  width: 25%;
}

.step-indicator {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  text-align: center;
}

.onboarding-body {
  padding: 2rem;
  min-height: 300px;
}

.onboarding-step {
  animation: slideIn 0.3s ease;
}

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

.welcome-step {
  text-align: center;
}

.welcome-step h3 {
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.welcome-step p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(0, 224, 255, 0.05);
  border: 1px solid rgba(0, 224, 255, 0.2);
  border-radius: 8px;
}

.feature-item i {
  font-size: 1.5rem;
  color: #00e0ff;
}

.feature-item span {
  color: #fff;
}

.profile-step h3, .skills-step h3, .interests-step h3 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.profile-step p, .skills-step p, .interests-step p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #00e0ff;
  box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.1);
}

.skill-suggestions, .interest-suggestions {
  margin-top: 1rem;
}

.skill-suggestions p, .interest-suggestions p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.skill-chips, .interest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-chip, .interest-chip {
  padding: 0.5rem 1rem;
  background: rgba(0, 224, 255, 0.1);
  border: 1px solid rgba(0, 224, 255, 0.3);
  border-radius: 20px;
  color: #00e0ff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.skill-chip:hover, .interest-chip:hover {
  background: rgba(0, 224, 255, 0.2);
  border-color: #00e0ff;
  transform: translateY(-2px);
}

.onboarding-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-buttons {
  display: flex;
  gap: 1rem;
}

.btn-primary {
  background: #00e0ff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #00f0ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 224, 255, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .onboarding-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .onboarding-header,
  .onboarding-body,
  .onboarding-footer {
    padding: 1.5rem;
  }
  
  .onboarding-footer {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-buttons {
    width: 100%;
    justify-content: space-between;
  }
  
  .btn-primary,
  .btn-secondary {
    flex: 1;
  }
}

/* Empty State Improvements */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  min-height: 200px;
}

.empty-state i {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.empty-state .action-btn {
  margin-top: 1rem;
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 120px;
  margin-bottom: 1rem;
}

.skeleton-text {
  height: 20px;
  margin-bottom: 0.5rem;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}


/* Enhanced Search */
.search-wrapper {
  position: relative;
  width: 100%;
}

.search-suggestions {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.98);
  border: 1px solid rgba(0, 224, 255, 0.3);
  border-radius: 12px 12px 0 0;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  margin-bottom: 8px;
  box-shadow: 0 -4px 20px rgba(0, 224, 255, 0.2);
}

.suggestion-group {
  padding: 0.5rem 0;
}

.suggestion-header {
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.suggestion-item {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.9);
}

.suggestion-item:hover {
  background: rgba(0, 224, 255, 0.1);
  color: #00e0ff;
}

.suggestion-item i {
  width: 20px;
  text-align: center;
  color: rgba(0, 224, 255, 0.6);
}

.no-results {
  padding: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

/* Tooltips */
.tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.95);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 10002;
  white-space: nowrap;
  border: 1px solid rgba(0, 224, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-100% - 5px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -100%);
  }
}

/* Connection Cards Enhancement */
.connection-card {
  position: relative;
  transition: all 0.3s ease;
}

.connection-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 224, 255, 0.2);
}

.connection-strength {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
}

.connection-strength.medium {
  background: #ffcf33;
}

.connection-strength.weak {
  background: rgba(255, 255, 255, 0.3);
}

.mutual-connections {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.25rem;
}

.shared-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.interest-badge {
  padding: 0.25rem 0.5rem;
  background: rgba(0, 224, 255, 0.1);
  border: 1px solid rgba(0, 224, 255, 0.3);
  border-radius: 12px;
  font-size: 0.75rem;
  color: #00e0ff;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.quick-action-btn {
  flex: 1;
  padding: 0.5rem;
  background: rgba(0, 224, 255, 0.1);
  border: 1px solid rgba(0, 224, 255, 0.3);
  border-radius: 6px;
  color: #00e0ff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-action-btn:hover {
  background: rgba(0, 224, 255, 0.2);
  border-color: #00e0ff;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .search-suggestions {
    max-height: 300px;
  }
  
  .tooltip {
    display: none;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Visible */
*:focus-visible {
  outline: 2px solid #00e0ff;
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #00e0ff;
  outline-offset: 2px;
}


/* Keyboard Shortcuts Modal */
.shortcuts-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.2s ease;
}

.shortcuts-content {
  background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
  border: 1px solid rgba(0, 224, 255, 0.3);
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 224, 255, 0.2);
}

.shortcuts-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shortcuts-header h2 {
  color: #00e0ff;
  font-size: 1.5rem;
  margin: 0;
}

.close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: #fff;
}

.shortcuts-body {
  padding: 1.5rem 2rem;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.shortcut-item:last-child {
  border-bottom: none;
}

.shortcut-item kbd {
  min-width: 60px;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 224, 255, 0.1);
  border: 1px solid rgba(0, 224, 255, 0.3);
  border-radius: 6px;
  color: #00e0ff;
  font-family: monospace;
  font-size: 0.9rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.shortcut-item span {
  color: rgba(255, 255, 255, 0.9);
  flex: 1;
}


/* Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Confetti */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  z-index: 10003;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Success Checkmark */
.success-checkmark {
  z-index: 10003;
  font-size: 4rem;
  color: #4caf50;
  animation: checkmark-pop 0.5s ease-out;
  pointer-events: none;
}

@keyframes checkmark-pop {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* Card Transitions */
.connection-card,
.project-card,
.theme-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus Animations */
input:focus,
textarea:focus,
select:focus {
  animation: input-focus 0.3s ease;
}

@keyframes input-focus {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 224, 255, 0.4);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.1);
  }
}

/* Button Press Animation */
button:active,
.action-btn:active,
.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.95);
}

/* Loading Pulse */
.loading-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* Slide In Animations */
.slide-in-left {
  animation: slideInLeft 0.3s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

.slide-in-up {
  animation: slideInUp 0.3s ease-out;
}

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

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

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

/* Fade Animations */
.fade-in {
  animation: fadeIn 0.3s ease;
}

.fade-out {
  animation: fadeOut 0.3s ease;
}

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

/* Bounce Animation */
.bounce {
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Shake Animation (for errors) */
.shake {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}


/* Enhanced Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  min-height: 200px;
}

.empty-state i {
  font-size: 3.5rem;
  color: rgba(0, 224, 255, 0.4);
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
}

.empty-state-hint {
  font-size: 0.95rem !important;
  color: rgba(255, 255, 255, 0.5) !important;
  margin-bottom: 1.5rem !important;
}

.empty-state .action-btn {
  margin-top: 1rem;
  background: #00e0ff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.empty-state .action-btn:hover {
  background: #00f0ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 224, 255, 0.4);
}
