/* public/css/comments.css */
/* FULL VIEWPORT REFACTOR - All px values converted to vw/vh where applicable */

.comment-marker-icon {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(20px, 2.4vw, 28px);
  height: clamp(20px, 2.4vw, 28px);
  border-radius: 50%;
  border: 0.2vw solid white;
  box-shadow: 0 0.2vh 0.8vw rgba(0, 0, 0, 0.8);
  cursor: pointer;
  z-index: 25; 
  pointer-events: auto;
  transition: transform 0.2s ease-in-out;
}

.comment-marker-icon:hover {
  transform: translate(-50%, -50%) scale(1.2);
  z-index: 26; 
}

.comment-marker-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.comment-bubble {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.1vh 0.3vw;
  line-height: 1.1;
  border-radius: 0.25vh;
  font-size: clamp(0.6rem, 0.75vw, 0.85rem);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}

.comment-marker-icon:hover .comment-bubble,
.comment-bubble.active {
  opacity: 1;
  visibility: visible;
}

#live-comments-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: clamp(400px, 70vw, 800px);
  height: 85%;
  border-radius: 0.5vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-sizing: border-box;
  z-index: 20; 
  pointer-events: none;
  gap: 1.5vh;
}

#artist-note-container {
  flex-shrink: 0;
  height: 35%;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 0.5vh;
  border: 0.1vw solid rgba(75, 85, 99, 0.7);
  box-shadow: 0 0.4vh 1.5vw rgba(0, 0, 0, 0.6);
  padding: 0.5vh 0.5vw;
  display: flex;
  flex-direction: column;
  z-index: 21; 
  position: relative;
  pointer-events: auto; 
  overflow-y: auto;
  gap: 0.5vh;
}

#artist-note-container::-webkit-scrollbar {
  width: 0.6vw;
}

#artist-note-container::-webkit-scrollbar-thumb {
  background-color: #4b5563;
  border-radius: 0.3vw;
}

#artist-note-container:empty {
    display: none;
}

#live-comments-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 0.5vh;
  border: 0.1vw solid rgba(75, 85, 99, 0.7);
  box-shadow: 0 0.4vh 1.5vw rgba(0, 0, 0, 0.6);
  padding: 0.5vh 0.5vw;
  overflow-y: auto; 
  scroll-behavior: smooth;
  z-index: 21;
  position: relative;
  pointer-events: auto;
  gap: 0.5vh;
}

#live-comments-container::-webkit-scrollbar {
  width: 0.6vw;
}

#live-comments-container::-webkit-scrollbar-thumb {
  background-color: #4b5563;
  border-radius: 0.3vw;
}

.comment-list-entry {
  display: flex;
  align-items: center; 
  gap: 0.5vw;
  padding: 0.4vh 0.4vw;
  background-color: rgba(10, 10, 10, 0.6);
  border-radius: 0.5vh;
  margin-bottom: 0.4vh;
  animation: fadeInComment 0.5s ease forwards;
  transition: background-color 0.3s ease, order 0.5s ease, box-shadow 0.3s;
  flex-shrink: 0;
  min-height: clamp(40px, 5vh, 60px); 
  box-shadow: 0 0.2vh 0.4vw rgba(0,0,0,0.4);
  position: relative;
}

.comment-list-entry.hidden {
  display: none !important;
}

.comment-list-entry.hover-highlight {
  background-color: rgba(147, 197, 253, 0.2);
}

.comment-list-entry.active-comment-highlight {
  background-color: rgba(var(--color-active-highlight-rgb, 59, 130, 246), 0.3);
  box-shadow: 0 0 0.8vw var(--color-active-highlight);
}

.comment-user-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; 
  flex-shrink: 0;
  width: clamp(48px, 6vw, 72px);
  cursor: pointer;
}

.comment-list-entry .user-profile-pic {
  width: clamp(24px, 3vw, 36px);
  height: clamp(24px, 3vw, 36px);
  border-radius: 50%;
  object-fit: cover;
  border: 0.1vw solid rgba(255, 255, 255, 0.2);
}

.comment-list-entry .comment-username {
  display: none;
}

.comment-list-entry .comment-main {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.comment-text-header {
  font-size: clamp(0.55rem, 0.7vw, 0.8rem);
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 0.15vh;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: baseline;
}

.comment-username-display {
  font-family: var(--font-name, sans-serif);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.comment-header-text {
  flex-shrink: 0;
}

.comment-timestamp {
  font-size: clamp(0.55rem, 0.7vw, 0.8rem);
  color: #9ca3af;
  margin-left: 0.4vw;
}

.comment-list-entry .comment-text {
  color: #f3f4f6;
  font-size: clamp(0.65rem, 0.8vw, 0.9rem);
  line-height: 1.15;
  word-break: break-word;
  max-height: clamp(28px, 3.6vh, 42px); 
  overflow-y: auto;
  pointer-events: auto;
}

.comment-list-entry .comment-text::-webkit-scrollbar {
  width: 0.4vw;
}

.comment-list-entry .comment-text::-webkit-scrollbar-thumb {
  background-color: #4b5563;
  border-radius: 0.2vw;
}

.comment-list-entry .comment-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center; 
  justify-content: center;
  width: clamp(36px, 4.5vw, 54px);
}

.comment-list-entry:hover .message-overlay {
    opacity: 1;
    pointer-events: auto;
}

@keyframes fadeInComment {
  from {
    opacity: 0;
    transform: translateY(1vh);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.maximized-comment-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.75vw;
  padding: 0.75vh 0;
  border-bottom: 0.1vh solid #374151;
}

.maximized-comment-entry:last-child {
  border-bottom: none;
}

.maximized-comment-entry .comment-user-area {
  width: clamp(64px, 8vw, 96px);
  justify-content: flex-start;
}

.maximized-comment-entry .user-profile-pic {
  width: clamp(32px, 4vw, 48px);
  height: clamp(32px, 4vw, 48px);
}

.maximized-comment-entry .comment-username {
  display: none; 
}

.maximized-comment-main {
  flex-grow: 1;
}

.maximized-comment-main .comment-text-header {
  font-size: clamp(0.65rem, 0.8vw, 0.9rem);
  font-weight: 700;
  color: #9ca3af;
  margin-bottom: 0.35vh;
}

.maximized-comment-body {
  margin: 0;
  font-size: clamp(0.7rem, 0.9vw, 1rem);
  line-height: 1.4;
}

.maximized-comment-entry .comment-actions {
  width: clamp(48px, 6vw, 72px);
  align-self: center;
  justify-content: center;
}

.maximized-comment-entry .comment-timestamp {
  font-size: clamp(0.7rem, 0.85vw, 0.95rem);
}

.char-counter-wrapper {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25vh;
}

#comment-char-count {
  font-size: clamp(0.6rem, 0.75vw, 0.85rem);
  color: #9ca3af;
  transition: color 0.2s ease;
}

.no-comments-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6b7280;
  font-style: italic;
}

.editor-active-parent #live-comments-container {
    visibility: hidden;
}
