/* -------------------------------------------------------------------------- */
/* YUVA COMMENTS UI (Scoped)                                                  */
/* -------------------------------------------------------------------------- */

:root {
  --yuva-primary: #E91E63;
  --yuva-secondary: #2196F3;
  --yuva-bg: #f8f9fa;
  --yuva-card-bg: #ffffff;
  --yuva-text: #333333;
  --yuva-light-text: #666666;
  --yuva-border: #e0e0e0;
  --yuva-shadow: 0 4px 6px rgba(0,0,0,0.05);
  --yuva-radius: 12px;
}

/* Reset for Yuva Comment System */
.yuva-comments-section * {
  box-sizing: border-box;
}

/* Container */
.yuva-comments-section {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Fallback for Bengali */
  width: 90%;
  max-width: 90%;
  margin: 2rem auto;
  padding: 1rem;
  background: var(--yuva-bg);
  border-radius: var(--yuva-radius);
}

.yuva-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--yuva-border);
  padding-bottom: 0.5rem;
}

.yuva-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--yuva-primary);
}

.yuva-count {
  background: var(--yuva-secondary);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
}

/* Form */
.yuva-form-card {
  background: var(--yuva-card-bg);
  padding: 1.5rem;
  border-radius: var(--yuva-radius);
  box-shadow: var(--yuva-shadow);
  margin-bottom: 2rem;
  transition: transform 0.2s;
}

.yuva-form-card:hover {
  transform: translateY(-2px);
}

.yuva-input-group {
  margin-bottom: 1rem;
}

.yuva-input, .yuva-textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--yuva-border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.yuva-input:focus, .yuva-textarea:focus {
  outline: none;
  border-color: var(--yuva-primary);
}

.yuva-textarea {
  min-height: 100px;
  resize: vertical;
}

.yuva-submit-btn {
  background: var(--yuva-primary);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.yuva-submit-btn:hover {
  background: #c2185b;
}

.yuva-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Comment List */
.yuva-comment-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left; /* Ensure left alignment */
}

.yuva-comment-card {
  background: var(--yuva-card-bg);
  padding: 1rem;
  border-radius: var(--yuva-radius);
  border-left: 4px solid var(--yuva-secondary);
  box-shadow: var(--yuva-shadow);
  position: relative;
}

/* Default Avatar */
.yuva-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
  border: 2px solid var(--yuva-border);
}

.yuva-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Space between left and right sections */
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.yuva-author-section {
  display: flex;
  align-items: center;
  gap: 10px; /* Space between avatar and name */
}

.yuva-author {
  font-weight: bold;
  color: var(--yuva-text);
  text-align: left;
}

.yuva-date {
  color: var(--yuva-light-text);
  font-size: 0.8rem;
  text-align: right;
  white-space: nowrap; /* Prevent date from wrapping */
}

.yuva-body {
  font-size: 1rem;
  color: #444;
  line-height: 1.5;
  white-space: pre-wrap; /* Preserve newlines */
}

/* Actions (Reply/Delete) */
.yuva-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
}

.yuva-action-btn {
  background: none;
  border: none;
  color: var(--yuva-light-text);
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}

.yuva-action-btn:hover {
  color: var(--yuva-secondary);
  text-decoration: underline;
}

.yuva-delete {
  color: #e53935;
  display: none; /* Hidden by default */
}

.yuva-user-delete {
  color: #e53935;
  display: inline-block; /* Visible for user's own comments */
}

.yuva-user-delete:hover {
  color: #c62828;
  text-decoration: underline;
}

/* Replies */
.yuva-replies {
  margin-top: 1rem;
  padding-left: 1.5rem;
  border-left: 2px solid #eee;
}

.yuva-reply-card {
  background: #f1f8ff; /* Slightly different bg for replies */
  padding: 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 600px) {
  .yuva-comments-section {
    padding: 0.5rem;
  }
  .yuva-form-card {
    padding: 1rem;
  }
}

/* Loading Spinner */
.yuva-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--yuva-primary);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* Alert Messages */
.yuva-alert {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 1rem;
  display: none;
  text-align: center;
  font-weight: bold;
}

.yuva-success {
  background-color: #d4edda;
  color: #155724;
}

.yuva-error {
  background-color: #f8d7da;
  color: #721c24;
}

/* Legal Warning Note */
.yuva-note {
  font-size: 0.85rem;
  color: #d32f2f;
  margin-top: 1rem;
  text-align: center;
  line-height: 1.4;
  border-top: 1px solid #eee;
  padding-top: 0.8rem;
}

/* Inline Reply Form */
.yuva-inline-reply-form {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid var(--yuva-primary);
}

.yuva-reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
}

.yuva-reply-header strong {
  color: var(--yuva-primary);
  font-size: 0.9rem;
}

.yuva-cancel-reply {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.yuva-cancel-reply:hover {
  background: #e9ecef;
  color: #495057;
}

.yuva-inline-input,
.yuva-inline-textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.95rem;
  margin-bottom: 0.7rem;
  transition: border-color 0.2s;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.yuva-inline-input:focus,
.yuva-inline-textarea:focus {
  outline: none;
  border-color: var(--yuva-primary);
}

.yuva-inline-textarea {
  min-height: 80px;
  resize: vertical;
}

.yuva-inline-submit-btn {
  background: var(--yuva-primary);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.yuva-inline-submit-btn:hover {
  background: #c2185b;
}

.yuva-inline-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .yuva-inline-reply-form {
    padding: 0.8rem;
  }
  
  .yuva-inline-input,
  .yuva-inline-textarea {
    font-size: 0.9rem;
    padding: 0.6rem;
  }
}
