:root {
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
  --browser-ui-height: 0px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent overscroll bounce effects */
  overscroll-behavior: none;
}

html, body {
  height: 100%;
  /* Use a more reliable viewport height measurement on mobile */
  height: 100dvh;
  overflow: hidden;
  /* Add padding to account for safe areas in modern browsers */
  padding: var(--safe-area-inset-top) var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left);
}

/* Fix for mobile browsers that resize the viewport when the keyboard appears */
@media (max-width: 768px) {
  html, body {
    position: fixed;
    width: 100%;
    height: 100%;
  }
  
  /* Fix for Microsoft Edge mobile specifically */
  @supports (-ms-ime-align:auto) { 
    .inputContainer {
      position: fixed !important;
      bottom: calc(var(--browser-ui-height) + var(--safe-area-inset-bottom)) !important;
    }
  }
  
  /* Edge and Chrome specific fix */
  @supports (-webkit-touch-callout: none) {
    html {
      height: -webkit-fill-available;
    }
    body {
      height: -webkit-fill-available;
      min-height: -webkit-fill-available;
    }
  }
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}

* {
  box-sizing: border-box;
  /* Improve touch behavior on mobile */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Improve scrolling behavior */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
} 