body {
  margin: 0;
  font-family: "Montserrat", "Arial Black", Arial, sans-serif;
  color: #ffffff;
  background-image: url(/images/space-background.svg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: top;
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure no default margins/padding on html and body */
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll */
  box-sizing: border-box;
}

/* Apply box-sizing to all elements */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent any element from exceeding viewport width */
body > * {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Fix for elements that might cause horizontal overflow */
.header-container,
.global-search-container,
.content-wrapper,
.mobile-menu {
  max-width: 100%;
  box-sizing: border-box;
}

/* Specific mobile viewport fixes */
@media (max-width: 768px) {
  body {
    width: 100%;
    overflow-x: hidden;
  }

  /* Ensure all containers respect mobile viewport */
  .header-container {
    width: calc(100% - 30px);
    margin: 0 15px;
  }

  .global-search-container {
    width: calc(100% - 30px);
    margin: 0 15px;
  }

  .content-wrapper {
    width: calc(100% - 30px);
    margin: 15px;
  }
}

@media (max-width: 480px) {
  .header-container {
    width: calc(100% - 20px);
    margin: 0 10px;
  }

  .global-search-container {
    width: calc(100% - 20px);
    margin: 0 10px;
  }

  .content-wrapper {
    width: calc(100% - 20px);
    margin: 10px;
  }
}

/* Network Status Indicator */
.network-status {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 8px 16px;
  color: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideDown 0.3s ease-out;
}

.network-status.offline {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  border-bottom: 2px solid #c44;
}

.network-status .status-icon {
  margin-right: 8px;
  font-size: 16px;
}

.network-status .status-text {
  flex: 1;
}

.network-status .status-dismiss {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: 12px;
}

.network-status .status-dismiss:hover {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
