body { font-family: Arial, sans-serif; margin: 2rem; }
#noteInput { width: 300px; margin-top: 10px; }
.note { margin-bottom: 8px; }
.note span { margin-right: 10px; }
button { margin-left: 5px; }
#notesList {
    max-height: 700px; /* Increased from 500px to 700px */
    overflow: auto;
    border: 1px solid #eee;
    padding: 8px;
    background: #fafafa;
    margin-bottom: 12px;
    resize: vertical;
}
/* Make textarea always scrollable if content overflows */
#noteInput {
    overflow: auto;
}
/* --- Added: two-column layout for notes and timer --- */
.notes-timer-container {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 12px;
}
/* Left column uses the existing notesList but ensure it fills half */
.notes-column {
    flex: 1 1 50%;
    min-width: 260px;
    overflow: auto;
}
/* Right column: timer panel */
#timerPanel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: none;
    box-shadow: none;
    padding: 0;
    max-width: 200px;
    text-align: center;
}
#midnightClock {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
}
#timerMsg {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}
#timerProgress {
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}
#timerProgress > i {
    display: block;
    height: 100%;
    background: #30cc38;
    width: 0%;
    transition: width 0.5s linear;
}
#timerMsg { font-size: 0.95rem; color: #555; }

/* Word count indicator styles */
#wordCountIndicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
#wordCountBox {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f1f1; /* Default background color */
    border: 2px solid #ddd;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
#wordCountText {
    font-size: 0.9rem;
    color: #555;
}

/* Adjust layout for indicator and button */
.indicator-button-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}
#wordCountIndicator {
    flex: 1;
}
button.add-update-btn {
    flex: 0.25;
    height: 36px;
    font-size: 0.95rem;
    padding: 0 10px;
    align-self: stretch;
    margin-top: 0;
}

/* Enhanced styles for add-update-btn */
.add-update-btn {
    padding: 6px 12px;
    background-color: #30cc38;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(48, 204, 56, 0.12);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.add-update-btn:hover {
    background-color: #249c2a;
    box-shadow: 0 4px 6px rgba(48, 204, 56, 0.18);
    transform: translateY(-1px);
}

.add-update-btn:active {
    background-color: #17661a;
    box-shadow: 0 2px 3px rgba(48, 204, 56, 0.15);
    transform: translateY(0);
}

/* Apply styles to the SimpleMDE editor */
.CodeMirror {
    font-size: 1rem; /* Match the desired font size */
    box-sizing: border-box;
    padding: 12px;
    resize: vertical; /* Allow vertical resizing */
    overflow-y: auto; /* Make it vertically scrollable */
    min-height: 600px; /* Minimum height for resizing */
}

/* Optional: Adjust the toolbar styling */
.editor-toolbar {
    background: #f9f9f9;
    border: 1px solid #ddd;
}

/* Optional: Adjust the status bar styling */
.editor-statusbar {
    background: #f1f1f1;
    border-top: 1px solid #ddd;
    font-size: 0.9rem;
    color: #555;
}

/* Responsive: stack on smaller screens */
@media (max-width: 800px) {
    .notes-timer-container { flex-direction: column; }
    #editor-container { height: 180px; min-height: 140px; }
}

#markdown-editor {
    font-size: 1.3rem;
    box-sizing: border-box;
    padding: 12px;
    resize: vertical; /* Allow vertical resizing */
    overflow: auto;
    margin-bottom: 10px;
}

/* New styles for editing indicator */
.editingIndicator {
  background: #f5f5f5;
  border: 1px solid #ccc;
  padding: 6px 12px;
  margin-bottom: 8px;
  font-size: 0.98em;
  color: #333;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Auth form styles */
.auth-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    margin: 0 auto;
}

.auth-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 12px; /* Added spacing between input fields */
}

.auth-button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-button:hover {
    background-color: #0056b3;
}

.auth-link {
    font-size: 0.9rem;
    color: #555;
}

.auth-link a {
    color: #007bff;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* New styles for top title */
.top-title {
    font-size: 1.5rem;
    color: #333;
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background: none; /* Removed gradient fill */
    border-radius: 8px;
}

.main-container {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: stretch;
}

#notesSection {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    border-right: 1px solid #ddd;
}

#editorContainer {
    flex: 3;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 16px;
}

.top-title-welcome {
    text-align: left;
    font-size: 1.8rem;
    color: #333;
    flex: 0 0 auto;
    background: none;
    border-radius: 8px;
    max-width: 400px;
}

/* Ensure the top-title-timer-logout container elements are equally spaced */
.top-title-timer-logout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    gap: 16px; /* Optional: Add consistent spacing between elements */
}

#timerPanel {
    text-align: center;
    flex: 1;
    max-width: 400px;
}

/* New styles for app header and title */
.app-header {
    text-align: center;
    margin-top: 10px;
}
.app-title {
    font-size: 60px;
    vertical-align: middle;
    font-family: 'Segoe UI', 'Arial Rounded MT Bold', Arial, sans-serif;
    font-weight: 500;
    letter-spacing: 2px;
}
.app-logo {
    height: 60px;
    width: 60px;
    vertical-align: middle;
}
.timer-panel {
    text-align: center;
    flex: 1;
    max-width: 200px;
}
.logout-button {
    max-width: 400px;
    min-width:  250px;
    padding: 10px 28px;
    background-color: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex: 0 0 auto;
}

/* Matches top bar */
.matches-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.go-back-link {
  margin-bottom: 24px;
}

/* Matches container */
.matches-container {
  display: flex;
  flex: 1 1;
  flex-direction: column;
}

.matches-list-container {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.matches-chat-container {
    display: flex;
    flex-direction: row; /* Arrange side by side */
    gap: 16px; /* Add spacing between the two sections */
    height: 100%; /* Ensure full height */
}

.chat-container {
  flex: 1 1; /* Take up half the width */
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* Allow scrolling if content overflows */
}

.chat-box {
  height: calc(80% - 80px);
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 8px;
}

.chat-input {
  width: 99%;
  margin-top: 8px;
}

.send-chat-btn {
  margin-top: 8px;
}

/* Match card */
.match {
  padding: 10px;
  margin: 8px 0;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s;
  width: 25%;
  color: #000;
}

/* No matches message */
.no-matches {
  color: #888;
  font-size: 1rem;
  text-align: center;
}

/* Match metadata */
.match-meta {
  font-size: 0.95em;
  color: #000;
  margin-bottom: 2px;
}

/* Match user heading */
.match-user-heading {
  font-weight: bold;
  font-size: 1.1em;
}

/* Match similarity */
.match-similarity {
  font-size: 0.95em;
}

/* Chat button */
.chat-button {
  margin-top: 8px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background-color: #007bff;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.chat-button:hover {
  background-color: #0056b3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Note list buttons */
.note button {
  padding: 6px 12px; /* Reduced padding */
  margin: 4px;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem; /* Reduced font size */
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Edit button */
.note button:nth-child(1) {
  background-color: #007bff;
  color: #fff;
}

.note button:nth-child(1):hover {
  background-color: #0056b3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Delete button */
.note button:nth-child(2) {
  background-color: #d32f2f;
  color: #fff;
}

.note button:nth-child(2):hover {
  background-color: #b71c1c;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Matches button */
.note button:nth-child(3) {
  background-color: #30cc38;
  color: #fff;
}

.note button:nth-child(3):hover {
  background-color: #249c2a;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#notesTitle {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: #333;
}

/* Styles for the circular match buttons */
.match-circle-btn {
  width: 30px; /* Fixed width */
  height: 30px; /* Fixed height */
  line-height: 30px; /* Ensure text is vertically centered */
  border-radius: 50%; /* Make it perfectly circular */
  background-color: #30cc38; /* Green background */
  color: #fff;
  border: none;
  font-size: 0.7rem; /* Smaller font size */
  font-weight: bold;
  text-align: center; /* Center text horizontally */
  cursor: pointer;
  margin: 2px; /* Reduced margin */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.match-circle-btn:hover {
  background-color: #249c2a; /* Darker green on hover */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}