/* Tailwind Base Styles for Studyt Redesign */

/* Grid Background Pattern (40px grid) */
body {
  font-family: 'Inter', sans-serif;
  background-color: #FAFAFA;
  background-image:
    linear-gradient(to right, #f0f0f0 1px, transparent 1px),
    linear-gradient(to bottom, #f0f0f0 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Dark mode grid background */
body.dark {
  background-color: #0f172a;
  background-image:
    linear-gradient(to right, #1e293b 1px, transparent 1px),
    linear-gradient(to bottom, #1e293b 1px, transparent 1px);
}

/* Glass Morphism Utility */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dark .glass {
  background: rgba(30, 41, 59, 0.7);
}

/* Scrollbar Hide Utilities */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Fade-up Animation */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Animation Delays */
.delay-100 {
  animation-delay: 0.1s;
  opacity: 0;
}

.delay-200 {
  animation-delay: 0.2s;
  opacity: 0;
}

.delay-300 {
  animation-delay: 0.3s;
  opacity: 0;
}

.delay-400 {
  animation-delay: 0.4s;
  opacity: 0;
}

/* Shimmer Effect for Progress Bars */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.animate-shimmer {
  animation: shimmer 2s infinite;
}

/* Gradient Glow Effects (for hero sections) */
.gradient-glow {
  position: relative;
}

.gradient-glow::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}

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

/* Selection Colors */
::selection {
  background-color: rgba(99, 102, 241, 0.2);
  color: #312e81;
}

.dark ::selection {
  background-color: rgba(129, 140, 248, 0.3);
  color: #e0e7ff;
}

/* Custom Scrollbar (for main content areas) */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.dark .custom-scrollbar::-webkit-scrollbar-track {
  background: #1e293b;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background: #475569;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Focus Ring Override (consistent with Tailwind) */
*:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Reduced Motion: disable animations for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-up,
  .animate-shimmer {
    animation: none !important;
    opacity: 1 !important;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Skip to content link (accessibility) */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 12px 24px;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 12px 12px;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 0;
}

/* Sticky mobile CTA */
.sticky-mobile-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  display: none;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

@media (max-width: 640px) {
  .sticky-mobile-cta.visible {
    display: flex;
  }
}

/* Antialiasing */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
