/* Comments Modal */
.comments-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 500px;
  margin: 0 auto;
  background: #0f0f0f;
  border-radius: 12px 12px 0 0;
  z-index: 1200;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.comments-modal.show {
  transform: translateY(0);
}

.comments-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.comments-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.comments-header {
  padding: 16px 20px;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.comments-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.comments-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.comments-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.comments-list::-webkit-scrollbar {
  width: 6px;
}

.comments-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

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

.comment-header {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-body {
  flex: 1;
}

.comment-user {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.comment-time {
  font-size: 0.75rem;
  color: #999;
  margin-left: 8px;
}

.comment-content {
  font-size: 0.9rem;
  color: #e0e0e0;
  line-height: 1.4;
  margin-bottom: 8px;
}

.comment-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.comment-action-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.comment-action-btn:hover {
  color: #fff;
}

.comment-replies {
  margin-left: 48px;
  margin-top: 12px;
  padding-left: 12px;
  border-left: 2px solid #333;
}

.comment-replies .comment-item {
  margin-bottom: 12px;
}

.view-more-replies {
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  margin-left: 48px;
}

.view-more-replies:hover {
  text-decoration: underline;
}

.comments-input-container {
  padding: 12px 20px;
  border-top: 1px solid #333;
  background: #0f0f0f;
  flex-shrink: 0;
}

.comments-input-container.guest-mode .comments-input {
  opacity: 0.75;
}

.comments-input-container.guest-mode .comments-send-btn {
  width: auto;
  min-width: 64px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.comments-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
}

.comments-input-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.comments-input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 10px 16px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  resize: none;
  max-height: 100px;
  overflow-y: auto;
}

.comments-input:focus {
  border-color: #3b82f6;
}

.comments-input::placeholder {
  color: #666;
}

.comments-send-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #3b82f6;
  color: #fff;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.comments-send-btn:hover:not(:disabled) {
  background: #2563eb;
}

.comments-send-btn:disabled {
  background: #333;
  cursor: not-allowed;
  opacity: 0.5;
}

.comments-empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.comments-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.comments-empty-text {
  font-size: 0.9rem;
}

.comments-loading {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.reply-form {
  margin-left: 48px;
  margin-top: 8px;
  display: none;
}

.reply-form.show {
  display: flex;
  gap: 8px;
  align-items: center;
}

.reply-form .comments-input {
  font-size: 0.85rem;
  padding: 8px 12px;
}

.reply-form .comments-send-btn {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.cancel-reply-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px;
}

.cancel-reply-btn:hover {
  color: #fff;
}

/* Pinned Comment */
.comment-item.pinned {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.pinned-badge {
  font-size: 0.75rem;
  color: #4a9eff;
  margin-bottom: 8px;
  font-weight: 500;
}

/* Comment Edit Form */
.comment-edit-form {
  margin-top: 8px;
}

.comment-edit-form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 60px;
}

.comment-edit-form textarea:focus {
  outline: none;
  border-color: #4a9eff;
}

.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Action Buttons */
.comment-action-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.comment-action-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.comment-action-btn.active {
  color: #4a9eff;
}

.comment-action-btn.dislike.active {
  color: #ff6b6b;
}

.comment-action-btn.delete-btn:hover {
  color: #ff4444;
}

.comment-action-btn.report-btn:hover {
  color: #ff9944;
}

.comment-action-btn.pin-btn:hover {
  color: #4a9eff;
}

.comment-action-btn.unpin-btn:hover {
  color: #ffd700;
}

/* Load More Replies */
.load-more-replies {
  background: none;
  border: none;
  color: #4a9eff;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px 12px;
  margin-left: 48px;
  margin-top: 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.load-more-replies:hover {
  background: rgba(74, 158, 255, 0.1);
}

@media (max-width: 768px) {
  .comments-modal {
    max-width: 100%;
    max-height: 90vh;
  }
}

/* Confirm Dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
}

.confirm-overlay.show { display: flex; }

.confirm-modal {
  width: min(420px, 92vw);
  background: #121212;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  color: #eaeaea;
  overflow: hidden;
}

.confirm-header {
  padding: 14px 16px;
  font-weight: 700;
  border-bottom: 1px solid #2a2a2a;
}

.confirm-body {
  padding: 16px;
  font-size: 0.95rem;
  color: #cfcfcf;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 16px 16px 16px;
}

.btn {
  appearance: none;
  border: 1px solid #3a3a3a;
  background: #1b1b1b;
  color: #eaeaea;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s;
}

.btn:hover { background: #222; border-color: #4a4a4a; }
.btn:active { transform: translateY(1px); }

.btn-secondary { color: #cfcfcf; }
.btn-danger {
  background: #b91c1c;
  border-color: #c02626;
}
.btn-danger:hover { background: #a31616; border-color: #b91c1c; }

