/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* General Styles */
body {
  font-family: 'Poppins', sans-serif;
  color: #333;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Light Mode */
body.light-mode {
  background-color: #f5f5f5;
}

/* Dark Mode */
body.dark-mode {
  background-color: #1c1c1c;
  color: #f5f5f5;
}

/* Title Styles */
.title-container {
  text-align: center;
  margin-bottom: 40px;
}

.title-container h1 {
  font-size: 36px;
  margin-bottom: 10px;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: transparent;
  border: none;
  font-size: 30px;
  cursor: pointer;
}

/* Question Styles */
#questions {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 40px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode #questions {
  background-color: #2c2c2c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#questions h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

#questions input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font-size: 16px;
  border: none;
  border-bottom: 2px solid #ccc;
  border-radius: 0;
  background-color: transparent;
  margin-bottom: 20px;
  transition: border-color 0.3s ease;
}

body.dark-mode #questions input[type="text"] {
  border-bottom-color: #666;
  color: #f5f5f5;
}

/* Paragraph Input Styles */
textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font-size: 16px;
  border: none;
  border-bottom: 2px solid #ccc;
  border-radius: 0;
  background-color: transparent;
  margin-bottom: 20px;
  transition: border-color 0.3s ease;
  resize: vertical;
}

body.dark-mode textarea {
  border-bottom-color: #666;
  color: #f5f5f5;
}

/* Dropdown Styles */
select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font-size: 16px;
  border: none;
  border-bottom: 2px solid #ccc;
  border-radius: 0;
  background-color: transparent;
  margin-bottom: 20px;
  transition: border-color 0.3s ease;
}

body.dark-mode select {
  border-bottom-color: #666;
  color: #f5f5f5;
  background-color: #2c2c2c;
}

/* Linear Scale Styles */
.linear-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.linear-scale span {
  margin: 0 10px;
}
/* Grid Styles */
.grid-container {
  display: grid;
  grid-template-columns: auto repeat(auto-fit, minmax(100px, 1fr));
  grid-gap: 10px;
  margin-bottom: 20px;
}

.grid-row {
  display: grid;
  grid-template-columns: auto repeat(auto-fit, minmax(100px, 1fr));
  grid-gap: 10px;
  align-items: center;
}

.grid-cell {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: center;
  transition: border-color 0.3s ease;
}

body.dark-mode .grid-cell {
  border-color: #666;
}

/* Multiple Choice Grid Styles */
.multiple-choice-grid .grid-row:first-child .grid-cell {
  background-color: #f0f0f0;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

body.dark-mode .multiple-choice-grid .grid-row:first-child .grid-cell {
  background-color: #444;
}

/* Checkbox Grid Styles */
.checkbox-grid .grid-row:first-child .grid-cell {
  background-color: #f0f0f0;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

body.dark-mode .checkbox-grid .grid-row:first-child .grid-cell {
  background-color: #444;
}

/* Linear Scale Grid Styles */
.linear-scale-grid .grid-row:first-child .grid-cell {
  background-color: #f0f0f0;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

body.dark-mode .linear-scale-grid .grid-row:first-child .grid-cell {
  background-color: #444;
}

/* Multiple Choice Grid Styles */
.multiple-choice-grid .grid-row:first-child .grid-cell {
  background-color: #f0f0f0;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

body.dark-mode .multiple-choice-grid .grid-row:first-child .grid-cell {
  background-color: #444;
}

/* Checkbox Grid Styles */
.checkbox-grid .grid-row:first-child .grid-cell {
  background-color: #f0f0f0;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

body.dark-mode .checkbox-grid .grid-row:first-child .grid-cell {
  background-color: #444;
}

/* Submit Button Styles */
#submit-answers,
#reset {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#submit-answers {
  background-color: #4a90e2;
  color: #fff;
}

#submit-answers:hover {
  background-color: #3c7bc5;
}

#reset {
  background-color: #e24a4a;
  color: #fff;
}

#reset:hover {
  background-color: #c53c3c;
}

/* Results Styles */
#results-title {
  font-size: 24px;
  margin-top: 40px;
  margin-bottom: 20px;
  transition: color 0.3s ease;
}

#results {
  background-color: #fff;
  padding: 30px;
  word-wrap: break-word;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode #results {
  background-color: #2c2c2c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#results h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

#results div {
  margin-bottom: 20px;
}

/* Loading Icon Styles */
.loading-icon {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* Add New Question Form Styles */
#add-question-form {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 40px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode #add-question-form {
  background-color: #2c2c2c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#add-question-form label {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
}

#add-question-form input[type="text"],
#add-question-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font-size: 16px;
  border: none;
  border-bottom: 2px solid #ccc;
  border-radius: 0;
  margin-bottom: 20px;
  transition: border-color 0.3s ease;
}

body.dark-mode #add-question-form input[type="text"],
body.dark-mode #add-question-form select {
  background-color: #2c2c2c;
  border-bottom-color: #666;
  color: #f5f5f5;
}

#add-question-form button[type="submit"] {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  background-color: #4a90e2;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#add-question-form button[type="submit"]:hover {
  background-color: #3c7bc5;
}

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

/* Form Keys Grid Styles */
.form-keys-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  grid-gap: 10px;
  margin-bottom: 20px;
}

.form-key-button {
  text-align: center;
}

.form-key-btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.form-key-btn:hover {
  background-color: #3c7bc5;
}

/* Form Keys Grid Styles */
.form-keys-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 20px;
  margin-bottom: 20px;
}

.form-key-button {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  text-align: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .form-key-button {
  background-color: #2c2c2c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.form-key-button h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.form-key-btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.form-key-btn:hover {
  background-color: #3c7bc5;
}

/* Create New Form Styles */
.add-question-form {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .add-question-form {
  background-color: #2c2c2c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font-size: 16px;
  border: none;
  border-bottom: 2px solid #ccc;
  border-radius: 0;
  margin-bottom: 10px;
  transition: border-color 0.3s ease;
}

body.dark-mode .form-input {
  background-color: #2c2c2c;
  border-bottom-color: #666;
  color: #f5f5f5;
}

.form-btn {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  background-color: #4a90e2;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.form-btn:hover {
  background-color: #3c7bc5;
}