/* Base styles - Minimalist Theme */
:root {
  --primary-color: #000000;
  --secondary-color: #333333;
  --accent-color: #888888;
  --background-color: #ffffff;
  --text-color: #333333;
  --error-color: #ff4a4a;
  --success-color: #15c15c;
  --container-width: 650px;
  --border-radius: 2px;
  --box-shadow: none;
  --transition: all 0.2s ease;
  --white: #ffffff;
  --off-white: #f9f9f9;
  --light-gray: #eeeeee;
  --medium-gray: #999999;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--background-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
  padding: 2rem 1rem;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  background-color: var(--white);
}

h1 {
  font-size: 6rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  font-family: "UnifrakturMaguntia", cursive;
  font-style: normal;
  color: var(--primary-color);
  text-align: center;
}

h2 {
  font-size: 1.2rem;
  color: var(--secondary-color);
  margin: 1.5rem 0 1rem;
  font-weight: 600;
}

h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.tagline {
  text-align: center;
  font-size: 1rem;
  margin-bottom: 2rem;
  color: var(--accent-color);
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

/* Form styles */
.form-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

label {
  font-weight: 500;
  font-size: 0.9rem;
}

input[type="text"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--light-gray);
  border-radius: 6px;
  font-size: 0.9rem;
  transition: var(--transition);
  background-color: var(--white);
  color: var(--text-color);
}

input[type="text"]:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: none;
}

button {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
  margin: 1rem 0;
}

button:hover {
  opacity: 0.9;
}

/* Quiz styles */
.quiz-creator {
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--light-gray);
}

.question {
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--light-gray);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.option label {
  flex: 1;
  padding: 0.75rem 1rem;
  background-color: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: normal;
  font-size: 0.9rem;
}

.option input[type="radio"] {
  display: none;
}

.option input[type="radio"]:checked + label {
  background-color: var(--off-white);
  color: var(--primary-color);
  border-color: var(--accent-color);
}

.submit-btn {
  margin-top: 1.5rem;
}

.submit-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}

.submit-container .spinner-container {
  margin: 0;
  padding: 0;
}

/* Make it more obvious that the spinner is associated with the button */
.submit-container .htmx-request ~ .spinner-container {
  opacity: 1;
}

/* Result styles */
.result {
  padding: 1rem 0;
  text-align: center;
}

.result-content {
  margin: 1.5rem 0;
  text-align: left;
  padding: 0;
  border-bottom: 1px solid var(--light-gray);
  padding-bottom: 1.5rem;
}

.result-content p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.restart-btn {
  opacity: 0.8;
}

.restart-btn:hover {
  opacity: 1;
}

/* Error message */
.error-message {
  padding: 0.75rem;
  color: var(--error-color);
  margin: 1rem 0;
  text-align: center;
  font-size: 0.9rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--accent-color);
  border-top: 1px solid var(--light-gray);
}

/* HTMX Loading indicator - these are important for proper spinner behavior */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease-in;
  display: none; /* Hide by default */
}

/* When a parent element is making an HTMX request, show any child elements with the htmx-indicator class */
.htmx-request .htmx-indicator {
  opacity: 1;
  display: flex;
}

/* When an element is both making an HTMX request and is itself an indicator, show it */
.htmx-request.htmx-indicator {
  opacity: 1;
  display: flex;
}

/* Spinner */
.spinner-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
  opacity: 0; /* Start hidden */
  transition: opacity 0.2s ease-in-out;
  margin: 0.5rem 0;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 0.8s linear infinite;
}

/* Show spinner when request is in progress */
.htmx-request .htmx-indicator, 
.htmx-request.htmx-indicator {
  opacity: 1 !important;
  display: flex !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  .form-group {
    flex-direction: column;
    align-items: stretch;
  }
}