@charset "utf-8";
/* board_blog comment.css - 말더듬 블로그 전용 댓글 스타일 */

/* ===== 댓글 섹션 전체 ===== */
.comment-section {
  margin-top: 2rem;
  padding: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

.comment-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e9ecef, transparent);
  margin: 2rem 0 0 0;
}

/* ===== 댓글 헤더 ===== */
.comment-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-bottom: 1px solid #e9ecef;
}

.comment-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2d3748;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-title .fa {
  color: #667eea;
  font-size: 1.3rem;
}

.comment-count {
  color: #667eea;
  font-weight: 600;
}

/* ===== 댓글 성공 메시지 ===== */
.comment-success-message {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-left: 4px solid #28a745;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin-top: 1rem;
  transition: opacity 0.3s ease;
}

.comment-success-message .fa {
  color: #28a745;
  font-size: 1.1rem;
}

/* ===== 댓글 목록 ===== */
.comments-list {
  padding: 0;
}

.no-comments {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #6c757d;
}

.no-comments .fa {
  font-size: 3rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

.no-comments p {
  font-size: 1.1rem;
  margin: 0;
}

/* ===== 개별 댓글 아이템 ===== */
.comment-item {
  padding: 1.5rem;
  border-bottom: 1px solid #f1f3f5;
  transition: background-color 0.3s ease;
  position: relative;
}

.comment-item:hover {
  background-color: #f8f9fa;
}

.comment-item:last-child {
  border-bottom: none;
}

/* ===== 댓글 작성자 정보 ===== */
.comment-author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.author-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
}

.author-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.author-name {
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
}

.comment-date {
  font-size: 0.85rem;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.comment-date .fa {
  font-size: 0.8rem;
}

/* ===== 댓글 내용 ===== */
.comment-content {
  font-size: 1rem;
  line-height: 1.6;
  color: #4a5568;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #667eea;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== 댓글 액션 버튼들 ===== */
.comment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.vote-buttons {
  display: flex;
  gap: 0.5rem;
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 20px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #6c757d;
  font-weight: 500;
}

.vote-btn:hover:not(.disabled) {
  background: #e9ecef;
  border-color: #dee2e6;
  transform: translateY(-1px);
}

.vote-btn.like-btn:hover:not(.disabled) {
  background: #d4edda;
  border-color: #28a745;
  color: #28a745;
}

.vote-btn.dislike-btn:hover:not(.disabled) {
  background: #f8d7da;
  border-color: #dc3545;
  color: #dc3545;
}

.vote-btn.voted {
  background: #667eea;
  border-color: #667eea;
  color: white;
}

.vote-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1f3f5;
}

.vote-display {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #6c757d;
  font-size: 0.9rem;
  margin-right: 1rem;
}

.admin-buttons {
  display: flex;
  gap: 0.5rem;
}

.admin-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.edit-btn {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.edit-btn:hover {
  background: #ffeaa7;
  color: #6c5400;
}

.delete-btn {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.delete-btn:hover {
  background: #f5c6cb;
  color: #5a161b;
}

/* ===== 댓글 페이지네이션 ===== */
.comment-pagination {
  padding: 1.5rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.comment-pagination .pagination {
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comment-pagination .pagination a,
.comment-pagination .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0.5rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  text-decoration: none;
  color: #495057;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.comment-pagination .pagination a:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
}

.comment-pagination .pagination .active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: #667eea;
}

/* ===== 댓글 작성 폼 섹션 ===== */
.comment-form-section {
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-top: 1px solid #e9ecef;
}

.comment-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comment-form-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-form-header h3 .fa {
  color: #667eea;
}

.current-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #6c757d;
  background: #e9ecef;
  padding: 0.5rem 0.75rem;
  border-radius: 15px;
}

.current-user .fa {
  color: #667eea;
}

/* ===== 댓글 작성 폼 ===== */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-form .form-group {
  position: relative;
}

.comment-form textarea {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  resize: vertical;
  min-height: 120px;
  max-height: 300px;
  transition: all 0.3s ease;
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
}

.comment-form textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: #fafbfc;
}

.comment-form textarea::placeholder {
  color: #9ca3af;
  font-style: italic;
}

.textarea-info {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.char-count {
  font-size: 0.85rem;
  color: #6c757d;
  font-weight: 500;
}

/* ===== 폼 액션 버튼들 ===== */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 44px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #545b62;
  transform: translateY(-1px);
}

.comment-submit-btn:disabled {
  background: #adb5bd;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== 로그인 필요 메시지 ===== */
.login-required {
  padding: 2rem;
  text-align: center;
}

.login-message {
  background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #e1bee7;
}

.login-message .fa {
  font-size: 2.5rem;
  color: #667eea;
  margin-bottom: 1rem;
}

.login-message h3 {
  color: #2d3748;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.login-message p {
  color: #6c757d;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* ===== 반응형 디자인 ===== */

/* 모바일 (480px 이하) */
@media (max-width: 480px) {
  .comment-section {
    border-radius: 8px;
    margin-top: 1.5rem;
  }
  
  .comment-header {
    padding: 1rem;
  }
  
  .comment-title {
    font-size: 1.2rem;
  }
  
  .comment-item {
    padding: 1rem;
  }
  
  .author-avatar {
    width: 35px;
    height: 35px;
    font-size: 1.1rem;
  }
  
  .comment-content {
    padding: 0.75rem;
    font-size: 0.95rem;
  }
  
  .comment-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .vote-buttons {
    width: 100%;
    justify-content: space-around;
  }
  
  .admin-buttons {
    width: 100%;
    justify-content: flex-end;
  }
  
  .comment-form-section {
    padding: 1rem;
  }
  
  .comment-form-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

/* 태블릿 (768px 이상) */
@media (min-width: 768px) {
  .comment-header {
    padding: 2rem 2rem 1.5rem 2rem;
  }
  
  .comment-item {
    padding: 2rem;
  }
  
  .author-avatar {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
  
  .comment-content {
    padding: 1.25rem;
    font-size: 1.05rem;
  }
  
  .comment-form-section {
    padding: 2rem;
  }
  
  .comment-form {
    flex-direction: row;
    align-items: flex-end;
  }
  
  .comment-form .form-group {
    flex: 1;
  }
  
  .form-actions {
    flex: 0 0 auto;
    margin-left: 1rem;
    flex-direction: column;
  }
  
  .btn {
    width: auto;
    min-width: 120px;
  }
}

/* 데스크탑 (1024px 이상) */
@media (min-width: 1024px) {
  .comment-section {
    margin-top: 2.5rem;
  }
  
  .comment-actions {
    flex-wrap: nowrap;
  }
  
  .vote-buttons {
    flex: 0 0 auto;
  }
  
  .admin-buttons {
    flex: 0 0 auto;
  }
}

/* ===== 애니메이션 ===== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comment-item {
  animation: slideInUp 0.5s ease-out;
}

.comment-success-message {
  animation: slideInUp 0.3s ease-out;
}

/* ===== 접근성 ===== */
.vote-btn:focus,
.admin-btn:focus,
.btn:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.comment-form textarea:focus {
  outline: none; /* 이미 box-shadow로 처리됨 */
}

/* ===== 다크모드 대응 (선택사항) ===== */
@media (prefers-color-scheme: dark) {
  .comment-section {
    background: #1a202c;
    color: #e2e8f0;
  }
  
  .comment-header {
    background: linear-gradient(135deg, #2d3748, #1a202c);
  }
  
  .comment-content {
    background: #2d3748;
    color: #e2e8f0;
  }
  
  .comment-form textarea {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
  }
}