/* ================================================================
   comments.css — Comment Section Styles
   compu-pc.es | Renders inside .content-main (white bg)
   ================================================================ */

/* ================================================================
   SECTION WRAPPER
   ================================================================ */
.comment-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 2px solid #eee;
}

.comment-section-head { margin-bottom: 14px; }

.comment-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* ================================================================
   FILTER + SORT BAR
   ================================================================ */
.comment-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #f7f7f7;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 13px;
}

.cc-label {
  font-size: 12px;
  font-weight: 700;
  color: #666;
}

.comment-controls select {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #333;
  font-size: 13px;
  padding: 5px 24px 5px 8px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  cursor: pointer;
}
.comment-controls select:focus {
  outline: none;
  border-color: #c8001e;
}

/* ================================================================
   COMMENT LIST
   ================================================================ */
.comment-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  transition: opacity 0.2s;
}
.comment-list.loading { opacity: 0.4; pointer-events: none; }

.comment-empty {
  text-align: center;
  padding: 32px 16px;
  color: #888;
  font-size: 14px;
  list-style: none;
}

/* ================================================================
   SINGLE COMMENT
   ================================================================ */
.comment {
  position: relative;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 14px 14px 10px;
  margin-bottom: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.comment:hover { border-color: #ccc; }

/* Featured comment */
.comment--featured {
  border-left: 3px solid #014464;
  background: #f8fbff;
}

/* Highlighted via URL hash */
.comment-highlighted {
  border-color: #c8001e !important;
  box-shadow: 0 0 0 2px rgba(200,0,30,0.15);
}

/* Type badge (top-right corner) */
.comment-badge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 3px 10px;
  border-radius: 0 8px 0 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ---- Author ---- */
.comment-inner { display: flex; flex-direction: column; gap: 8px; }

.comment-author {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.comment-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid #ddd;
  flex-shrink: 0;
  object-fit: cover;
}
.comment-avatar--sm { width: 36px; height: 36px; }

.comment-meta { display: flex; flex-direction: column; gap: 2px; }

.comment-name {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.comment-time {
  font-size: 11px;
  color: #999;
}

/* ---- Content ---- */
.comment-content {
  font-size: 14px;
  color: #333;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
  padding: 4px 0;
}

/* ---- Actions ---- */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}

/* Karma voting */
.comment-karma {
  display: flex;
  align-items: center;
  gap: 4px;
}

.karma-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #bbb;
  padding: 3px 5px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s, transform 0.15s;
  line-height: 1;
}
.karma-btn:hover { color: #555; background: #f0f0f0; transform: scale(1.15); }
.karma-btn.active { font-weight: 900; }
.karma-btn--up.active  { color: #1a6624; }
.karma-btn--down.active{ color: #c8001e; }
.karma-btn:disabled { opacity: 0.4; pointer-events: none; }

.karma-score {
  font-size: 13px;
  font-weight: 700;
  color: #888;
  min-width: 18px;
  text-align: center;
  transition: transform 0.2s;
}
.karma-score.positive { color: #1a6624; }
.karma-score.negative { color: #c8001e; }
.karma-score.bounce { animation: karma-bounce 0.3s ease; }
@keyframes karma-bounce {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.4); }
}

/* Reply button */
.comment-reply-btn {
  font-size: 12px;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.comment-reply-btn:hover { color: #c8001e; background: rgba(200,0,30,0.06); }

/* ================================================================
   NESTED REPLIES
   ================================================================ */
.comment-replies {
  list-style: none;
  margin: 10px 0 0 20px;
  padding: 0 0 0 14px;
  border-left: 2px solid rgba(200,0,30,0.25);
}

.comment--reply {
  background: #fafafa;
  border-color: #eee;
  margin-bottom: 8px;
}

/* ================================================================
   LOAD MORE BUTTON
   ================================================================ */
.comment-loadmore-wrap {
  text-align: center;
  margin: 12px 0 20px;
}

.btn-loadmore {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #555;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-loadmore:hover {
  background: #efefef;
  border-color: #c8001e;
  color: #c8001e;
}
.btn-loadmore.loading { opacity: 0.6; pointer-events: none; }
.loadmore-count { font-size: 12px; color: #999; }

/* ================================================================
   COMMENT FORM
   ================================================================ */
.comment-form-wrap {
  margin-top: 24px;
  padding: 20px;
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

.comment-form-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin-bottom: 14px;
}

/* Reply indicator */
.reply-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(200,0,30,0.05);
  border-left: 3px solid #c8001e;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: #333;
  margin-bottom: 12px;
}
.reply-indicator strong { color: #c8001e; }

.cancel-reply {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 12px;
  margin-left: auto;
  padding: 2px 6px;
  transition: color 0.15s;
}
.cancel-reply:hover { color: #c8001e; }

/* Honeypot */
.comment-hp {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Form rows */
.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 560px) {
  .comment-form-row { grid-template-columns: 1fr; }
}

.comment-form-field { margin-bottom: 12px; }

.comment-form-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.comment-form-field label small {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #aaa;
}

.cf-req { color: #c8001e; }

.comment-form-field input,
.comment-form-field textarea {
  width: 100%;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  color: #222;
  font-size: 14px;
  padding: 9px 12px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}
.comment-form-field input::placeholder,
.comment-form-field textarea::placeholder { color: #bbb; }
.comment-form-field input:focus,
.comment-form-field textarea:focus {
  outline: none;
  border-color: #c8001e;
  box-shadow: 0 0 0 3px rgba(200,0,30,0.1);
}

.cf-chars {
  text-align: right;
  font-size: 11px;
  color: #bbb;
  margin-top: 3px;
}

/* Status messages */
.comment-msg {
  display: none;
  padding: 10px 14px;
  border-radius: 5px;
  font-size: 13px;
  margin-bottom: 12px;
}
.comment-msg--success { background: #f0fff4; border: 1px solid #86efac; color: #166534; }
.comment-msg--error   { background: #fff0f0; border: 1px solid #fca5a5; color: #991b1b; }
.comment-msg--pending { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }

/* Form footer */
.comment-form-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.comment-form-note {
  font-size: 11px;
  color: #aaa;
  max-width: 340px;
  line-height: 1.5;
}

.btn-comment-submit {
  background: linear-gradient(135deg, #8c0015, #c8001e);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 24px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 10px rgba(200,0,30,0.25);
  white-space: nowrap;
}
.btn-comment-submit:hover {
  background: linear-gradient(135deg, #c8001e, #ff3a5c);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(200,0,30,0.35);
}
.btn-comment-submit:active { transform: translateY(0); }
.btn-comment-submit:disabled { opacity: 0.6; pointer-events: none; }
