/**
 * Lesson Q&A Styles
 *
 * @package CYNO
 * @version 1.0.0
 */

/* Q&A Container */
.qa-container {
  margin-top: 2rem;
}

.qa-header {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 1rem;
}

.qa-count {
  font-size: 0.875rem;
}

/* Loading States */
.qa-loading {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.spinner-border {
  width: 2rem;
  height: 2rem;
}

/* Empty State */
.qa-empty-state {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.qa-empty-state i {
  opacity: 0.5;
}

/* Q&A Comments */
.qa-comment {
  position: relative;
}

.qa-question {
  margin-bottom: 1.5rem;
}

/* Q&A Replies */
.qa-replies {
  margin-top: 1rem;
  padding-left: 0;
}

.qa-reply {
  margin-bottom: 1rem;
  padding-left: 0;
  border-left: none;
}

.qa-reply .d-flex {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.qa-reply .instructor-img {
  width: 35px;
  height: 35px;
  font-size: 1rem;
}

.qa-reply-header h6 {
  font-weight: 600;
  color: #212529;
  margin-bottom: 0;
}

.qa-reply-header small {
  font-size: 0.8rem;
}

.qa-reply-content p {
  line-height: 1.6;
  color: #495057;
  margin-bottom: 0;
}

/* Avatar - Use instructor-img class from original layout */
.instructor-img {
  width: 40px;
  height: 40px;
  background: #f8f9fa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 1.2rem;
}

/* Comment Header */
.qa-comment-header h6 {
  font-weight: 600;
  color: #212529;
}

.qa-comment-header small {
  font-size: 0.8rem;
}

/* Role Badges */
.qa-comment-header .badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  margin-left: 0.5rem;
}

.badge.bg-primary {
  background-color: #0d6efd !important;
}

.badge.bg-danger {
  background-color: #dc3545 !important;
}

.badge.bg-secondary {
  background-color: #6c757d !important;
}

/* Comment Actions */
.qa-comment-actions {
  display: flex;
  gap: 0.25rem;
}

.qa-comment-actions .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border: none;
  background: transparent;
}

.qa-comment-actions .btn:hover {
  background: #f8f9fa;
}

/* Comment Content */
.qa-comment-content p {
  line-height: 1.6;
  color: #495057;
}

/* Comment Footer */
.qa-comment-footer {
  margin-top: 1rem;
}

.qa-comment-footer .btn {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
}

/* Reply Form */
.qa-reply-form {
  background: #f8f9fa;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-top: 1rem;
}

.qa-reply-form .form-control {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  resize: vertical;
}

.qa-reply-form .form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Question Form */
.qa-question-form {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 2rem;
}

.qa-question-form h5 {
  color: #212529;
  font-weight: 600;
  margin-bottom: 1rem;
}

.qa-question-form .form-control {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  resize: vertical;
}

.qa-question-form .form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Login Prompt */
.qa-login-prompt {
  margin-top: 2rem;
}

.qa-login-prompt .alert {
  border-radius: 0.5rem;
  border: none;
  background: #d1ecf1;
  color: #0c5460;
}

.qa-login-prompt .alert-link {
  color: #0c5460;
  text-decoration: underline;
}

.qa-login-prompt .alert-link:hover {
  color: #0a3d47;
}

/* Load More Button */
.qa-load-more {
  margin-top: 2rem;
}

.qa-load-more-btn {
  padding: 0.75rem 2rem;
  font-weight: 500;
}

.qa-load-more-btn:hover {
  background: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

/* Edit Form */
.qa-edit-form {
  background: #f8f9fa;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-top: 0.5rem;
}

.qa-edit-form .form-control {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  resize: vertical;
}

.qa-edit-form .form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Animations */
.qa-comment {
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Animation */
.qa-loading .spinner-border {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Hover Effects */
.qa-comment .card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}

.qa-comment-actions .btn:hover {
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .qa-reply {
    margin-left: 0;
    padding-left: 0.5rem;
    border-left: 2px solid #e9ecef;
  }

  .qa-comment-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .qa-comment-actions {
    margin-top: 0.5rem;
  }

  .qa-question-form {
    padding: 1rem;
  }

  .qa-reply-form {
    padding: 0.75rem;
  }

  .qa-edit-form {
    padding: 0.75rem;
  }
}

@media (max-width: 576px) {
  .qa-avatar {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .qa-comment-header h6 {
    font-size: 0.9rem;
  }

  .qa-comment-header small {
    font-size: 0.75rem;
  }

  .qa-comment-actions .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
  }

  .qa-comment-footer .btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
}

/* Focus States for Accessibility */
.qa-comment-actions .btn:focus,
.qa-reply-btn:focus,
.qa-load-more-btn:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .qa-comment .card {
    border: 2px solid #000;
  }

  .qa-reply {
    border-left: 3px solid #000;
  }

  .qa-question-form,
  .qa-reply-form,
  .qa-edit-form {
    border: 2px solid #000;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .qa-comment {
    animation: none;
  }

  .qa-loading .spinner-border {
    animation: none;
  }

  .qa-comment-actions .btn:hover {
    transform: none;
  }
}

/* Print Styles */
@media print {
  .qa-comment-actions,
  .qa-reply-form,
  .qa-question-form,
  .qa-load-more {
    display: none !important;
  }

  .qa-comment .card {
    border: 1px solid #000;
    box-shadow: none;
  }

  .qa-reply {
    border-left: 2px solid #000;
  }
}
