@tailwind base;
@tailwind components;
@tailwind utilities;

/* Simple spinner animation (backup in case Tailwind's animate-spin isn't available) */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }

  /* Chat AI Typing animation */
  .animate-bounce {
    animation: bounce 1s infinite;
  }
  .animate-bounce200 {
    animation: bounce 1s infinite 0.2s;
  }
  .animate-bounce400 {
    animation: bounce 1s infinite 0.4s;
  }
  .animate-pulse-bounce {
    animation: pulse 1.05s cubic-bezier(.4,0,.6,1) infinite;
  }
  
  /* Removed terminal animations - no longer needed */
}

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0);} 
  40% { transform: translateY(-8px);} 
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade out animation for loading overlay */
.animate-fadeOut {
  animation: fadeOut 0.5s ease-out forwards;
}

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

/* Fix for AI chat layout */
#ai-chat-tab {
  position: relative;
  height: 100%;
}

#ai-chat-tab.hidden {
  display: none;
}

#ai-chat-tab #chat-messages {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 80px; /* Leave space for input */
  overflow-y: auto;
}

#ai-chat-tab .chat-input-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px; /* Fixed height */
  display: flex;
  align-items: center; /* Center content vertically */
}

#ai-chat-tab .chat-input-wrapper form {
  width: 100%;
  margin: 0; /* Remove any default margins */
  padding: 16px; /* Adjust padding as needed */
}

/* Fix focus ring on textarea to be inset */
#ai-chat-tab textarea:focus {
  outline: none !important;
  box-shadow: inset 0 0 0 2px rgb(139 92 246) !important; /* violet-500 inset */
}

/* Screenshots grid styles */
.screenshot-item {
  position: relative;
  background-color: #1e293b;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.screenshot-item:hover {
  transform: scale(1.05);
}

.screenshot-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Lightbox styles */
.lightbox-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  padding: 0.5rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.lightbox-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}
