/* Community Writeups Styling */

/* Like Button - Bold Design Like Learning Mode */
.like-btn {
  transition: all 0.2s ease;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(220, 53, 69, 0.1);
  border: 2px solid rgba(220, 53, 69, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #dc3545;
}

.like-btn:hover:not(:disabled) {
  background: rgba(220, 53, 69, 0.15);
  border-color: rgba(220, 53, 69, 0.5);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
  transform: translateY(-1px);
}

.like-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.like-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.like-btn.liked {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(239, 68, 68, 0.25) 100%);
  border-color: rgba(220, 53, 69, 0.6);
  color: #dc3545;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.like-btn.liked:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.25) 0%, rgba(239, 68, 68, 0.3) 100%);
  border-color: rgba(220, 53, 69, 0.8);
  box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.like-btn.liked i {
  color: #dc3545 !important;
}

.like-btn:disabled i {
  opacity: 0.7;
}

.like-btn i {
  color: #dc3545;
}

/* Make like count more prominent */
.like-count {
  font-weight: 700;
  min-width: 24px;
  display: inline-block;
  color: #dc3545;
  font-size: 0.9rem;
}

.like-btn.liked .like-count {
  color: #dc3545;
}

/* Glow effect for liked buttons */
.like-btn.liked {
  animation: likeGlow 2s ease-in-out infinite alternate;
}

@keyframes likeGlow {
  from {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
  }
  to {
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
  }
}

/* Heart icon improvements */
.like-btn i {
  font-size: 18px;
  transition: all 0.2s ease;
}

.like-btn:hover:not(:disabled) i {
  transform: scale(1.2);
}

/* Like Button Loading Animation */
.like-btn.loading {
  pointer-events: none;
  opacity: 0.8;
  background: rgba(220, 53, 69, 0.12);
  border-color: rgba(220, 53, 69, 0.35);
}

.like-btn.loading i {
  animation: likeLoading 0.8s ease-in-out infinite;
}

@keyframes likeLoading {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.5;
  }
}

/* Pulse animation for loading button */
.like-btn.loading {
  animation: buttonPulse 1.2s ease-in-out infinite;
}

@keyframes buttonPulse {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.15);
  }
}

/* Stats section - Improved */
.writeup-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.stat-item.likes {
  color: rgba(255, 255, 255, 0.8);
}

.stat-item.likes:hover {
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.3);
  color: #dc3545;
}

.stat-item.views {
  color: rgba(255, 255, 255, 0.8);
}

.stat-item.views:hover {
  background: rgba(13, 202, 240, 0.1);
  border-color: rgba(13, 202, 240, 0.3);
  color: #0dcaf0;
}

.stat-item i {
  font-size: 0.95rem;
}

.stat-item span {
  min-width: 18px;
  text-align: center;
}

/* Report Button - More Visible */
.report-writeup-btn {
  transition: all 0.2s ease;
  border: none !important;
  background: rgba(220, 53, 69, 0.08) !important;
  padding: 0.5rem !important;
  border-radius: 6px !important;
  opacity: 0.7;
}

.report-writeup-btn:hover {
  opacity: 1 !important;
  background: rgba(220, 53, 69, 0.15) !important;
  color: #dc3545 !important;
  transform: scale(1.15);
}

.report-writeup-btn:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
  outline: none !important;
}

.report-writeup-btn i {
  font-size: 0.875rem;
}

/* Writeup table improvements */
.table-hover tbody tr {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.table-hover tbody tr:hover {
  background: linear-gradient(135deg, rgba(105, 108, 255, 0.08) 0%, rgba(105, 108, 255, 0.04) 100%) !important;
  border-left-color: rgba(105, 108, 255, 0.5);
  box-shadow: 0 2px 12px rgba(105, 108, 255, 0.15);
}

/* Author avatar improvements */
.writeup-author-avatar {
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

tr:hover .writeup-author-avatar {
  transform: scale(1.08);
  border-color: rgba(105, 108, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.1);
}

/* Language badge */
.writeup-language-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(105, 108, 255, 0.15);
  border: 1px solid rgba(105, 108, 255, 0.3);
  box-shadow: 0 2px 6px rgba(105, 108, 255, 0.15);
  color: #696cff;
}

/* Date column styling */
.writeup-date {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.writeup-date .writeup-time {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}

/* Read button */
.writeup-read-btn {
  transition: all 0.2s ease;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.writeup-read-btn:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
  transform: translateY(-1px);
}

/* Empty state icon animation */
.ti-book-off {
  animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Writeup count badge */
.writeup-count-badge {
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(105, 108, 255, 0.3);
  background: rgba(105, 108, 255, 0.15);
}

/* Submit writeup button improvements */
.submit-writeup-btn {
  transition: all 0.2s ease;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.submit-writeup-btn:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
  transform: translateY(-2px);
}

/* Pending/Status badges */
.writeup-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  border: 2px solid rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.15);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .writeup-stats {
    gap: 12px;
  }

  .stat-item {
    font-size: 0.8125rem;
  }

  .like-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }

  .writeup-read-btn {
    width: 100%;
    padding: 10px 16px;
  }

  .submit-writeup-btn {
    width: 100%;
    padding: 12px 16px;
  }

  .table-hover tbody tr {
    border-left-width: 2px;
  }
}

