* {
  box-sizing: border-box;
}

.ngram-container {
  margin: 2rem 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

textarea {
  background-color: white;
  font-size: 16px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  resize: vertical;
  min-height: 100px;
  width: 100%;
  height: 200px;
}

textarea:focus {
  outline: none;
}

.controls {
  display: flex;
  flex: 1;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.prediction-button {
  background: white;
  color: black;
  font-family: var(--font-family-sans);
  font-size: 16px;
  font-weight: 600;
  padding: 0.5em 0.25em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prediction-button:hover {
  background: blue;
  color: white;
}

.ngram-size-control {
  display: flex;
  align-items: center;
  background: black;
  border: 1px solid white;
  padding: 0.5em;
  border-radius: 8px;
  gap: 3px;
}

.ngram-size-control label {
  color: white;
  font-size: 16px;
}

#nGramSize {
  background: transparent;
  color: white;
  font-family: var(--font-family-sans);
  font-size: 16px;
  border: none;
}

.predictions {
  display: flex;
  gap: 5px;
  flex: 1;
  overflow: scroll;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

.predictions::-webkit-scrollbar {
  display: none;
}

.error {
  color: #dc2626;
  padding: 12px 16px;
  border-radius: var(8px);
  border: 1px solid #fecaca;
  font-size: 14px;
  margin: 0;
  display: none;
}

.image-container {
  display: inline-block;
  position: relative;
}

.test-image {
  display: block;
  width: 100%;
}

.compress-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  color: white;
  font-family: var(--font-family-sans);
  font-size: 16px;
  font-weight: 600;
  padding: 0.5em 0.5em;
  border: white 1px solid;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  display: none;
}

.prediction-button p {
  margin: 0;
}

@media only screen and (min-width: 320px) and (max-width: 959px) {
  .ngram-container {
    padding: 0.75rem;
  }

  .prediction-button {
    padding: 0.1em 0.4em;
  }

  .ngram-size-control {
    padding: 0.2em 0.5em;
  }

  .prediction-button:hover {
    background: white;
    color: black;
  }
  .compress-button {
    display: block;
  }
}
