/* Global styles */
body {
  margin: 0;
  padding: 0;
  background: #fafafa;
  font-family: sans-serif;
}
.content {
  margin: 2em auto;
  max-width: 1200px;
  padding: 1em;
}

/* Persistent header */
.persistent-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #333;
  color: #fff;
  padding: 0.5em;
  text-align: right;
  z-index: 1000;
}
.persistent-header a {
  color: #fff;
  text-decoration: none;
  margin-left: 1em;
}
#gameModeDisplay {
  margin-right: 1em;
}

/* Category header styles */
.category-header {
  background: #f5f5f5;
  padding: 0.5em;
  border-radius: 4px;
  margin-bottom: 0.8em;
  text-align: center;
}
.category-header.measuring {
  background: #e0f7fa;
}
.category-header.thermometer {
  background: #ffe0b2;
}
.category-header.radar {
  background: #d1c4e9;
}
.category-header.tentacles {
  background: #c8e6c9;
}
.category-header.photos {
  background: #e8f5e9;
}
.title-row {
  font-size: 1em;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: baseline;
}
.title-row span:first-child {
  margin-right: 0.3em;
  color: #555;
}
.meta-row {
  font-size: 0.8em;
  color: #333;
  margin: 0.3em 0;
  display: flex;
  justify-content: center;
  gap: 0.5em;
}
.rule {
  font-size: 0.8em;
  font-style: italic;
  color: #666;
}
.sub-rule {
  font-size: 0.8em;
  font-style: italic;
  color: #555;
  margin-top: 0.3em;
}

/* Section and list styles */
.section {
  margin-bottom: 0.8em;
}
.section h3 {
  margin: 0.3em 0;
  font-size: 0.9em;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.1em;
  text-align: left;
}
.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.note-list li {
  padding: 0.3em 0;
  border-bottom: 1px solid #eee;
  display: flex;
  flex-direction: column;
}

/* Header container for checkmark and text */
.header-container {
  display: flex;
  align-items: center;
  gap: 0.3em;
  cursor: pointer;
}
.item-header {
  font-weight: bold;
  flex: 1;
  text-align: left;
}

/* Note textarea styles */
.note {
  display: none;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.85em;
  padding: 0.3em;
  margin-top: 0.2em;
  border: 1px solid #ccc;
  border-radius: 3px;
  resize: none;
  overflow-y: hidden;
  min-height: 1.2em;
}

/* Clear button style */
.clear-btn {
  display: block;
  margin: 1em auto;
  background: #d9534f;
  color: white;
  border: none;
  padding: 0.4em 0.8em;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}

/* Checkmark input */
input.checkmark {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
}
.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 1em;
  border-radius: 4px;
  max-width: 400px;
  position: relative;
}
.close-button {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  font-size: 1.2em;
  cursor: pointer;
}

/* Settings modal additional element */
.setting-item {
  margin-bottom: 1em;
}
.setting-item label {
  margin-right: 0.5em;
}

/* Disable scroll when modal is active */
.no-scroll {
  overflow: hidden;
}

/* Utility class to hide elements */
.hidden {
  display: none !important;
}

/* No items message style for Tentacles section */
.no-items-message {
  font-style: italic;
  margin-top: 0.5em;
  text-align: center;
}

/* Description text for PHOTOS section */
.description {
  font-style: italic;
  font-size: 0.8em;
  color: #555;
  margin: 0.3em 0;
}

/* Photo controls for PHOTOS section */
.photo-controls {
  margin-top: 0.5em;
}
.photo-controls .upload-photo-btn {
  font-size: 0.9em;
  padding: 0.3em 0.6em;
  margin-right: 0.5em;
}
.photo-controls .photo-display {
  margin-top: 0.5em;
}
.photo-controls .photo-display img {
  max-width: 100%;
  height: auto;
  cursor: pointer;
  display: block;
}

/* Layout adjustments for larger screens */
@media screen and (min-width: 800px) {
  .category-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 1em;
  }
  
  /* Ensure no-items message spans full grid width and is centered */
  .category-content .no-items-message {
    grid-column: 1 / -1;
    text-align: center;
  }
}
