/* Critical CSS for initial paint - Prevent white flash */
html {
  margin: 0;
  padding: 0;
  background-color: #0f172a;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: #0f172a;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background-color: #0f172a;
  box-sizing: border-box;
}

/* Loading state - prevent flash */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #60a5fa;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(30, 64, 175, 0.3);
  border-top: 3px solid #60a5fa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loading-text {
  font-size: 0.875rem;
  color: #94a3b8;
  text-align: center;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Header critical styles */
.header {
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

/* Navigation critical styles */
.nav-button {
  padding: 0.75rem;
  border-radius: 0.75rem;
  transition: all 0.2s;
  touch-action: manipulation;
  min-height: 44px;
  min-width: 44px;
}
