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

/* MacOS Aesthetic Global Styles */
html, body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  background-color: #FBFBFD;
}

.dark body {
  background-color: #020203;
}

/* Atmospheric Theme Transition */
html {
  transition: background-color 1.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.8s ease;
}

::selection {
  background: rgba(0, 102, 255, 0.3);
  color: inherit;
}

/* Premium Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 120, 0.2);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 120, 120, 0.4);
}

/* 
  macOS Glass Effect optimizations
*/
.glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.02);
  will-change: transform, opacity;
}
.dark .glass {
  background: rgba(18, 18, 22, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 10px 25px -5px rgba(0, 0, 0, 0.03),
    0 8px 10px -6px rgba(0, 0, 0, 0.03);
}
.dark .glass-strong {
  background: rgba(20, 20, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Noise Texture Optimized */
.bg-noise {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.015'/%3E%3C/svg%3E");
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.12;
}

/* 3D Utilities Optimized */
.preserve-3d { transform-style: preserve-3d; backface-visibility: hidden; }
.perspective-2000 { perspective: 2000px; }
.perspective-1000 { perspective: 1000px; }

/* Modern Typography Utilities */
.text-glow {
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.tracking-ultra {
  letter-spacing: -0.05em;
}

/* Animations */
@keyframes liquid {
  0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: rotate(0deg) scale(1); }
  50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; transform: rotate(180deg) scale(1.05); }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: rotate(360deg) scale(1); }
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 120, 0.1);
  border-radius: 10px;
}

@media (max-width: 640px) {
  /* Optimize glass performance on mobile */
  .glass, .glass-strong {
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
  }
}