/* Comments Styles - Enhanced UI for comments section */

/* Comments container animations */
.comments-area {
  animation: fadeInUp 0.6s ease-out;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    sans-serif;
}

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

/* Ghost style variant */
#cancel-comment-reply-link.ghost {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

#cancel-comment-reply-link.ghost:hover {
  background: rgba(239, 68, 68, 0.2);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
}

/* Comment item hover effects */
.comment-body {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    sans-serif;
}

/* Comment depth styling */
.comment-reply {
  position: relative;
}

.comment-form-cookies-consent {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.comment-form-cookies-consent label {
  margin-bottom: 0 !important;
}

.comment-reply::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 1rem;
  width: 1rem;
  height: 2px;
  border-radius: 1px;
}

/* Nested comments with different depths */
.comment-list .comment-list {
  margin-left: 2rem;
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px solid #e5e7eb;
}

.comment-list .comment-list .comment-list {
  border-left-color: #3b82f6;
}

.comment-list .comment-list .comment-list .comment-list {
  border-left-color: #10b981;
}

/* Avatar enhancements */
.comment-avatar img {
  transition: transform 0.3s ease;
}

.comment-body:hover .comment-avatar img {
  transform: scale(1.05);
}

/* Form input focus effects */
.comment-form input:focus,
.comment-form textarea:focus {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px -8px rgba(59, 130, 246, 0.3);
}

/* Button hover effects */
.comment-form button[type="submit"] {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.comment-form button[type="submit"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.comment-form button[type="submit"]:hover::before {
  left: 100%;
}

/* Reply link styling */
.comment-actions .reply div {
  position: relative;
  overflow: hidden;
}

/* Cancel comment reply link styling */
#cancel-comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
  position: relative;
  overflow: hidden;
  margin: 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

#cancel-comment-reply-link:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}
/* Compact style for mobile */
@media (max-width: 640px) {
  #cancel-comment-reply-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
  }

  #cancel-comment-reply-link::after {
    font-size: 0.875rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  #cancel-comment-reply-link {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
  }

  #cancel-comment-reply-link:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
  }
}

@media (max-width: 768px) {
  #cancel-comment-reply-link.floating {
    bottom: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Comment status indicators */
.comment-awaiting-moderation {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.bypostauthor .comment-avatar::after {
  content: "✓";
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: #3b82f6;
  color: white;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 2px solid white;
}

/* Comment metadata links */
.comment-metadata a {
  position: relative;
}

.comment-metadata a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #3b82f6;
  transition: width 0.3s ease;
}

.comment-metadata a:hover::after {
  width: 100%;
}

/* Comments navigation */
.comment-navigation .nav-links a,
.comment-navigation .nav-links span {
  position: relative;
  overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .comment-list .comment-list {
    margin-left: 1rem;
    padding-left: 0.5rem;
  }

  .comment-body {
    padding: 1rem;
  }

  .comment-meta {
    flex-direction: column;
    gap: 1rem;
  }

  .comment-avatar {
    align-self: flex-start;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .comment-body {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
  }

  .comment-respond {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  }

  .bypostauthor > .comment-body {
    background: linear-gradient(135deg, #1f2937 0%, #1e3a8a 100%);
  }
}

/* Print styles */
@media print {
  .comment-actions,
  .comment-respond,
  .comment-navigation {
    display: none;
  }

  .comment-body {
    border: 1px solid #000;
    margin-bottom: 1rem;
    break-inside: avoid;
  }
}

/* Additional interactive styles */
.highlight-comment {
  animation: highlightComment 2s ease-in-out;
}

@keyframes highlightComment {
  0% {
    background-color: transparent;
  }
  25% {
    background-color: rgba(59, 130, 246, 0.1);
  }
  75% {
    background-color: rgba(59, 130, 246, 0.1);
  }
  100% {
    background-color: transparent;
  }
}

.field-error {
  animation: shake 0.5s ease-in-out;
  border-color: #ef4444 !important;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.character-counter {
  transition: color 0.3s ease;
}

.comment-notification {
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
}

/* Enhanced loading states */
.comment-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.comment-form button[type="submit"]:disabled::before {
  display: none;
}

/* Success state for form */
.comment-form.success {
  background: linear-gradient(135deg, #f0f9ff 0%, #ecfdf5 100%);
  border-color: #10b981;
}

.comment-form.success::before {
  background: linear-gradient(90deg, #10b981, #059669, #047857);
}

/* Enhanced form field styling */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  transition: all 0.3s ease;
  border: 1px solid #e5e7eb;
  background: white;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    sans-serif;
  font-weight: 400;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
  transform: translateY(-1px);
  outline: none;
}

.comment-form .submit {
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  border: none !important;
  color: white !important;
  cursor: pointer;
  transform: translateY(0);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    sans-serif;
  font-weight: 500;
}

.comment-form .submit:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.comment-form .submit:active {
  transform: translateY(0);
}

/* Input icons styling */
.comment-form .relative .absolute {
  transition: color 0.3s ease;
}

.comment-form input:focus + .absolute svg,
.comment-form textarea:focus + .absolute svg {
  color: #3b82f6;
}

/* Form labels */
.comment-form label {
  color: #374151;
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    sans-serif;
}

/* Form field containers */
.comment-form .comment-form-author,
.comment-form .comment-form-email,
.comment-form .comment-form-comment {
  margin-bottom: 1.5rem;
}

/* Responsive form styling */
@media (max-width: 640px) {
  .comment-form input[type="text"],
  .comment-form input[type="email"],
  .comment-form textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Enhanced comment display styling */
.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment-list .comment {
  margin-bottom: 1.5rem;
  position: relative;
}

.comment-list .children {
  margin-left: 2rem;
  margin-top: 1.5rem;
  border-left: 2px solid #e5e7eb;
  padding-left: 1.5rem;
}

.comment-list .children .comment {
  margin-bottom: 1rem;
}

/* Comment hover effects */

/* Avatar enhancements */
.comment-avatar img {
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.comment-avatar:hover img {
  border-color: #3b82f6;
}

/* Enhanced typography for comment content */
.comment-text {
  line-height: 1.7;
}

.comment-text p {
  margin-bottom: 1rem;
}

.comment-text p:last-child {
  margin-bottom: 0;
}

.comment-text blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: #6b7280;
}

/* Nested comments styling */
.comment-reply .comment-body {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
}

.comment-reply .comment-body:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* Loading states */
.comment-form.loading {
  opacity: 0.7;
  pointer-events: none;
}

.comment-form.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #3b82f6;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

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

/* Author name styling */
.comment-author-name {
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .comment-list .children {
    margin-left: 1rem;
    padding-left: 1rem;
  }

  .comment-body {
    padding: 1rem;
  }

  .comment-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .comment-avatar {
    align-self: flex-start;
  }

  .comment-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}
