@import "tailwindcss";
@import "../styles/buttons.css";

@custom-variant dark (&:where(.dark, .dark *));

:root {
  --background: #ffffff;
  --foreground: #171717;

  /* Modern color palette */
  --gradient-start: #ff6b35;
  --gradient-end: #f7931e;
  --accent-glow: rgba(255, 107, 53, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.2);
}

.dark {
  --background: #0a0a0a;
  --foreground: #ededed;

  /* Dark mode colors */
  --gradient-start: #ff8a65;
  --gradient-end: #ffb74d;
  --accent-glow: rgba(255, 138, 101, 0.3);
  --glass-bg: rgba(17, 17, 17, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
}

body {
  color: var(--foreground);
  background-color: var(--background);
  font-family: Arial, Helvetica, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  scroll-behavior: smooth;
}

/* Modern utility classes */
.gradient-text {
  @apply bg-gradient-to-r from-orange-500 to-orange-600 bg-clip-text text-transparent;
}

.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.glow-effect {
  box-shadow: 0 0 40px var(--accent-glow);
}

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Animated gradient background */
.animated-gradient {
  background: linear-gradient(-45deg, #ff6b35, #f7931e, #ff6b35, #f7931e);
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Floating animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.float-animation {
  animation: float 6s ease-in-out infinite;
}

/* Fade in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Shimmer effect for buttons */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.shimmer:hover::after {
  left: 100%;
}

/* Blob shape backgrounds */
.blob-1 {
  position: absolute;
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  opacity: 0.3;
  filter: blur(40px);
  animation: blob-animation 20s infinite;
}

.blob-2 {
  position: absolute;
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, var(--gradient-end), var(--gradient-start));
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  opacity: 0.3;
  filter: blur(40px);
  animation: blob-animation 20s infinite reverse;
}

@keyframes blob-animation {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Mobile touch optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover effects on touch devices */
  .hover-lift:hover {
    transform: none;
    box-shadow: none;
  }

  /* Add active states for touch feedback */
  .hover-lift:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  /* Reduce animations on mobile for performance */
  .blob-1, .blob-2 {
    animation: none;
    opacity: 0.2;
  }

  /* Simplify floating animations on mobile */
  .float-animation {
    animation: none;
  }

  /* Disable icon rotation on hover for touch devices */
  .group:hover .group-hover\:rotate-12 {
    transform: none;
  }

  /* Add tap feedback for icons */
  .group:active .group-hover\:rotate-12 {
    transform: scale(1.2);
    transition: transform 0.1s ease;
  }
}

/* Touch-friendly card interactions */
.touch-card {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* Prevent double-tap zoom */
  user-select: none; /* Prevent text selection on long press */
  position: relative;
  overflow: hidden;
}

.touch-card:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Ripple effect for touch feedback */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.touch-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 107, 53, 0.3);
  width: 100px;
  height: 100px;
  pointer-events: none;
  animation: ripple 0.6s ease-out;
}

/* Improved mobile animations */
@media (max-width: 768px) {
  /* Reduce animation complexity */
  .fade-in-up {
    animation: fadeInUpMobile 0.4s ease-out forwards;
  }

  @keyframes fadeInUpMobile {
    from {
      opacity: 0;
      transform: translateY(20px); /* Reduced distance */
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Disable shimmer on mobile to improve performance */
  .shimmer::after {
    display: none;
  }

  /* Prevent text selection during swipe */
  body {
    -webkit-user-select: none;
    user-select: none;
  }

  /* Allow text selection for specific elements */
  p, h1, h2, h3, h4, h5, h6, span, .selectable {
    -webkit-user-select: text;
    user-select: text;
  }

  /* Optimize touch scrolling */
  * {
    -webkit-overflow-scrolling: touch;
  }
}

.auth-glass-page .supabase-auth-ui_ui-button {
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(248, 245, 255, 0.9) !important;
  box-shadow: none !important;
}

.auth-glass-page .supabase-auth-ui_ui-button:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
}

.auth-glass-page .supabase-auth-ui_ui-button[type='submit'] {
  border-color: rgba(244, 180, 126, 0.45) !important;
  background: rgba(244, 180, 126, 0.92) !important;
  color: #12102a !important;
}

.auth-glass-page .supabase-auth-ui_ui-button[type='submit']:hover {
  background: rgba(255, 214, 176, 0.96) !important;
}

.auth-glass-page .supabase-auth-ui_ui-input {
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(8, 10, 22, 0.46) !important;
  color: #f8f5ff !important;
}

.auth-glass-page .supabase-auth-ui_ui-label {
  color: rgba(248, 245, 255, 0.72) !important;
}

.auth-glass-page .supabase-auth-ui_ui-divider {
  background-color: rgba(255, 255, 255, 0.16) !important;
}

.auth-glass-page .supabase-auth-ui_ui-anchor[href$='#auth-sign-up'] {
  display: none !important;
}
