/* Annotation-specific styles for RedPen application */

/* Overlay Container */
#overlay-container {
  position: absolute;
}

/* Annotation Circles */
.circle {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: rgba(255,255,255,0.8);
  font-size: 24px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
  transform: translateX(-50%); /* Center relative to the point */
}

/* Comment Popups */
.comment-popup {
  position: absolute;
  background: #fff;
  border: 2px solid #DC143C;
  border-radius: 8px;
  padding: 15px;
  max-width: 300px; /* Default max-width, can be overridden by JavaScript for specific cases */
  box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
  z-index: 100;
  display: none;
  font-size: 14px;
  color: #333;
  transform: translateX(-50%); /* Center relative to the point */
}

.comment-popup::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%); /* Center the arrow on the popup */
  border-width: 0 10px 10px 10px;
  border-style: solid;
  border-color: transparent transparent #DC143C transparent;
}

/* Arrow pointing down for popups positioned above the annotation */
.comment-popup.above::before {
  top: auto; /* Remove top positioning */
  bottom: -10px; /* Position at the bottom */
  border-width: 10px 10px 0 10px; /* Flip the triangle */
  border-color: #DC143C transparent transparent transparent; /* Change border colors */
}

.comment-popup-title {
  color: #DC143C;
  font-weight: bold;
  margin-bottom: 8px;
  border-bottom: 1px solid #DC143C;
  padding-bottom: 5px;
}

/* Global Comment Container styles moved to global-comment.css */

/* Markdown Styles */
.comment-content h1,
.comment-content h2,
.comment-content h3,
.comment-content h4,
.comment-content h5,
.comment-content h6 {
  color: #333;
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-weight: bold;
  line-height: 1.2;
}

.comment-content h1 {
  font-size: 1.8em;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.3em;
}

.comment-content h2 {
  font-size: 1.5em;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.3em;
}

.comment-content h3 {
  font-size: 1.3em;
}

.comment-content h4 {
  font-size: 1.1em;
}

.comment-content h5, .comment-content h6 {
  font-size: 1em;
}

.comment-content p {
  margin: 0.5em 0;
  line-height: 1.5;
}

.comment-content ul, .comment-content ol {
  margin: 0.5em 0;
  padding-left: 2em;
}

.comment-content ul {
  list-style-type: disc;
}

.comment-content ol {
  list-style-type: decimal;
}

.comment-content li {
  margin: 0.3em 0;
}

.comment-content blockquote {
  margin: 0.5em 0;
  padding: 0.5em 1em;
  border-left: 4px solid #ddd;
  background-color: #f9f9f9;
  color: #555;
}

.comment-content pre {
  margin: 0.5em 0;
  padding: 0.5em;
  background-color: #f6f8fa;
  border-radius: 3px;
  overflow-x: auto;
}

.comment-content code {
  font-family: monospace;
  background-color: #f6f8fa;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

.comment-content pre code {
  padding: 0;
  background-color: transparent;
}

.comment-content a {
  color: #DC143C;
  text-decoration: none;
}

.comment-content a:hover {
  text-decoration: underline;
}

.comment-content img {
  max-width: 100%;
  height: auto;
}

.comment-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5em 0;
}

.comment-content table th,
.comment-content table td {
  border: 1px solid #ddd;
  padding: 0.5em;
}

.comment-content table th {
  background-color: #f6f8fa;
  font-weight: bold;
}

.comment-content hr {
  height: 1px;
  background-color: #ddd;
  border: none;
  margin: 1em 0;
}

/* Mobile Overlay */
.mobile-overlay {
  position: fixed;
  top: 25%; /* Start at 25% from top to cover 75% of screen */
  left: 0;
  right: 0;
  bottom: auto; /* Changed from bottom:0 to allow scrolling past the overlay */
  background: rgba(255,255,255,0.95);
  z-index: 100;
  display: none;
  padding: 20px;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
  width: 100%;
  overflow-x: hidden;
  max-height: 40vh; /* Reduced height to ensure global comment is visible */
}

.mobile-overlay-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  color: #DC143C;
  cursor: pointer;
  width: 30px;
  height: 30px;
  text-align: center;
  line-height: 30px;
}

.mobile-comment-content {
  margin-top: 40px;
  font-size: 16px;
  width: 100%;
  overflow-x: hidden;
}
