:root {
  --primary: #2c3e50;
  --secondary: #ecf0f1;
  --accent: #3498db;
  --danger: #e74c3c;
  --text-color: #333;
  --font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
  font-family: var(--font);
  background: linear-gradient(to right, #dfe9f3, #ffffff);
  color: var(--text-color);
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header,
footer {
  text-align: center;
  padding: 1rem;
  background-color: var(--primary);
  color: white;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  gap: 1rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 400px;
}

input,
button {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

button {
  background-color: var(--accent);
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #2980b9;
}

#question-container {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  max-width: 800px;
  margin: auto;
}

.question-number {
  font-size: 1.25rem;
  font-weight: bold;
  text-align: center;
  color: var(--accent);
}

.question-text {
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 1rem;
}

.question-text.animate {
  animation: slideDownFade 0.8s ease-out;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-120px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.option-with-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease-in-out;
}

.option-with-label.show {
  opacity: 1;
  transform: translateY(0);
}

.option-label {
  font-weight: bold;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.option-button {
  background-color: var(--secondary);
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 2rem;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #000;
}

.option-button:hover {
  background-color: var(--accent);
  color: white;
}

.option-button.selected {
  background-color: #2ecc71;
  color: white;
  font-weight: bold;
}

#navigation-buttons {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 1rem;
  max-width: 600px;
  margin: 2rem auto;
  align-items: center;
  justify-content: center;
}

#navigation-buttons button {
  width: 100%;
}

#finish-test {
  justify-self: end;
}

#progress-section {
  width: 100%;
  max-width: 800px;
  margin: 1rem auto;
}

#progress-bar-container {
  width: 100%;
  background-color: #ddd;
  border-radius: 10px;
  overflow: hidden;
  height: 20px;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--danger);
  transition: width 0.3s;
}

@media (max-width: 600px) {
  #progress-section {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 20px;
    height: 60vh;
    margin: 0;
    z-index: 10;
  }

  #progress-bar-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
  }

  #progress-bar {
    width: 100%;
    height: 0%;
  }

  .question-text {
    font-size: 1.25rem;
  }

  #navigation-buttons {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  form {
    width: 90%;
  }

  .options {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .option-with-label {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }

  .option-label {
    font-weight: bold;
    font-size: 1rem;
    min-width: 1.5rem;
    text-align: right;
    color: var(--primary);
    margin-bottom: 0;
  }

  .option-button {
    flex: 1;
    text-align: left;
    padding: 0.75rem 1rem;
  }
}

/* დასრულების შეტყობინება */
#completion-message {
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: green;
  margin-top: 2rem;
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.4s ease-in-out;
}

#completion-message.show {
  opacity: 1;
  transform: scale(1);
}
