/* Reset & base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", "Segoe UI", sans-serif;
}

body {
  background: #f9fafb;
  color: #1f2937;
  line-height: 1.6;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* Headings */
h1, h2, h3 {
  margin-bottom: 16px;
  color: #111827;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
}

h2 {
  font-size: 1.5rem;
  margin-top: 24px;
}

/* Labels */
label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #374151;
}

/* Inputs, selects, textareas */
input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background-color: #fdfdfd;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
}

/* Buttons */
button {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: #3b82f6;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
}

button:hover {
  background: #2563eb;
}

button:active {
  transform: scale(0.98);
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
}

button.secondary:hover {
  background: #d1d5db;
}

/* Question blocks */
.question {
  background: #f9fafb;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
}

/* Multiple choice & checkbox styling */
.option-group {
  margin-top: 8px;
}

.option-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
}

input[type="radio"],
input[type="checkbox"] {
  transform: scale(1.2);
  cursor: pointer;
}

/* Results section */
.results {
  margin-top: 32px;
  padding: 20px;
  background: #f3f4f6;
  border-radius: 12px;
}

canvas {
  max-width: 400px;
  margin: 0 auto 20px;
  display: block;
}

/* Links */
a {
  color: #3b82f6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 20px;
  }
  h1 {
    font-size: 1.6rem;
  }
}

body {
  background: #f1f3f4;
  font-family: "Roboto", sans-serif;
  margin: 0;
  padding: 0;
}

/* Form header */
.form-header {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  margin: 20px auto;
  max-width: 800px;
}

.form-title {
  font-size: 28px;
  border: none;
  width: 100%;
  font-weight: 500;
  margin-bottom: 10px;
}

.form-title:focus {
  outline: none;
  border-bottom: 2px solid #673ab7;
}

.form-description {
  width: 100%;
  border: none;
  resize: none;
  font-size: 14px;
  color: #5f6368;
}

.form-description:focus {
  outline: none;
  border-bottom: 1px solid #673ab7;
}

/* Question cards */
.question-card {
  background: #fff;
  margin: 20px auto;
  padding: 20px;
  max-width: 800px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.question-input {
  width: 100%;
  font-size: 16px;
  padding: 8px;
  border: none;
  border-bottom: 2px solid transparent;
}

.question-input:focus {
  outline: none;
  border-bottom: 2px solid #673ab7;
}

/* Dropdown for type */
.question-type {
  margin-top: 12px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #dadce0;
}

/* Options */
.options input {
  display: block;
  width: 90%;
  margin-top: 8px;
  padding: 6px;
  border: none;
  border-bottom: 1px solid #dadce0;
}

.options input:focus {
  border-bottom: 2px solid #673ab7;
  outline: none;
}

/* Footer */
.question-footer {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

/* Toggle switch (Google style) */
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}
.switch input { display: none; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px; width: 14px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #673ab7;
}
input:checked + .slider:before {
  transform: translateX(14px);
}

.required-label {
  font-size: 14px;
  color: #5f6368;
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
}

/* Floating Add button */
.fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #673ab7;
  color: #fff;
  font-size: 28px;
  line-height: 0;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.fab:hover {
  background: #5e35b1;
}

/* --- General Form Inputs --- */
input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  margin-top: 6px;
  margin-bottom: 16px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  transition: all 0.2s ease;
  background-color: #fff;
}

/* Focus style */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
}

/* Textarea resize */
textarea {
  resize: vertical;
  min-height: 80px;
}

/* Label styling */
label span {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 15px;
  color: #202124;
}

/* Option container */
.option {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.option input[type="radio"],
.option input[type="checkbox"] {
  margin-right: 10px;
  accent-color: #4285f4;
}

/* Select placeholder */
select option:first-child {
  color: #999;
}

/* Linear range sliders */
input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: #e0e0e0;
  accent-color: #4285f4;
  cursor: pointer;
}

output {
  display: block;
  margin-top: 4px;
  font-weight: 500;
  color: #202124;
}

/* Floating add question button */
.floating-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #4285f4;
  color: white;
  font-size: 32px;
  line-height: 0;
  border: none;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.floating-btn:hover {
  background-color: #3367d6;
  transform: scale(1.1);
}

/* Question card styling */
.question-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  padding: 16px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease;
}

.question-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Buttons */
.btn {
  padding: 10px 18px;
  font-size: 15px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn.primary {
  background-color: #4285f4;
  color: white;
}

.btn.primary:hover {
  background-color: #3367d6;
}

.btn.danger {
  background-color: #ea4335;
  color: white;
}

.btn.danger:hover {
  background-color: #c5221f;
}

.btn.small {
  font-size: 13px;
  padding: 6px 10px;
}

/* Card container */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Form title & description */
.form-title {
  font-size: 24px;
  font-weight: 600;
  border: none;
  padding: 12px 0;
  border-bottom: 1px solid #ccc;
}

.form-title:focus {
  border-bottom-color: #4285f4;
  box-shadow: none;
}

.form-desc {
  font-size: 16px;
  border: none;
  color: #5f6368;
  margin-bottom: 24px;
  resize: none;
}

#editor-wrapper {
  border: 1px solid #ccc; /* light border to separate it */
  padding: 8px;            /* small padding inside the box */
  margin-top: 8px;         /* small spacing from content above */
  border-radius: 4px;      /* optional rounded corners */
  background-color: #fafafa; /* subtle background */
}
#editor-container .modal {
  position: static;  /* so it stays inside the box */
  width: 100%;
}

/* Base input styling for all inputs, textareas, and selects */
input,
textarea,
select {
  padding: 10px 14px;            /* inner spacing */
  font-size: 16px;               /* readable text */
  font-family: inherit;
  border: 2px solid #ccc;        /* base border */
  border-radius: 8px;            /* rounded corners */
  background-color: #fff;
  box-sizing: border-box;
  outline: none;
  transition: all 0.25s ease;    /* smooth hover/focus effects */
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Focus effect */
input:focus,
textarea:focus,
select:focus {
  border-color: #5c9ded;
  box-shadow: 0 0 8px rgba(92, 157, 237, 0.3);
  background-color: #f0f8ff;
}

/* Hover effect */
input:hover,
textarea:hover,
select:hover {
  border-color: #999;
}

/* Placeholder styling */
input::placeholder,
textarea::placeholder {
  color: #aaa;
  font-style: italic;
}

/* Optional: remove arrows for number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#questions-area {
  border: 1px solid #ddd;       /* subtle border to separate */
  border-radius: 8px;           /* rounded corners */
  background-color: #fafafa;    /* light background to differentiate */
  margin-top: 24px;             /* space from previous section */
  box-shadow: 0 2px 6px rgba(0,0,0,0.03); /* soft shadow for depth */
}

#questions-area h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.25rem;
  border-bottom: 1px solid #eee; /* subtle line under heading */
  padding-bottom: 6px;
}

#questions-list {
  margin-bottom: 16px;
}

/* Optional: wrap new question row nicely */
#questions-area .row {
  display: flex;
  gap: 8px;                 /* space between select, editor, button */
  flex-wrap: wrap;           /* allow wrapping on small screens */
  align-items: flex-start;
}

/* Editor wrapper styling */
#editor-wrapper {
  flex: 1;                   /* take remaining space */
  min-width: 200px;          /* prevent shrinking too much */
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

#editor-container {
  width: 100%;
}

/* Top bar container */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 12px 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  color: #222;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  background-color: #fff;
}

/* Navbar */
.navbar {
  display: flex;
  gap: 24px; /* Even spacing between items */
}

/* Navbar list reset */
.navbar ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 20px; /* Cleaner spacing */
}

/* Navbar links */
a {
  text-decoration: none;
  color: #222;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.25s ease, transform 0.2s ease;
}

a:hover {
  color: #4287f5;
  transform: translateY(-2px); /* Slight lift effect */
}

/* Optional: make it responsive */
@media (max-width: 768px) {
  .navbar ul {
    flex-direction: column;
    gap: 12px;
    position: absolute;
    top: 60px; /* Below header */
    right: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: none; /* Hidden until toggled */
  }

  .navbar ul.show {
    display: flex;
  }
}

.answers-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.answers-table th,
.answers-table td {
  padding: 8px 12px;
  text-align: left;
}

.answers-table th {
  border-bottom: 2px solid #ccc;
}

.answers-table td {
  border-bottom: 1px solid #eee;
}

.answers-table td + td {
  border-left: 1px solid #ccc; /* separator between date and answer */
  padding-left: 16px;          /* optional spacing */
}

.question-edit {
	box-shadow: 0 4px 12px rgba(0,0,0,0.3);
	border-radius: 8px;
	padding: 0.3rem;
	margin-bottom: 0.3rem;
}