/* Base styles and CSS Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Fira Code', 'Roboto Mono', monospace;
  background-color: #21252b;
  color: #abb2bf;
  line-height: 1.6;
  min-height: 100vh;
}

/* App wrapper */
.app-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1 {
  text-align: center;
  font-weight: bold;
  color: lightgoldenrodyellow;
  margin: 1rem 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.intro-text {
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

p {
  margin-bottom: 1rem;
  font-size: clamp(0.875rem, 2vw, 1.125rem);
}

/* Main container */
.container {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  justify-content: center;
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
  flex: 1;
}

/* Text boxes */
.text-box {
  flex: 1;
  min-width: 280px;
  max-width: 600px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  padding: clamp(0.5rem, 2vw, 1.25rem);
  background-color: #282c34;
  border: 1px solid #3e4451;
}

textarea {
  height: clamp(200px, 50vh, 500px);
  resize: none;
  border: none;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: #1e222a;
  color: #98c379;
  font-family: inherit;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  width: 100%;
}

/* Button styles */
.submit-button {
  position: relative;
  background-color: #2c313c;
  color: #61afef;
  font-weight: bold;
  border-radius: 4px;
  border: 1px solid #61afef;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
}

.submit-button:hover:not(:disabled) {
  background-color: rgba(97, 175, 239, 0.1);
  transform: translateY(-1px);
}

.submit-button:disabled {
  background-color: #2d2d2d;
  color: #4a4a4a;
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #4a4a4a;
}

/* Loading animation */
.submit-button--loading .submit-button-text {
  visibility: hidden;
}

.submit-button--loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 3px solid transparent;
  border-top-color: #61afef;
  border-radius: 50%;
  animation: button-loading-spinner 1s linear infinite;
}

/* Footer */
.reference {
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}

.reference a {
  color: #61afef;
  text-decoration: none;
  transition: color 0.2s;
}

.reference a:hover {
  color: #56b6c2;
}

/* Responsive layout */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    align-items: center;
  }
  
  .text-box {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .app-wrapper {
    padding: 10px;
  }
  
  .intro-text {
    padding: 0 0.5rem;
  }
  
  textarea {
    height: clamp(150px, 40vh, 300px);
  }
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }
  to {
    transform: rotate(1turn);
  }
}
