/* commentSidebar.css - Refactored for a Google Docs-style conversation view */

/* ==========================================================================
   Sidebar Layout (No Changes Here)
   ========================================================================== */

   .comment-sidebar {
    width: 340px; /* A bit wider to accommodate padding */
    padding: 0;
    border-left: 1px solid var(--border-color);
    background-color: var(--background-primary);
    overflow-y: auto;
    height: 100%;
    transition: width 0.3s ease;
    position: relative;
    box-sizing: border-box;
    flex-shrink: 0;
    font-family: var(--font-ui); /* Use Inter for UI elements */
  }
  .comment-sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; background: var(--background-primary); z-index: 10;
  }
  .comment-sidebar.collapsed { width: 70px; padding: 1.5rem 0; overflow: hidden; }
  .comment-sidebar-header h3 { 
    margin: 0; 
    color: var(--text-primary); 
    font-size: 1.1em; 
    font-weight: 600; 
    font-family: var(--font-ui); /* Explicitly use Inter for UI */
  }
  .comment-sidebar.collapsed .comment-sidebar-header h3 { display: none; }
  .collapse-toggle { 
    background: none; 
    border: none; 
    font-size: 1.25rem; 
    cursor: pointer; 
    color: var(--text-secondary); 
    padding: 0.5rem; 
    border-radius: 50%; 
    line-height: 1; 
    transition: background-color 0.2s ease, color 0.2s ease;
    font-family: var(--font-ui); /* Use Inter for UI */
  }
  .collapse-toggle:hover { background-color: var(--border-color); color: var(--text-primary); }
  .comment-sidebar.collapsed .collapse-toggle { font-size: 18px; padding: 8px; }
  
  .comment-list {
      padding: 1.5rem;
  }
  
  /* ==========================================================================
     Comment Item & Thread (COMPLETE REFACTOR)
     ========================================================================== */
  
  /* The card for a single conversation thread */
  .comment-item {
    background-color: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
  }
  
  .comment-item.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-highlight-soft);
  }
  
  .comment-status-resolved {
    opacity: 0.65;
    background-color: var(--background-primary);
  }
  
  /* Metadata (Author & Time) for any message */
  .comment-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
  }
  .comment-meta strong {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 0.25em;
  }
  
  /* The body text of any message */
  .comment-body p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap; /* Respect line breaks in text */
    word-wrap: break-word;
    text-align: left;
  }
  
  /* Container for replies, visually separating them from the main comment */
  .comment-thread {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }
  
  /* A single reply within the thread */
  .comment-reply {
    position: relative;
    padding-left: 1.25rem; /* Indentation for the reply */
    margin-bottom: 1rem;
  }
  .comment-reply:last-child {
    margin-bottom: 0;
  }
  
  /* The vertical connecting line for replies */
  .comment-reply::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background-color: var(--border-color);
    border-radius: 2px;
  }
  
  /* Action buttons (Reply, Resolve) - subtle text links */
  .comment-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
  }
  .comment-actions button {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8em;
    font-weight: 500;
    font-family: var(--font-ui); /* Use Inter for UI */
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
  }
  .comment-actions button:hover {
    color: var(--accent-primary);
    text-decoration: underline;
  }
  
  /* Input areas for new comments and replies */
  .new-comment-input-area,
  .reply-input-area {
    margin-top: 1rem;
  }
  .new-comment-input-area textarea,
  .reply-input-area textarea {
    width: 100%; box-sizing: border-box; min-height: 70px;
    padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 6px;
    font-size: 0.9em; resize: vertical; font-family: var(--font-ui); /* Use Inter for UI input */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
  .new-comment-input-area textarea:focus,
  .reply-input-area textarea:focus {
    outline: none; border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-highlight-soft);
  }
  
  /* Buttons within input areas */
  .new-comment-buttons, .reply-input-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
  .new-comment-buttons button, .reply-input-buttons button {
    border: 1px solid var(--border-color); padding: 0.5rem 1rem;
    border-radius: 6px; cursor: pointer; font-size: 0.85em;
    font-weight: 600; transition: all 0.2s ease;
    font-family: var(--font-ui); /* Use Inter for UI buttons */
  }
  /* Primary save/reply button */
  .save-button {
    background-color: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
  }
  .save-button:hover { background-color: var(--accent-primary-hover); }
  
  /* Secondary cancel button */
  .cancel-button {
    background-color: transparent; color: var(--text-secondary);
  }
  .cancel-button:hover { background-color: var(--background-primary); color: var(--text-primary); }