/* KTR Vote & Comment Styles */

/* --- Vote button (card) --- */
.ktr-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid #ec4899;
  color: #ec4899;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.ktr-vote-btn:hover:not(:disabled) {
  background: #ec4899;
  color: #fff;
}
.ktr-vote-btn[data-voted="1"] {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
}
.ktr-vote-btn-large {
  padding: 12px 22px;
  font-size: 15px;
  gap: 8px;
}
.ktr-vote-icon {
  font-size: 14px;
  line-height: 1;
}

.ktr-stats {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
}
.ktr-stats strong {
  color: #111827;
  font-weight: 700;
  font-size: 13px;
}

/* --- Ranking tabs --- */
.ktr-rank-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin: 0 0 24px 0;
  padding: 6px;
  background: #f9fafb;
  border-radius: 12px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.ktr-rank-tab {
  flex: 1 1 auto;
  min-width: 70px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.ktr-rank-tab:hover {
  color: #111827;
}
.ktr-rank-tab.ktr-tab-active {
  background: #957153;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ktr-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}
.ktr-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.ktr-rank-item:hover {
  border-color: #ec4899;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.ktr-rank-badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
}
.ktr-rank-badge.ktr-rank-1 {
  background: #fbbf24;
  color: #fff;
}
.ktr-rank-badge.ktr-rank-2 {
  background: #d1d5db;
  color: #fff;
}
.ktr-rank-badge.ktr-rank-3 {
  background: #d97706;
  color: #fff;
}
.ktr-rank-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
}
.ktr-rank-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ktr-rank-title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}
.ktr-rank-count {
  flex-shrink: 0;
}
.ktr-rank-count strong {
  font-size: 18px;
  font-weight: 700;
}
.ktr-rank-count span {
  font-size: 0.8em;
  margin-left: 2px;
}
.ktr-rank-loading,
.ktr-rank-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* --- Modal --- */
.ktr-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  animation: ktr-fadeIn 0.15s ease-out;
}
@keyframes ktr-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.ktr-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: ktr-slideUp 0.2s ease-out;
}
@keyframes ktr-slideUp {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.ktr-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #111827;
}
.ktr-modal-sub {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 20px;
}
.ktr-modal-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 16px;
}
.ktr-modal-optional {
  font-weight: 400;
  color: #9ca3af;
  font-size: 11px;
}
.ktr-modal-label input,
.ktr-modal-label textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  box-sizing: border-box;
}
.ktr-modal-label input:focus,
.ktr-modal-label textarea:focus {
  outline: none;
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}
.ktr-report-reasons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}
.ktr-report-reasons label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.ktr-modal-error {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}
.ktr-modal-note {
  font-size: 12px;
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fed7aa;
  padding: 10px;
  border-radius: 8px;
  margin: 12px 0;
}
.ktr-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.ktr-btn-cancel,
.ktr-btn-submit {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.ktr-btn-cancel {
  background: #f3f4f6;
  color: #4b5563;
}
.ktr-btn-cancel:hover {
  background: #e5e7eb;
}
.ktr-btn-submit {
  background: #ec4899;
  color: #fff;
}
.ktr-btn-submit:hover:not(:disabled) {
  background: #db2777;
}
.ktr-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Comments --- */
.ktr-comments-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #f3f4f6;
}
.ktr-cm-count {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 16px;
}
.ktr-cm-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  font-size: 14px;
  background: #f9fafb;
  border-radius: 12px;
}
.ktr-cm-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ktr-cm-item {
  padding: 14px 16px;
  background: #f9fafb;
  border-radius: 10px;
}
.ktr-cm-head {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
  flex-wrap: wrap;
}
.ktr-cm-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}
.ktr-cm-uid {
  font-size: 11px;
  color: #9ca3af;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}
.ktr-cm-time {
  font-size: 11px;
  color: #9ca3af;
  margin-left: auto;
}
.ktr-cm-body {
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
  word-break: break-word;
}
.ktr-cm-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
.ktr-cm-report {
  padding: 4px 10px;
  font-size: 11px;
  color: #9ca3af;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.ktr-cm-report:hover {
  color: #dc2626;
  border-color: #dc2626;
}
.ktr-cm-more {
  display: block;
  margin: 16px auto 0;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
}
.ktr-cm-more:hover {
  border-color: #ec4899;
  color: #ec4899;
}
