@import "tailwindcss";

:root {
  --background: #ffffff;
  --foreground: #171717;
  --card-background: rgba(255, 255, 255, 0.8);
  --card-border: rgba(229, 231, 235, 0.5);
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
}

.dark {
  --background: #0f172a;
  --foreground: #f1f5f9;
  --card-background: rgba(30, 41, 59, 0.8);
  --card-border: rgba(71, 85, 105, 0.3);
  --accent-blue: #60a5fa;
  --accent-purple: #a78bfa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0f172a;
    --foreground: #f1f5f9;
    --card-background: rgba(30, 41, 59, 0.8);
    --card-border: rgba(71, 85, 105, 0.3);
    --accent-blue: #60a5fa;
    --accent-purple: #a78bfa;
  }
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-inter), system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  font-feature-settings: "rlig" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: var(--font-geist-mono, ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace);
}

/* Enhanced scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(243, 244, 246, 0.3);
  border-radius: 4px;
}

.dark ::-webkit-scrollbar-track {
  background: rgba(51, 65, 85, 0.3);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, rgba(59, 130, 246, 0.6), rgba(139, 92, 246, 0.8));
  border-radius: 4px;
  border: 1px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, rgba(59, 130, 246, 0.8), rgba(139, 92, 246, 1));
}

.dark ::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, rgba(96, 165, 250, 0.6), rgba(167, 139, 250, 0.8));
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, rgba(96, 165, 250, 0.8), rgba(167, 139, 250, 1));
}

/* Enhanced grid background pattern */
.bg-grid-pattern {
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(59, 130, 246, 0.15) 1px, transparent 0),
    linear-gradient(45deg, transparent 24%, rgba(59, 130, 246, 0.03) 25%, rgba(59, 130, 246, 0.03) 26%, transparent 27%, transparent 74%, rgba(59, 130, 246, 0.03) 75%, rgba(59, 130, 246, 0.03) 76%, transparent 77%);
  background-size: 24px 24px, 48px 48px;
  animation: gridFlow 30s linear infinite;
}

.dark .bg-grid-pattern {
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(96, 165, 250, 0.2) 1px, transparent 0),
    linear-gradient(45deg, transparent 24%, rgba(96, 165, 250, 0.05) 25%, rgba(96, 165, 250, 0.05) 26%, transparent 27%, transparent 74%, rgba(96, 165, 250, 0.05) 75%, rgba(96, 165, 250, 0.05) 76%, transparent 77%);
}

@keyframes gridFlow {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 24px 24px, 48px 48px; }
}

/* Improved animations */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(-10px) scale(0.98); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
  }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes progressFill {
  0% { width: 0%; }
  100% { width: var(--progress-value, 0%); }
}

/* Animation utility classes */
.animate-fadeIn {
  animation: fadeIn 0.5s ease-out;
}

.animate-slideInLeft {
  animation: slideInLeft 0.6s ease-out;
}

.animate-slideInRight {
  animation: slideInRight 0.6s ease-out;
}

.animate-bounceIn {
  animation: bounceIn 0.6s ease-out;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

/* Enhanced focus styles */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: 6px;
  transition: outline 0.2s ease-in-out;
}

/* Improved button styles */
button {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Enhanced input styles */
input,
textarea,
select {
  transition: all 0.2s ease-in-out;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  ring: 2px;
  ring-color: var(--accent-blue);
}

/* Improved backdrop blur */
.backdrop-blur-lg {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.backdrop-blur-md {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Enhanced shadows */
.shadow-3xl {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dark .shadow-3xl {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.shadow-inner-lg {
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dark .shadow-inner-lg {
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Improved card hover effects */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.dark .card-hover:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Enhanced skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.dark .skeleton {
  background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
  background-size: 200% 100%;
}

/* Enhanced syntax highlighting for dark mode */
.dark .language-typescript .token.keyword {
  color: #60a5fa;
  font-weight: 600;
}

.dark .language-typescript .token.string {
  color: #34d399;
}

.dark .language-typescript .token.function {
  color: #a78bfa;
  font-weight: 500;
}

.dark .language-typescript .token.comment {
  color: #94a3b8;
  font-style: italic;
}

.dark .language-typescript .token.operator {
  color: #f87171;
}

.dark .language-json .token.property {
  color: #60a5fa;
  font-weight: 500;
}

.dark .language-json .token.string {
  color: #34d399;
}

.dark .language-json .token.number {
  color: #fbbf24;
  font-weight: 500;
}

.dark .language-json .token.boolean {
  color: #f87171;
  font-weight: 600;
}

.dark .language-bash .token.function {
  color: #a78bfa;
  font-weight: 600;
}

.dark .language-bash .token.string {
  color: #34d399;
}

.dark .language-bash .token.parameter {
  color: #fbbf24;
}

/* Enhanced checkbox styling */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background: white;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dark input[type="checkbox"],
.dark input[type="radio"] {
  border-color: #64748b;
  background: #334155;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 12px;
  font-weight: bold;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Enhanced tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  min-width: 120px;
  background-color: #1f2937;
  color: white;
  text-align: center;
  border-radius: 8px;
  padding: 8px 12px;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark .tooltip .tooltip-text {
  background-color: #f1f5f9;
  color: #1e293b;
}

.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #1f2937 transparent transparent transparent;
}

.dark .tooltip .tooltip-text::after {
  border-color: #f1f5f9 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.progress-bar {
  animation: progressFill 1.5s ease-out;
}

/* Enhanced mobile responsiveness */
@media (max-width: 640px) {
  .bg-grid-pattern {
    background-size: 16px 16px, 32px 32px;
    animation-duration: 40s;
  }
  
  .card-hover:hover {
    transform: translateY(-2px) scale(1.01);
  }
  
  /* Mobile-first typography */
  h1 {
    line-height: 1.1;
  }
  
  /* Better mobile touch targets */
  button {
    min-height: 44px;
    padding: 12px 16px;
  }
  
  /* Mobile-friendly code blocks */
  pre {
    font-size: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Better mobile scrolling */
  .overflow-y-auto {
    -webkit-overflow-scrolling: touch;
  }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
  .card-hover:hover {
    transform: translateY(-3px) scale(1.015);
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .text-4xl { font-size: 2rem; }
  .text-5xl { font-size: 2.5rem; }
  .text-6xl { font-size: 3rem; }
  .text-7xl { font-size: 3.5rem; }
  
  /* Better mobile grid spacing */
  .grid-cols-1 {
    gap: 0.75rem;
  }
  
  /* Compact mobile padding */
  .p-6 { padding: 1rem; }
  .p-8 { padding: 1.25rem; }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .backdrop-blur-lg {
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.95);
  }
  
  .dark .backdrop-blur-lg {
    background: rgba(15, 23, 42, 0.95);
  }
}

/* Dark mode enhancements */
.dark {
  color-scheme: dark;
}

/* Better dark mode card backgrounds */
.dark .bg-white\/70 {
  background-color: rgba(30, 41, 59, 0.8);
}

.dark .bg-white\/80 {
  background-color: rgba(30, 41, 59, 0.9);
}

/* Improved dark mode borders */
.dark .border-white\/20 {
  border-color: rgba(71, 85, 105, 0.3);
}

.dark .border-gray-200\/50 {
  border-color: rgba(71, 85, 105, 0.4);
}

.dark .border-gray-700\/20 {
  border-color: rgba(148, 163, 184, 0.2);
}

/* Enhanced dark mode gradients */
.dark .from-slate-50 {
  --tw-gradient-from: #0f172a;
}

.dark .via-blue-50 {
  --tw-gradient-via: #1e293b;
}

.dark .to-indigo-50 {
  --tw-gradient-to: #312e81;
}

/* Better dark mode text colors */
.dark .text-gray-600 {
  color: #cbd5e1;
}

.dark .text-gray-500 {
  color: #94a3b8;
}

.dark .text-gray-400 {
  color: #64748b;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .bg-grid-pattern {
    animation: none;
  }
} 