body {
  margin: 0;
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  color: #222;
}

.container {
  max-width: 600px;
  margin: 40px auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(60,60,120,0.15);
  padding: 2.5rem 2rem 2rem 2rem;
  animation: fadeIn 1.2s cubic-bezier(.4,0,.2,1);
}

header {
  text-align: center;
  margin-bottom: 2rem;
}
header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #4b6cb7;
  margin-bottom: 0.2em;
  text-shadow: 0 2px 8px #c3cfe2;
}
header p {
  font-size: 1.1rem;
  color: #6a7ba2;
  font-style: italic;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.selectors {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}
.selectors label {
  font-weight: 600;
  color: #4b6cb7;
}
select {
  margin-left: 0.5em;
  padding: 0.3em 1em;
  border-radius: 8px;
  border: 1px solid #bfc9d9;
  background: #f5f7fa;
  font-size: 1rem;
  transition: border 0.2s;
}
select:focus {
  border: 1.5px solid #4b6cb7;
  outline: none;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
textarea {
  resize: vertical;
  border-radius: 10px;
  border: 1px solid #bfc9d9;
  padding: 0.8em;
  font-size: 1rem;
  background: #f5f7fa;
  transition: border 0.2s;
  min-height: 40px;
}
textarea:focus {
  border: 1.5px solid #4b6cb7;
  outline: none;
}
input[type="file"] {
  margin-top: 0.5em;
}
#image-preview img {
  max-width: 100%;
  max-height: 120px;
  margin-top: 0.5em;
  border-radius: 10px;
  box-shadow: 0 2px 8px #c3cfe2;
  animation: fadeIn 0.7s;
}
#submit-btn {
  background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  border-radius: 10px;
  padding: 0.8em 0;
  margin-top: 0.5em;
  cursor: pointer;
  box-shadow: 0 2px 8px #c3cfe2;
  transition: background 0.3s, transform 0.2s;
}
#submit-btn:hover {
  background: linear-gradient(90deg, #182848 0%, #4b6cb7 100%);
  transform: translateY(-2px) scale(1.03);
}

#result-section {
  margin-top: 2.5rem;
  text-align: center;
  animation: fadeInUp 1s cubic-bezier(.4,0,.2,1);
}
#result-section.hidden {
  display: none;
}
.gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}
#score-label {
  font-size: 2rem;
  font-weight: 700;
  margin-top: -1.2em;
  color: #222;
  text-shadow: 0 2px 8px #c3cfe2;
  animation: popIn 0.7s;
}
#correction-output, #model-answer-output {
  margin: 1.2em 0 0.5em 0;
  text-align: left;
  background: #f5f7fa;
  border-radius: 10px;
  padding: 1.2em;
  box-shadow: 0 2px 8px #c3cfe2;
  font-size: 1.08rem;
  line-height: 1.6;
  animation: fadeIn 1.2s;
}

/* Markdown styling */
#correction-output strong {
  color: #1db954;
  font-weight: 900;
  background: none;
}
#correction-output del {
  color: #e74c3c;
  text-decoration-thickness: 2.5px;
  background: none;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(60px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0% { transform: scale(0.7); opacity: 0; }
  80% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

/* Note Card Styles */
#note-card-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.2em 0 1.2em 0;
  width: 100%;
}

.note-btn {
  background: linear-gradient(90deg, #f7971e 0%, #ffd200 100%);
  color: #222;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 0.7em 1.5em;
  margin: 0.5em 0;
  cursor: pointer;
  box-shadow: 0 2px 8px #f5f7fa, 0 4px 16px #ffd20022;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
  outline: none;
}
.note-btn:hover {
  background: linear-gradient(90deg, #ffd200 0%, #f7971e 100%);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 24px #ffd20044;
}

.note-card {
  background: #fffbe6;
  border: 2.5px solid #ffd200;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(255, 215, 0, 0.13), 0 2px 8px #c3cfe2;
  padding: 1.2em 1.2em 1em 1.2em;
  margin-top: 0.7em;
  margin-bottom: 0.7em;
  width: 100%;
  max-width: 480px;
  animation: fadeIn 0.7s;
  transition: box-shadow 0.2s, border 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.note-card textarea {
  width: 100%;
  border-radius: 10px;
  border: 2px solid #ffd200;
  background: #fffde4;
  padding: 1em;
  font-size: 1.08rem;
  margin-bottom: 1em;
  resize: vertical;
  min-height: 50px;
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  color: #222;
  box-shadow: 0 1px 4px #ffd20022;
  transition: border 0.2s, box-shadow 0.2s;
}

.note-card textarea:focus {
  border: 2.5px solid #f7971e;
  outline: none;
  box-shadow: 0 2px 12px #ffd20044;
}

.note-card.hidden {
  display: none;
}

/* Submeter Styles */
#submeter-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  gap: 1.2em;
  margin: 0.7em 0 0.2em 0;
}
.submeter {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}
.submeter-score {
  font-size: 1.05rem;
  font-weight: 700;
  color: #4b6cb7;
  margin-top: -0.2em;
}

#criteria-reason-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2em;
  margin-bottom: 1.2em;
}
.criteria-reason {
  background: #f5f7fa;
  border-radius: 8px;
  box-shadow: 0 1px 4px #c3cfe2;
  padding: 0.7em 1em;
  font-size: 0.98rem;
  color: #222;
  min-width: 140px;
  max-width: 220px;
  margin: 0.2em 0;
}

@media (max-width: 700px) {
  .container {
    max-width: 98vw;
    padding: 1.2rem 0.5rem 1.5rem 0.5rem;
  }
  #correction-output, #model-answer-output {
    padding: 0.7em;
    font-size: 1rem;
  }
}

/* Draggable Chatbot Button */
.draggable-chatbot {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
  box-shadow: 0 4px 24px #4b6cb766, 0 2px 8px #c3cfe2;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 1002;
  transition: box-shadow 0.2s, background 0.2s;
}
.draggable-chatbot:hover {
  box-shadow: 0 8px 32px #4b6cb799, 0 2px 8px #c3cfe2;
  background: linear-gradient(135deg, #182848 0%, #4b6cb7 100%);
}
.chatbot-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}

/* Tooltip (native title used, but can be enhanced) */

/* Chatbox Styles */
.chatbox {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 340px;
  max-width: 95vw;
  background: #fff;
  border-radius: 18px 18px 10px 10px;
  box-shadow: 0 8px 32px #4b6cb799, 0 2px 8px #c3cfe2;
  z-index: 1003;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.5s;
}
.chatbox.hidden {
  display: none;
}
.chatbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
  color: #fff;
  padding: 0.8em 1em;
  border-radius: 18px 18px 0 0;
  font-weight: 700;
  font-size: 1.1rem;
}
.close-chatbox {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  font-weight: 900;
  margin-left: 0.5em;
}
.chatbox-messages {
  flex: 1;
  padding: 1em;
  overflow-y: auto;
  max-height: 260px;
  font-size: 1.01rem;
  color: #222;
}
.chatbox-form {
  display: flex;
  border-top: 1px solid #c3cfe2;
  padding: 0.7em 1em;
  background: #f5f7fa;
  border-radius: 0 0 10px 10px;
}
.chatbox-input-wrapper {
  flex: 1;
  display: flex;
  align-items: flex-end;
  margin-right: 0.7em;
}
#chatbox-input {
  width: 100%;
  min-height: 2.2em;
  max-height: 8.5em;
  border: 1.5px solid #bfc9d9;
  border-radius: 8px;
  padding: 0.5em 0.8em;
  font-size: 1rem;
  background: #fff;
  resize: none;
  overflow-y: auto;
  line-height: 1.4;
  font-family: inherit;
  box-sizing: border-box;
  word-break: break-word;
  white-space: pre-wrap;
  transition: border 0.2s;
}
#chatbox-input:focus {
  border: 1.5px solid #4b6cb7;
  outline: none;
}
.chatbox-form button[type="submit"] {
  background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.5em 1.2em;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
}
.chatbox-form button[type="submit"]:hover {
  background: linear-gradient(90deg, #182848 0%, #4b6cb7 100%);
}

/* Chat message bubbles */
.chatbox-message-user {
  background: #eaf1fb;
  color: #222;
  border-radius: 12px 12px 4px 12px;
  padding: 0.6em 1em;
  margin-bottom: 0.5em;
  align-self: flex-end;
  max-width: 80%;
  word-break: break-word;
}
.chatbox-message-ai {
  background: #f5f7fa;
  color: #222;
  border-radius: 12px 12px 12px 4px;
  padding: 0.6em 1em;
  margin-bottom: 0.5em;
  align-self: flex-start;
  max-width: 80%;
  word-break: break-word;
}

/* Chatbot Markdown Custom Tags */
h6 {
  color: #1db954;
  font-weight: 900;
  font-size: 1.05em;
  display: inline;
  background: none;
  margin: 0 0.1em;
}
h7 {
  color: #e74c3c;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  font-size: 1.05em;
  display: inline;
  background: none;
  margin: 0 0.1em;
}
p6 {
  color: #4b6cb7;
  background: #eaf1fb;
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-family: 'Fira Mono', 'Consolas', monospace;
  font-size: 0.98em;
  display: inline;
  margin: 0 0.1em;
}
p7 {
  color: #f7971e;
  font-style: italic;
  font-size: 1em;
  display: inline;
  background: none;
  margin: 0 0.1em;
}

.word-count, #word-count {
  transition: color 0.3s;
  margin-top: 0.3em;
  font-weight: 600;
  font-size: 1.02em;
  min-height: 1.2em;
  text-align: right;
}

.export-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e1e8ed;
}

.export-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.export-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.export-btn:active {
  transform: translateY(0);
}

.export-btn svg {
  transition: transform 0.2s ease;
}

.export-btn:hover svg {
  transform: scale(1.1);
}
