/* Critical CSS for immediate mobile viewport fixes and loading states */

/* Immediate mobile viewport fixes */
html {
  height: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Loading state for better UX */
.app-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #ffffff;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f4f6;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
  body {
    height: 100vh;
    height: -webkit-fill-available;
  }

  #root {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }
}