/* Comment Modal Styles */
#comment-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  font-family: Arial, sans-serif;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.modal-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin: 0;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.close-modal:hover {
  color: #000;
}

.comment-form {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.comments-list {
  max-height: 300px;
  overflow-y: auto;
}

.comment-item {
  border: 1px solid #eee;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
  background: #fafafa;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.comment-author-time {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.comment-author {
  font-weight: bold;
  color: #333;
}

.comment-time {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

.translate-btn-comment {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  border: none;
  border-radius: 15px;
  padding: 4px 10px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.9;
  flex-shrink: 0;
  height: fit-content;
  align-self: flex-start;
}

.translate-btn-comment:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.translate-btn-comment.active {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.comment-text {
  line-height: 1.4;
  color: #444;
  white-space: pre-wrap;
}

.comment-actions {
  margin-top: 8px;
  text-align: right;
}

.btn-small {
  background: none;
  border: 1px solid #ddd;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  margin-left: 5px;
}

.btn-edit {
  color: #4a90e2;
  border-color: #4a90e2;
}

.btn-edit:hover {
  background: #4a90e2;
  color: white;
}

.btn-delete {
  color: #e74c3c;
  border-color: #e74c3c;
}

.btn-delete:hover {
  background: #e74c3c;
  color: white;
}

.password-prompt {
  display: inline-block;
  margin-left: 5px;
}

.password-input {
  width: 80px;
  padding: 2px 4px;
  font-size: 11px;
  margin: 0 3px;
}

.no-comments {
  text-align: center;
  color: #999;
  padding: 20px;
  font-style: italic;
}

.comment-instruction {
  position: absolute;
  bottom: 250px;
  left: 10px;
  z-index: 1000;
  background: rgba(74,144,226,0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 11px;
  font-family: Arial, sans-serif;
  display: none;
  animation: fadeInOut 4s ease-in-out;
}

.comment-instruction.show {
  display: block;
}

/* All Comments Panel */
#all-comments-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1001;
  background: linear-gradient(135deg,#667eea 0%,#764ba2 100%);
  color: white;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  max-width: 360px;
  width: 360px;
  max-height: 500px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  display: none;
  overflow: hidden;
}

.all-comments-header {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.all-comments-title {
  font-weight: 600;
  font-size: 16px;
  color: white;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.all-comments-title:before {
  content: '💬';
  font-size: 18px;
}

.all-comments-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px 20px 20px;
  background: rgba(255,255,255,0.95);
  color: #333;
}

.all-comment-item {
  background: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.all-comment-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.all-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.all-comment-region {
  font-weight: 600;
  color: #667eea;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.all-comment-region:before {
  content: '📍';
  font-size: 11px;
}

.all-comment-region:hover {
  color: #764ba2;
  text-decoration: underline;
}

.all-comment-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.all-comment-author {
  font-size: 11px;
  color: #666;
  font-weight: 500;
}

.all-comment-time {
  font-size: 10px;
  color: #999;
  margin-top: 2px;
}

.translate-btn-all-comment {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.8;
  flex-shrink: 0;
  margin-top: 2px;
}

.translate-btn-all-comment:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.translate-btn-all-comment.active {
  background: linear-gradient(135deg, #28a745, #20c997);
}

/* Top Action Buttons Container */
.top-actions {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 1002;
  display: flex;
  gap: 10px;
  align-items: center;
}

.toggle-all-comments {
  background: linear-gradient(135deg,#667eea 0%,#764ba2 100%);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.toggle-all-comments:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.community-link {
  background: linear-gradient(135deg,#ff6b6b 0%,#ee5a52 100%);
  color: white;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.community-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,107,107,0.3);
  color: white;
}

.community-icon {
  font-size: 14px;
}

.community-text {
  font-size: 12px;
}