/* Base styles for Otakon app */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom scrollbar styles */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #1f2937;
}

::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Custom focus styles */
.focus-ring:focus {
  outline: 2px solid #8b5cf6;
  outline-offset: 2px;
}

/* Animation utilities */
.animate-pulse-slow {
  animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Custom button styles */
.btn-primary {
  @apply bg-purple-600 hover:bg-purple-700 text-white font-medium py-2 px-4 rounded-lg transition-colors duration-200;
}

.btn-secondary {
  @apply bg-gray-600 hover:bg-gray-700 text-white font-medium py-2 px-4 rounded-lg transition-colors duration-200;
}

/* Chat message styles */
.chat-message {
  @apply p-4 rounded-lg mb-4;
}

.chat-message.user {
  @apply bg-blue-600 text-white ml-auto max-w-xs;
}

.chat-message.model {
  @apply bg-gray-700 text-white mr-auto max-w-2xl;
}

/* Loading animation */
.loading-dots {
  @apply flex space-x-1;
}

.loading-dots span {
  @apply w-2 h-2 bg-current rounded-full animate-pulse;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Enhanced Multi-shot Image Grid */
.multi-shot-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  max-width: 100%;
  padding: 0.5rem;
}

/* AI Response Formatting - Custom spacing for structured responses */
.ai-response h1, .ai-response h2, .ai-response h3, .ai-response h4, .ai-response h5, .ai-response h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: #F5F5F5;
}

.ai-response h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.ai-response h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.ai-response h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.ai-response p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.ai-response p:last-child {
  margin-bottom: 0;
}

.ai-response ul, .ai-response ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.ai-response li {
  margin-bottom: 0.5rem;
}

.ai-response blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid #FF4D4D;
  background: rgba(255, 77, 77, 0.1);
  border-radius: 0.375rem;
  font-style: italic;
}

.ai-response code {
  background: rgba(255, 171, 64, 0.2);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: monospace;
}

.ai-response pre {
  background: rgba(28, 28, 28, 0.8);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1rem 0;
}

/* Responsive grid adjustments */
@media (min-width: 640px) {
  .multi-shot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .multi-shot-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .multi-shot-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Single image styling */
.single-image {
  display: block;
  max-width: 100%;
}

/* Image hover effects */
.multi-shot-grid img {
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 0.5rem;
}

.single-image img {
  max-height: 400px;
  object-fit: contain;
  border-radius: 0.5rem;
}

/* Smooth transitions for grid items */
.multi-shot-grid > div {
  transition: all 0.2s ease-in-out;
  border-radius: 0.5rem;
}

.multi-shot-grid > div:hover {
  transform: translateY(-2px);
  z-index: 10;
}

/* Image overlay animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.multi-shot-grid > div {
  animation: fadeInUp 0.3s ease-out;
}

.multi-shot-grid > div:nth-child(1) { animation-delay: 0.1s; }
.multi-shot-grid > div:nth-child(2) { animation-delay: 0.2s; }
.multi-shot-grid > div:nth-child(3) { animation-delay: 0.3s; }
.multi-shot-grid > div:nth-child(4) { animation-delay: 0.4s; }
.multi-shot-grid > div:nth-child(5) { animation-delay: 0.5s; }

/* Wave animation for skeleton loading */
@keyframes wave {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.animate-wave {
  animation: wave 1.5s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  background-size: 200% 100%;
}

/* Enhanced grid container styling */
.multi-shot-grid {
  background: linear-gradient(135deg, rgba(46, 46, 46, 0.1) 0%, rgba(28, 28, 28, 0.05) 100%);
  border-radius: 1rem;
  backdrop-filter: blur(10px);
}

/* Image number badge styling */
.multi-shot-grid .absolute.top-2.right-2 {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Hover effect improvements */
.multi-shot-grid > div:hover img {
  transform: scale(1.02);
}

.multi-shot-grid > div:hover .absolute.top-2.right-2 {
  background: rgba(255, 77, 77, 0.9);
  transform: scale(1.1);
}

/* Custom slider styles */
.slider {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.slider::-webkit-slider-track {
  background: #424242;
  height: 8px;
  border-radius: 4px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(135deg, #FF4D4D, #FFAB40);
  height: 20px;
  width: 20px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.slider::-moz-range-track {
  background: #424242;
  height: 8px;
  border-radius: 4px;
  border: none;
}

.slider::-moz-range-thumb {
  background: linear-gradient(135deg, #FF4D4D, #FFAB40);
  height: 20px;
  width: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Enhanced loading animations */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.animate-shimmer {
  background: linear-gradient(90deg, 
    rgba(255, 77, 77, 0.1) 25%, 
    rgba(255, 171, 64, 0.2) 50%, 
    rgba(255, 77, 77, 0.1) 75%
  );
  background-size: 200px 100%;
  animation: shimmer 2s infinite;
}

/* Pulse animation variations */
.animate-pulse-slow {
  animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-pulse-fast {
  animation: pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Bounce animation variations */
.animate-bounce-slow {
  animation: bounce 2s infinite;
}

.animate-bounce-fast {
  animation: bounce 0.5s infinite;
}

/* Enhanced animations and visual effects */
@keyframes fade-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(229, 61, 61, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(229, 61, 61, 0.6);
  }
}

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

/* Apply animations to components - DISABLED */
.animate-fade-slide-up {
  /* animation: fade-slide-up 0.3s ease-out; */
}

.animate-fade-in {
  /* animation: fade-in 0.2s ease-out; */
}

.animate-scale-in {
  /* animation: scale-in 0.2s ease-out; */
}

.animate-glow-pulse {
  animation: glow-pulse 2s ease-in-out infinite;
}

/* Enhanced hover effects */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Glass morphism effects */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced gradients */
.gradient-primary {
  background: linear-gradient(135deg, #E53A3A 0%, #D98C1F 100%);
}

.gradient-secondary {
  background: linear-gradient(135deg, #5CBB7B 0%, #4CAF50 100%);
}

.gradient-accent {
  background: linear-gradient(135deg, #5B99E3 0%, #4A90E2 100%);
}

/* Enhanced shadows */
.shadow-glow {
  box-shadow: 0 0 30px rgba(229, 61, 61, 0.3);
}

.shadow-glow-green {
  box-shadow: 0 0 30px rgba(92, 187, 123, 0.3);
}

.shadow-glow-blue {
  box-shadow: 0 0 30px rgba(91, 153, 227, 0.3);
}

/* Enhanced borders */
.border-glow {
  border: 2px solid transparent;
  background: linear-gradient(45deg, #E53A3A, #D98C1F) border-box;
  -webkit-mask: 
    linear-gradient(#fff 0 0) padding-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
}

/* Enhanced scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #E53A3A, #D98C1F);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #D98C1F, #E53A3A);
}

/* Enhanced focus states */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(229, 61, 61, 0.3);
}

/* Enhanced transitions */
.transition-smooth {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.transition-bounce {
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Enhanced text shadows */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.text-shadow-glow {
  text-shadow: 0 0 20px rgba(229, 61, 61, 0.5);
}

/* Enhanced button states */
.btn-primary {
  @apply bg-gradient-to-r from-[#E53A3A] to-[#D98C1F] text-white font-semibold px-6 py-3 rounded-xl transition-all duration-300 hover:scale-105 hover:shadow-xl hover:shadow-[#E53A3A]/25 active:scale-95;
}

.btn-secondary {
  @apply bg-gradient-to-r from-[#2E2E2E] to-[#1C1C1C] text-white font-semibold px-6 py-3 rounded-xl border-2 border-[#424242]/60 transition-all duration-300 hover:from-[#424242] hover:to-[#2E2E2E] hover:scale-105 hover:shadow-lg active:scale-95;
}

/* Enhanced card styles */
.card {
  @apply bg-gradient-to-r from-[#2E2E2E]/80 to-[#1C1C1C]/80 border-2 border-[#424242]/40 rounded-2xl backdrop-blur-sm transition-all duration-300 hover:border-[#E53A3A]/40 hover:shadow-xl hover:shadow-[#E53A3A]/10;
}

/* Enhanced input styles */
.input-enhanced {
  @apply bg-gradient-to-r from-[#1C1C1C] to-[#0A0A0A] border-2 border-[#424242]/40 rounded-xl px-4 py-3 text-white placeholder-[#A3A3A3] focus:border-[#E53A3A]/60 focus:outline-none transition-all duration-300 focus:shadow-[0_0_20px_rgba(229,61,61,0.2)];
}

/* Enhanced modal styles */
.modal-overlay {
  @apply fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4;
}

.modal-content {
  @apply bg-gradient-to-r from-[#1C1C1C] to-[#0A0A0A] border-2 border-[#424242]/40 rounded-2xl p-6 max-w-2xl w-full shadow-2xl backdrop-blur-sm;
}

/* Enhanced loading states */
.loading-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Enhanced responsive design */
@media (max-width: 640px) {
  .container-responsive {
    @apply px-4;
  }
  
  .text-responsive {
    @apply text-sm;
  }
  
  .spacing-responsive {
    @apply gap-3;
  }
}

@media (min-width: 1024px) {
  .container-responsive {
    @apply px-8;
  }
  
  .text-responsive {
    @apply text-lg;
  }
  
  .spacing-responsive {
    @apply gap-6;
  }
}

/* Mobile-specific optimizations */
@media (max-width: 640px) {
  /* Ensure proper viewport handling on mobile */
  html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
  }
  
  /* Mobile header adjustments */
  .mobile-header {
    padding: 0.75rem;
  }
  
  /* Mobile content adjustments */
  .mobile-content {
    padding: 0.75rem;
  }
  
  /* Mobile footer adjustments */
  .mobile-footer {
    padding: 0.75rem;
  }
  
  /* Ensure chat messages fit on mobile */
  .chat-message-mobile {
    max-width: 100%;
    margin: 0 0.5rem;
  }
  
  /* Mobile input adjustments */
  .mobile-input {
    padding: 0.75rem;
  }
  
  /* Pro Features Splash Screen mobile optimizations */
  .pro-features-mobile {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  
  .pro-features-mobile h1 {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
  }
  
  .pro-features-mobile .feature-card {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  /* Ensure sticky footer works properly */
  .pro-features-mobile footer {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 20 !important;
    background: linear-gradient(to bottom, transparent, rgba(10, 10, 10, 0.8), rgba(10, 10, 10, 0.95)) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }
  
  /* Credit Indicator Button with Transparent Content and Gradient Border */
  .credit-indicator-button {
    position: relative !important;
    z-index: 50 !important;
    border-radius: 12px !important;
    box-shadow: 0 0 15px rgba(229, 58, 58, 0.3) !important;
    animation: gradient-glow 4s ease infinite !important;
  }
  

  

  
  @keyframes gradient-glow {
    0% { box-shadow: 0 0 15px rgba(229, 58, 58, 0.3); }
    50% { box-shadow: 0 0 20px rgba(217, 140, 31, 0.4); }
    100% { box-shadow: 0 0 15px rgba(229, 58, 58, 0.3); }
  }
  
         .credit-indicator-button:hover {
         box-shadow: 0 0 25px rgba(229, 58, 58, 0.6), 0 0 35px rgba(217, 140, 31, 0.4) !important;
         transform: scale(1.05);
       }
  
  .credit-indicator-button:active {
    transform: scale(0.98);
  }
}

/* HowToUseSplashScreen specific scrollbar styles */
.how-to-use-scrollbar::-webkit-scrollbar {
  width: 10px;
}

.how-to-use-scrollbar::-webkit-scrollbar-track {
  background: rgba(66, 66, 66, 0.2);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.how-to-use-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #E53A3A, #D98C1F);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.how-to-use-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #D98C1F, #E53A3A);
  box-shadow: 0 4px 8px rgba(229, 58, 58, 0.4);
  transform: scaleY(1.1);
}

.how-to-use-scrollbar::-webkit-scrollbar-thumb:active {
  background: linear-gradient(135deg, #FF4D4D, #FFAB40);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Firefox scrollbar support */
.how-to-use-scrollbar {
  scrollbar-width: auto;
  scrollbar-color: #E53A3A rgba(66, 66, 66, 0.2);
}

/* Global focus-visible outlines for a11y */
button:focus-visible, a:focus-visible, [role="button"]:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid rgba(229, 58, 58, 0.8);
  outline-offset: 3px;
}
/* Reduced outline when using mouse */
:focus:not(:focus-visible) {
  outline: none;
}
