@import url("https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap");

body {
  margin: 0;
  padding: 0;
  font-family: "Space Mono", monospace;
  background-color: #d3d3d3;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.item-content {
  position: relative;
  text-align: left;
  border: 4px solid #808080;
  padding: 40px;
  background-color: #e8e8e8;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
  width: 550px;
  max-height: 90vh;
  overflow-y: auto;
}

.item-content h2 {
  margin-top: 0;
  font-size: 32px;
  color: #404040;
  font-weight: normal;
}

.item-content label {
  display: block;
  margin: 20px 0 12px 0;
  font-size: 20px;
  color: #505050;
  text-align: left;
}

.item-content input[type="password"] {
  width: 100%;
  padding: 15px;
  font-size: 20px;
  border: 3px solid #999;
  background-color: #f5f5f5;
  color: #333;
  box-sizing: border-box;
  font-family: monospace;
}

.requirements {
  margin-top: 30px;
  padding: 22px;
  background-color: #d8d8d8;
  border: 3px solid #999;
}

.requirements h3 {
  margin: 0 0 15px 0;
  font-size: 20px;
  color: #404040;
}

.requirement-list {
  font-size: 18px;
  color: #555;
}

.requirement {
  margin: 12px 0;
  padding: 9px;
  background-color: #ccc;
  border-left: 4px solid #c44;
  transition: all 0.3s ease;
}

.requirement.met {
  background-color: #d4edda;
  border-left-color: #28a745;
  color: #155724;
}

.requirement.new {
  animation: slideIn 0.5s ease;
  background-color: #fff3cd;
  border-left-color: #ffc107;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.item-content button {
  margin-top: 20px;
  padding: 15px 45px;
  background-color: #999;
  color: #fff;
  border: 3px solid #777;
  cursor: pointer;
  font-size: 20px;
}

.item-content button:hover {
  background-color: #888;
}

.hover-overlay {
  margin-top: 18px;
  color: #666;
  font-size: 16px;
}

.feedback-message {
  margin-top: 15px;
  padding: 12px;
  font-size: 18px;
  border: 2px solid #999;
}

.feedback-message.error {
  background-color: #ddd;
  color: #555;
}

.feedback-message.warning {
  background-color: #e0e0e0;
  color: #555;
}

.feedback-message.hidden {
  display: none;
}

.mistake-counter {
  margin-top: 20px;
  padding: 18px;
  background-color: #d8d8d8;
  border: 3px solid #999;
  min-height: 75px;
}

.mistake-list {
  text-align: left;
  font-size: 16px;
  color: #444;
  line-height: 1.6;
}

.mistake-list div {
  margin: 9px 0;
  padding: 6px;
  background-color: #ccc;
  border-left: 4px solid #888;
}

.bottom-left-description {
  position: fixed;
  bottom: 10px;
  left: 10px;
  color: #5e6c84;
  font-size: 0.8rem;
}

.bottom-left-description p {
  margin: 0.25rem 0;
}

.bottom-left-description strong {
  color: #42526e;
}

.hint-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 15px;
  height: 15px;
  background-color: #999;
  color: white;
  border: 2px solid #777;
  font-size: 5px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hint-button:hover {
  background-color: #777;
}

.hint-popup {
  position: absolute;
  top: 35px;
  right: 10px;
  background-color: #fff;
  border: 2px solid #999;
  padding: 10px;
  font-size: 11px;
  color: #333;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  width: 150px;
  display: none;
  z-index: 100;
}

.hint-popup.show {
  display: block;
}

.hidden-home {
  position: absolute;
  bottom: 10px;
  right: 10px;
  color: #5e6c84;
  font-size: 5px;
  text-decoration: none;
  opacity: 0.7;
}

.hidden-home:hover {
  color: #42526e;
  text-decoration: underline;
}

@media (max-width: 520px) {
  body {
    padding: 20px 16px;
    align-items: flex-start;
    box-sizing: border-box;
  }

  .item-content {
    width: 100%;
    padding: 24px 20px;
    box-sizing: border-box;
  }

  .item-content h2 {
    font-size: 22px;
  }

  .item-content label {
    font-size: 16px;
    margin: 14px 0 8px 0;
  }

  .item-content input[type="password"] {
    font-size: 16px;
    padding: 10px;
  }

  .item-content button {
    font-size: 16px;
    padding: 12px 28px;
  }

  .requirements {
    padding: 16px;
    margin-top: 20px;
  }

  .requirements h3 {
    font-size: 16px;
  }

  .requirement-list {
    font-size: 14px;
  }

  .feedback-message {
    font-size: 14px;
    padding: 10px;
  }

  .mistake-list {
    font-size: 13px;
  }

  .bottom-left-description {
    font-size: 10px;
  }
}

@media print {
  /* Page setup */
  @page {
    size: letter;
    margin: 0.75in;
  }

  /* Hide everything first */
  body * {
    visibility: hidden;
  }

  /* Hide all UI elements */
  button,
  .hint-button,
  .hover-overlay,
  .feedback-message,
  .bottom-left-description,
  .hidden-home,
  input,
  label,
  h2,
  .requirements {
    display: none !important;
    visibility: hidden !important;
  }

  /* Show only the content container */
  .item-content,
  .item-content * {
    visibility: visible;
  }

  .item-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
    background: white;
    padding: 0;
  }

  /* Add Users' Catalog title */
  .item-content::before {
    content: "Users' Catalog";
    display: block;
    visibility: visible;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #333;
    color: #000;
  }

  /* Style the mistake counter */
  .mistake-counter {
    display: block !important;
    visibility: visible;
    page-break-inside: avoid;
    background: white;
    border: 2px solid #666;
    padding: 20px;
  }

  .mistake-counter::before {
    content: "Error Log - All Visited Pages";
    display: block;
    visibility: visible;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #999;
    color: #000;
  }

  /* Style error entries */
  .mistake-list div {
    visibility: visible;
    background: #f9f9f9;
    border-left: 4px solid #c00;
    margin: 10px 0;
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
    page-break-inside: avoid;
  }
}
