/* Basic styling for clarity */
body {
  font-family: Arial, sans-serif;
  background: #f7f7f7;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}
main {
  max-width: 800px;
  margin: 1em auto;
  background: #fff;
  padding: 1.5em;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
h1 {
  text-align: center;
  margin-bottom: 1em;
  font-size: 1.5em;
}
nav {
  text-align: center;
  margin-bottom: 2em;
}
.tab {
  padding: 0.75em 1.5em;
  margin-right: 0.5em;
  border: 1px solid #ccc;
  background: #f8f9fa;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}
.tab.active {
  background: #007bff;
  color: white;
}
.admin-nav {
  margin: 1em 0;
}
.admin-tab {
  padding: 0.5em 1em;
  margin-right: 0.5em;
  border: 1px solid #ccc;
  background: #f8f9fa;
  cursor: pointer;
  border-radius: 4px;
}
.admin-tab.active {
  background: #28a745;
  color: white;
}
form label {
  display: block;
  margin-top: 0.8em;
  margin-bottom: 0.3em;
  font-weight: 500;
  font-size: 14px;
}
form select, form textarea {
  width: 100%;
  margin-bottom: 0.5em;
  padding: 0.5em;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 14px;
}
form button {
  margin-top: 1em;
  margin-right: 1em;
  padding: 0.6em 1.2em;
  border: none;
  border-radius: 4px;
  background: #007bff;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}
form button[type="button"] {
  background: #28a745;
}
#scaleDescription {
  margin: 0.5em 0;
  padding: 0.8em;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e9ecef;
  font-size: 13px;
}
#scaleDescription ul {
  margin: 0;
  padding-left: 1em;
}
#scaleDescription li {
  margin-bottom: 0.2em;
  line-height: 1.3;
}
#entries {
  margin-top: 1.5em;
  padding-top: 1em;
  border-top: 1px solid #e9ecef;
}
#entryList {
  margin-top: 1em;
}
.entry {
  background: #f8f9fa;
  padding: 0.8em;
  border-radius: 6px;
  margin-bottom: 0.8em;
  border-left: 4px solid #007bff;
  line-height: 1.4;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.entry-content {
  flex: 1;
}

.entry-actions {
  display: flex;
  gap: 8px;
  margin-left: 15px;
}

.edit-entry-btn, .delete-entry-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.edit-entry-btn:hover {
  background-color: #fff3cd;
  border-color: #ffeaa7;
}

.delete-entry-btn:hover {
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

/* Hide action buttons when printing */
@media print {
  .no-print {
    display: none !important;
  }
}
.entry strong {
  color: #495057;
}
button {
  margin: 0;
  padding: 0.3em 0.6em;
  font-size: 0.8em;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
}

/* Specific button styling */
.admin-buttons button:first-child {
  background: #007bff;
  color: white;
}

.admin-buttons button:nth-child(2) {
  background: #dc3545;
  color: white;
}

.admin-buttons button:nth-child(3) {
  background: #28a745;
  color: white;
}
#adminEditArea {
  margin-top: 1.5em;
  padding: 1.2em;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}
#adminEditArea input {
  margin: 0.4em 0.4em 0.4em 0;
  padding: 0.5em;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
}
#adminEditArea input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}
#adminEditArea h4 {
  margin-top: 0;
  color: #495057;
}
.print-preview button {
  margin: 0.5em;
  padding: 0.75em 1.5em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#actualPrintBtn {
  background: #007bff;
  color: white;
}
#closePrintBtn {
  background: #6c757d;
  color: white;
}
#generateReportBtn {
  background: #28a745;
  color: white;
  padding: 5px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#generateReportBtn:hover {
  background: #218838;
}

/* Admin section lists */
#studentList, #goalTemplateList, #classList, #teacherList, #goalList {
  list-style: none;
  padding: 0;
  margin: 1em 0;
}

#studentList li, #goalTemplateList li, #classList li, #teacherList li, #goalList li {
  background: #f8f9fa;
  padding: 0.8em;
  margin-bottom: 0.5em;
  border-radius: 4px;
  border: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#studentList li:hover, #goalTemplateList li:hover, #classList li:hover, #teacherList li:hover, #goalList li:hover {
  background: #e9ecef;
}

/* Button groups for admin lists */
.admin-buttons {
  display: flex;
  gap: 0.3em;
  flex-shrink: 0;
}

/* Admin list item text */
.admin-item-text {
  flex-grow: 1;
  margin-right: 1em;
  font-weight: 500;
}

/* Apply print styles to screen preview for consistency */
.print-preview .print-header {
  text-align: center;
  margin-bottom: 20pt;
  font-size: 16pt;
  font-weight: bold;
  border-bottom: 2pt solid black;
  padding-bottom: 10pt;
  color: black;
}

.print-preview .print-entry {
  margin-bottom: 20pt;
  padding: 12pt;
  border: 1pt solid #ccc;
  border-radius: 4px;
  background: #fafafa;
}

.print-preview .print-entry-header {
  font-weight: bold;
  font-size: 14pt;
  margin-bottom: 10pt;
  border-bottom: 1pt solid #999;
  padding-bottom: 6pt;
  color: #333;
}

.print-preview .print-field {
  margin-bottom: 8pt;
  line-height: 1.5;
}

.print-preview .print-field-label {
  font-weight: bold;
  display: inline-block;
  width: 100pt;
  color: #495057;
}

.print-preview .print-notes {
  margin-top: 10pt;
  padding: 8pt;
  background: #f5f5f5;
  border-left: 3pt solid #999;
  border-radius: 3px;
  font-style: italic;
}

.print-preview .student-section {
  margin-bottom: 30pt;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  main {
    margin: 0.5em;
    padding: 1em;
  }
  
  h1 {
    font-size: 1.3em;
    margin-bottom: 0.8em;
  }
  
  .tab {
    padding: 0.5em 1em;
    font-size: 14px;
  }
  
  form label {
    margin-top: 0.6em;
    margin-bottom: 0.2em;
    font-size: 13px;
  }
  
  form select, form textarea {
    padding: 0.4em;
    font-size: 13px;
  }
  
  form button {
    padding: 0.5em 1em;
    font-size: 13px;
    margin-top: 0.8em;
  }
  
  #scaleDescription {
    padding: 0.6em;
    font-size: 12px;
  }
  
  .entry {
    padding: 0.6em;
    font-size: 12px;
    line-height: 1.3;
  }
  
  #entries {
    margin-top: 1em;
    padding-top: 0.8em;
  }
}

/* Form optimization for compact display */
.form-row {
  display: flex;
  gap: 1em;
  margin-bottom: 0.5em;
}

.form-row .form-field {
  flex: 1;
}

.form-row .form-field label {
  margin-top: 0;
}

.action-btn {
  background-color: #28a745;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin: 10px 5px;
}

.action-btn:hover {
  background-color: #218838;
}

@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}
