/* Global Reset and Base Styles */
@font-face {
  font-family: 'Onest'; 
  src: url('/font.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}


body {
  font-family: Onest, Courier, monospace;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s;
}

body[data-theme="dark"] {
  background-color: #0d1117;
  color: white;
}

body[data-theme="light"] {
  background-color: #ffffff;
  color: #1f2937;
}

/* Navigation Styles */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: rgba(0, 0, 0, 0.5);
  flex-wrap: nowrap; /* Prevent wrapping on small screens */
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
}

body[data-theme="light"] .top-nav {
  background-color: rgba(0, 0, 0, 0.1);
}

.top-nav a {
  color: inherit;
  text-decoration: none;
  margin: 0 10px;
  font-size: 16px;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.top-nav a:hover,
.top-nav a.active {
  background-color: #1f2937;
}

body[data-theme="light"] .top-nav a:hover,
body[data-theme="light"] .top-nav a.active {
  background-color: #e5e7eb;
}

/* GitHub Icon */
.github-link {
  display: flex;
  align-items: center;
  justify-content: center;
}

.github-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.3s ease;
  vertical-align: middle;
}

.github-link:hover .github-icon {
  transform: scale(1.1);
}

/* Theme Switcher */
.theme-switcher {
  position: relative;
  width: 60px;
  height: 24px;
  background: #e5e5e5;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-left: 10px;
  display: flex;
  align-items: center;
}

.theme-switcher.dark {
  background: #374151;
}

.slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-switcher.dark .slider {
  transform: translateX(36px);
  background: #1f2937;
}

.icon {
  width: 10px;
  height: 10px;
  transition: all 0.3s ease;
}

.sun-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.moon-icon {
  opacity: 0;
  transform: scale(0.5) rotate(180deg);
  position: absolute;
}

.theme-switcher.dark .sun-icon {
  opacity: 0;
  transform: scale(0.5) rotate(180deg);
}

.theme-switcher.dark .moon-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.sun-icon path {
  fill: #f59e0b;
}

.moon-icon path {
  fill: #e5e7eb;
}

/* Hidden checkbox */
.theme-checkbox {
  display: none;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 100vh;
}

/* Form and Input Styles */
form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
}

.input-group {
  display: flex;
  align-items: center;
  margin: 20px 0;
  max-width: 100%;
  width: 95%;
}

.input-group img {
  margin-right: 10px;
}

input[type="text"] {
  padding: 10px;
  font-size: 16px;
  border-radius: 5px;
  width: 100%;
  max-width: calc(100vw - 150px);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body[data-theme="dark"] input[type="text"] {
  background-color: #161b22;
  color: #c9d1d9;
  border: 1px solid #30363d;
}

body[data-theme="light"] input[type="text"] {
  background-color: #f3f4f6;
  color: #1f2937;
  border: 1px solid #d1d5db;
}

button {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #29dfeb;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-left: 10px;
  white-space: nowrap;
}

/* Server Info Display */
.server-info {
  margin-top: 20px;
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 600px;
}

.server-info img {
  margin-right: 20px;
}

.server-details {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.server-details p {
  margin: 0;
  padding: 0;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 10px;
  right: 10px;
  color: #2196f3;
  font-weight: bold;
  cursor: pointer;
}

/* Edition Switch */
.edition-switch {
  margin-top: 10px;
}

.edition-switch label {
  margin-right: 10px;
  cursor: pointer;
  color: inherit;
}

/* API Documentation Specific Styles */
.api-section {
  margin-top: 20px;
  width: 100%;
  padding: 0 15px;
  box-sizing: border-box;
}

pre {
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  width: 100%;
  box-sizing: border-box;
  max-width: 100vw;
  margin: 10px 0;
  transition: background-color 0.3s, color 0.3s;
}

body[data-theme="dark"] pre {
  background-color: #161b22;
  color: #c9d1d9;
}

body[data-theme="light"] pre {
  background-color: #f3f4f6;
  color: #1f2937;
}

/* MOTD and Player List Styles */
.motd {
  font-family: "Minecraft", monospace;
  white-space: pre-wrap;
  margin: 5px 0;
  padding: 5px 0;
}

.player-list {
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.description-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

/* Minecraft Color Classes */
.mc-black {
  color: #000000;
}
.mc-dark-blue {
  color: #0000aa;
}
.mc-dark-green {
  color: #00aa00;
}
.mc-dark-aqua {
  color: #00aaaa;
}
.mc-dark-red {
  color: #aa0000;
}
.mc-dark-purple {
  color: #aa00aa;
}
.mc-gold {
  color: #ffaa00;
}
.mc-gray {
  color: #aaaaaa;
}
.mc-dark-gray {
  color: #555555;
}
.mc-blue {
  color: #5555ff;
}
.mc-green {
  color: #55ff55;
}
.mc-aqua {
  color: #55ffff;
}
.mc-red {
  color: #ff5555;
}
.mc-light-purple {
  color: #ff55ff;
}
.mc-yellow {
  color: #ffff55;
}
.mc-white {
  color: #ffffff;
}

/* Minecraft Format Classes */
.mc-bold {
  font-weight: bold;
}
.mc-strikethrough {
  text-decoration: line-through;
}
.mc-underline {
  text-decoration: underline;
}
.mc-italic {
  font-style: italic;
}

/* Loading Animation */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.container {
  --uib-size: 40px;
  --uib-color: #29dfeb;
  --uib-speed: .8s;
  --uib-bg-opacity: 0.1;
  height: var(--uib-size);
  width: var(--uib-size);
  transform-origin: center;
  animation: rotate var(--uib-speed) linear infinite;
  will-change: transform;
  overflow: visible;
}

.car {
  fill: none;
  stroke: var(--uib-color);
  stroke-dasharray: 25, 75;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  transition: stroke 0.5s ease;
}

.track {
  fill: none;
  stroke: var(--uib-color);
  opacity: var(--uib-bg-opacity);
  transition: stroke 0.5s ease;
}

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

/* Mobile Responsiveness */
@media screen and (max-width: 600px) {
  .main-content {
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
  }

  .api-section {
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
  }

  pre {
    margin: 10px -15px;
    width: calc(100% + 30px);
    font-size: 14px;
  }

  code {
    word-break: break-word;
  }

  h1,
  h2,
  p {
    padding: 0 15px;
  }

  /* Keep navbar on one line for mobile */
  .top-nav {
    padding: 8px 10px;
  }

  .top-nav a {
    margin: 0 5px;
    padding: 6px;
    font-size: 14px;
  }

  .theme-switcher {
    width: 50px;
    height: 22px;
    margin-left: 5px;
  }

  .slider {
    width: 18px;
    height: 18px;
  }

  .theme-switcher.dark .slider {
    transform: translateX(28px);
  }

  .github-icon {
    width: 18px;
    height: 18px;
  }
}
