/* -------------------------------------------------------------------------- */
/* GLOBAL COMMENTS UI                                                         */
/* -------------------------------------------------------------------------- */

:root {
  --gc-primary: #007bff;       /* Default Blue */
  --gc-secondary: #6c757d;     /* Default Grey */
  --gc-bg: #f8f9fa;            /* Light Background */
  --gc-card-bg: #ffffff;       /* White Card */
  --gc-text: #333333;          /* Dark Text */
  --gc-light-text: #666666;    /* Muted Text */
  --gc-border: #e0e0e0;        /* Border Color */
  --gc-radius: 12px;           /* Border Radius */
  --gc-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Scoped Container */
.gc-container {
  font-family: inherit; /* Inherit site font */
  width: 100%;
  max-width: 100%;
  margin: 2rem auto;
  padding: 1.5rem;
  background: var(--gc-bg);
  border-radius: var(--gc-radius);
  box-sizing: border-box;
}

.gc-container * {
  box-sizing: border-box;
}

/* Header */
.gc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--gc-border);
  padding-bottom: 0.5rem;
}

.gc-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gc-text);
}

.gc-count {
  background: var(--gc-primary);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
}

/* Form */
.gc-form-card {
  background: var(--gc-card-bg);
  padding: 1.5rem;
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow);
  margin-bottom: 2rem;
  transition: transform 0.2s;
}

.gc-form-card:hover {
  transform: translateY(-2px);
}

.gc-input-group {
  margin-bottom: 1rem;
}

.gc-input, .gc-textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--gc-border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  font-family: inherit;
}

.gc-input:focus, .gc-textarea:focus {
  outline: none;
  border-color: var(--gc-primary);
}

.gc-textarea {
  min-height: 100px;
  resize: vertical;
}

.gc-submit-btn {
  background: var(--gc-primary);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gc-submit-btn:hover {
  opacity: 0.9;
}

.gc-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* List */
.gc-comment-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gc-comment-card {
  background: var(--gc-card-bg);
  padding: 1rem;
  border-radius: var(--gc-radius);
  border-left: 4px solid var(--gc-primary); /* Use primary for border */
  box-shadow: var(--gc-shadow);
  position: relative;
}

/* Avatar and Header */
.gc-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.gc-author-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gc-border);
}

.gc-author {
  font-weight: bold;
  color: var(--gc-text);
}

.gc-date {
  color: var(--gc-light-text);
  font-size: 0.8rem;
}

.gc-body {
  font-size: 1rem;
  color: #444;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Actions */

.gc-actions {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap; /* allow wrapping on small screens */
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}

.gc-reactions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.gc-reaction-btn {
    background: #f0f2f5;
    border: none;
    padding: 4px 8px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
    color: var(--gc-text);
}

.gc-reaction-btn:hover {
    background: #e4e6eb;
}

.gc-delete {
  color: #e53935;
  display: none;
}

.gc-action-btn {
  background: #f0f2f5;
  border: none;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gc-light-text);
  transition: background 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gc-action-btn:hover {
  background: #e4e6eb;
  color: var(--gc-primary);
}

.gc-user-delete {
  color: #e53935;
  display: inline-flex;
  cursor: pointer;
  background: #fff0f0;
}

.gc-user-delete:hover {
  background: #ffd6d6;
  color: #c62828;
}

/* Replies */
.gc-replies {
  margin-top: 1rem;
  padding-left: 1.5rem;
  border-left: 2px solid #eee;
}

.gc-reply-card {
  background: #f1f8ff;
  padding: 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
}

/* Inline Reply */
.gc-inline-reply-form {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--gc-bg);
  border-radius: 8px;
  border-left: 3px solid var(--gc-primary);
}

.gc-reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

/* Alerts */
.gc-alert {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 1rem;
  display: none;
  text-align: center;
  font-weight: bold;
}

.gc-success {
  background-color: #d4edda;
  color: #155724;
}

.gc-error {
  background-color: #f8d7da;
  color: #721c24;
}

/* Spinner */
.gc-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--gc-primary);
  border-radius: 50%;
  width: 25px;
  height: 25px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Disclaimer */
.gc-note {
  font-size: 0.8rem;
  color: var(--gc-secondary);
  margin-top: 1rem;
  text-align: center;
  border-top: 1px solid var(--gc-border);
  padding-top: 0.5rem;
}

@media (max-width: 600px) {
  .gc-container { padding: 1rem; }
  .gc-form-card { padding: 1rem; }
}
