/**
 * Web-specific styles
 * Extends the react-native-web reset
 */

/* Base Layout */
html,
body,
#root {
  width: 100%;
  /* To smooth any scrolling behavior */
  -webkit-overflow-scrolling: touch;
  margin: 0px;
  padding: 0px;
  /* Allows content to fill the viewport and go beyond the bottom */
  min-height: 100%;
  background-color: #171717;
  font-family: ui-sans-serif, -apple-system, system-ui, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}

#root {
  flex-shrink: 0;
  flex-basis: auto;
  flex-grow: 1;
  display: flex;
  flex: 1;
}

html {
  /* Prevent text size change on orientation change */
  -webkit-text-size-adjust: 100%;
  height: calc(100% + env(safe-area-inset-top));
  scroll-behavior: smooth;
}

body {
  display: flex;
  /* Allows you to scroll below the viewport; default value is visible */
  overflow-y: auto;
  overscroll-behavior-y: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -ms-overflow-style: scrollbar;
}

/* Loading States */
.loader-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #171717;
}

.loader {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

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

/* Language-specific Display */
[lang="zh-CN"] .en-only {
  display: none;
}

[lang="en"] .zh-only {
  display: none;
}

/* Noscript Messages */
#noscript-message-en,
#noscript-message-zh,
#reload-btn-en,
#reload-btn-zh {
  display: none;
}

[lang="zh-CN"] #noscript-message-zh,
[lang="zh-CN"] #reload-btn-zh {
  display: block;
}

[lang="en"] #noscript-message-en,
[lang="en"] #reload-btn-en {
  display: block;
}

/* PWA Specific */
@media (display-mode: standalone) {
  /* Add any PWA-specific styles here */
  body {
    overscroll-behavior-y: contain;
  }
}