/* ============================================
   YouTube Comments Component (Curated)
   ============================================ */

/* --- Main Component Container --- */
.video-comments-section {
  margin-top: 15px;
  background: rgba(26, 26, 26, 0.4); /* Subtle dark background */
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.video-comments-section.expanded {
  background: rgba(26, 26, 26, 0.7);
  border-color: var(--color-primary); /* Gold/Primary highlight when open */
}

/* --- Header (Clickable Toggle) --- */
.video-comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background: rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease;
}

.video-comments-header:hover {
  background: rgba(212, 175, 55, 0.1); /* Subtle gold hover */
}

.video-comments-label {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-comments-count {
  color: #888;
  font-size: 0.85rem;
  margin-left: auto;
  margin-right: 10px;
}

.youtube-toggle-icon {
  color: var(--color-primary);
  font-size: 0.8rem;
}

/* --- Content Area --- */
.video-comments-content {
  padding: 15px;
  border-top: 1px solid #444;
  /* Simple animation for expansion - uses opacity/transform */
  animation: slideDown 0.3s ease-out; 
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- User Comment Action Bar --- */
.comment-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 0, 0, 0.1); /* Subtle YouTube red tint */
  border: 1px solid rgba(255, 0, 0, 0.2);
  padding: 10px 15px;
  border-radius: 6px;
  margin-bottom: 15px;
}

.comment-cta-text {
  font-size: 0.9rem;
  color: #ddd;
  font-weight: 500;
}

.btn-youtube-action {
  background: #cc0000;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-youtube-action:hover {
  background: #ff0000;
}


/* ============================================
   ADMIN LAYOUT (The 3 Boxes)
   ============================================ */

.video-comments-section.admin-mode .video-comments-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Common Box Styles */
.yt-sources-box, 
.yt-saved-box, 
.yt-candidates-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 15px;
}

/* Box Headers */
.yt-sources-box h5, 
.yt-saved-box h5, 
.yt-candidates-box h5 {
  margin: 0 0 12px 0;
  color: #aaa;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #444;
  padding-bottom: 8px;
}

/* 1. Sources Box Specifics */
.source-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.source-item a {
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 85%;
}

.add-source-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.add-source-row input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #555;
  color: #eee;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* 2. Candidates Box Specifics (Staging Area) */
.yt-candidates-box {
  background: rgba(40, 40, 40, 0.2); 
  border: 1px dashed #555;
}

.candidates-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid #444;
  padding-bottom: 8px;
}

.candidates-header h5 {
  border-bottom: none;
  margin: 0;
  padding: 0;
}

.candidates-list {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
}

/* Scrollbar for candidates list */
.candidates-list::-webkit-scrollbar {
  width: 6px;
}
.candidates-list::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
}
.candidates-list::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}


/* ============================================
   COMMENT CARDS (Shared Styles)
   ============================================ */

.yt-comment {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.yt-comment:last-child {
  margin-bottom: 0;
}

/* Avatar */
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #333;
}

/* Body */
.comment-body {
  flex: 1;
  min-width: 0; 
}

/* Meta (Author name + Actions) */
.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: #ccc;
}

.comment-meta strong {
  color: var(--color-primary);
  font-weight: 600;
}

/* Comment Text */
.comment-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #eee;
  word-wrap: break-word;
}

/* --- Specific States --- */

/* Saved (Live) Comments */
.yt-comment.saved {
  background: rgba(40, 167, 69, 0.08); 
  border-left: 3px solid #28a745;     
}

/* Candidate (Staging) Comments */
.yt-comment.candidate {
  opacity: 0.85;
  border: 1px solid #444;
}

.yt-comment.candidate:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  border-color: #666;
}

/* Empty States / Hints */
.hint-text {
  color: #777;
  font-style: italic;
  text-align: center;
  padding: 15px;
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  color: #666;
  padding: 10px;
  font-style: italic;
}


/* ============================================
   MODAL STYLES (Source Selector)
   ============================================ */

.modal-overlay-new {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal-content-new {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 400px;
    animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #eee;
}

.modal-header-new {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.modal-header-new h3 {
    margin: 0;
    color: var(--color-primary);
    font-size: 1.2rem;
}

.modal-close-new {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.source-selector-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.source-select-btn {
  width: 100%;
  text-align: left;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #444;
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 6px;
  font-size: 0.9rem;
}

.source-select-btn:hover {
  background: var(--color-primary);
  color: #1e1e1e;
  border-color: var(--color-primary);
}


/* ============================================
   BUTTONS & UTILITIES (Reused from App)
   ============================================ */

.btn-x-small {
  padding: 2px 8px;
  font-size: 0.7rem;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  transition: all 0.2s;
  margin-left: 8px;
}

.btn-success {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border-color: #28a745;
}

.btn-success:hover {
  background: #28a745;
  color: white;
}

.btn-danger {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  border-color: #dc3545;
}

.btn-danger:hover {
  background: #dc3545;
  color: white;
}

/* Loading Indicator */
.loading {
  text-align: center;
  padding: 20px;
  color: var(--color-primary);
  font-style: italic;
}