/* ============================================
   COMMENT SECTION
   ============================================ */

.comment-section {
  max-width: 800px;
  margin: 48px auto;
  padding: 0 24px;
}

.comment-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.comment-section__title {
  font-size: 28px;
  font-weight: 700;
  color: #f5f7fa;
  margin: 0;
}

.comment-section__sort {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #f5f7fa;
  cursor: pointer;
  transition: border-color 0.2s;
}

.comment-section__sort:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.comment-section__sort:focus {
  outline: none;
  border-color: #ffd84d;
  box-shadow: 0 0 0 3px rgba(255, 216, 77, 0.1);
}

/* Form */
.comment-section__form-wrapper {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 48px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-section__form-title {
  font-size: 20px;
  font-weight: 600;
  color: #f5f7fa;
  margin: 0 0 24px 0;
}

.comment-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.comment-form__field {
  margin-bottom: 16px;
}

.comment-form__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #f5f7fa;
  margin-bottom: 8px;
  opacity: 0.9;
}

.comment-form__input,
.comment-form__textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.05);
  color: #f5f7fa;
}

.comment-form__input::placeholder,
.comment-form__textarea::placeholder {
  color: rgba(245, 247, 250, 0.4);
}

.comment-form__input:focus,
.comment-form__textarea:focus {
  outline: none;
  border-color: #ffd84d;
  box-shadow: 0 0 0 3px rgba(255, 216, 77, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.comment-form__textarea {
  resize: vertical;
  min-height: 120px;
}

.comment-form__char-count {
  text-align: right;
  font-size: 12px;
  color: rgba(245, 247, 250, 0.6);
  margin-top: 4px;
}

.comment-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  gap: 16px;
}

.comment-form__note {
  font-size: 13px;
  color: rgba(245, 247, 250, 0.6);
  margin: 0;
  max-width: 400px;
}

.comment-form__submit {
  padding: 12px 32px;
  background: #ffd84d;
  color: #0b0b0f;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.comment-form__submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(255, 216, 77, 0.4);
}

.comment-form__submit:disabled {
  background: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  opacity: 0.6;
}

.comment-form__message {
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.comment-form__message--success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.comment-form__message--error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Comments List */
.comment-section__list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.comment-section__loading,
.comment-section__empty,
.comment-section__error {
  text-align: center;
  padding: 48px 24px;
  color: rgba(245, 247, 250, 0.6);
}

.comment-section__loading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #ffd84d;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Single Comment */
.comment {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

.comment:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.comment__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.comment__content {
  flex: 1;
  min-width: 0;
}

.comment__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.comment__author {
  font-weight: 600;
  color: #f5f7fa;
  font-size: 16px;
}

.comment__date {
  font-size: 14px;
  color: rgba(245, 247, 250, 0.5);
}

.comment__text {
  color: rgba(245, 247, 250, 0.85);
  line-height: 1.6;
  font-size: 15px;
  word-wrap: break-word;
}

/* Responsive */
@media (max-width: 768px) {
  .comment-section {
    padding: 0 16px;
    margin: 32px auto;
  }
  
  .comment-section__form-wrapper {
    padding: 24px;
  }
  
  .comment-form__row {
    grid-template-columns: 1fr;
  }
  
  .comment-form__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .comment-form__note {
    max-width: 100%;
    text-align: center;
  }
  
  .comment-form__submit {
    width: 100%;
  }
  
  .comment {
    padding: 16px;
  }
  
  .comment__avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* Highlight animation for newly added comments */
.comment--highlight {
  animation: highlightComment 3s ease;
}

@keyframes highlightComment {
  0% {
    background: rgba(255, 216, 77, 0.3);
    border-color: rgba(255, 216, 77, 0.6);
  }
  100% {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
  }
}

/* ============================================
   REPLIES (Odpowiedzi)
   ============================================ */

.comment-replies {
  margin-left: 48px;
  margin-top: 16px;
  padding-left: 24px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.comment--reply {
  margin-top: 16px;
}

.comment--reply .comment__avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

/* ============================================
   LIKES & ACTIONS
   ============================================ */

.comment__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 14px;
}

.comment__like-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.comment__like-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.comment__like-btn.liked {
  background: rgba(255, 216, 77, 0.2);
  border-color: rgba(255, 216, 77, 0.4);
}

.comment__like-count {
  color: rgba(245, 247, 250, 0.7);
  font-weight: 600;
  min-width: 20px;
}

.like-pulse {
  animation: likePulse 0.3s ease;
}

@keyframes likePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); color: #ffd84d; }
}

.comment__reply-btn {
  background: none;
  border: none;
  color: rgba(245, 247, 250, 0.7);
  cursor: pointer;
  transition: color 0.2s;
  font-size: 14px;
  padding: 4px 8px;
}

.comment__reply-btn:hover {
  color: #ffd84d;
}

.comment__reply-count {
  color: rgba(245, 247, 250, 0.5);
  font-size: 13px;
}

/* Cancel reply button */
.cancel-reply-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-left: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-reply-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Responsive dla replies */
@media (max-width: 768px) {
  .comment-replies {
    margin-left: 24px;
    padding-left: 16px;
  }
  
  .comment__actions {
    flex-wrap: wrap;
  }
}
