/* Forum Comments Styling Fixes - Enhanced Design */

#forum-comments-display {
  display: block !important;
  padding: 20px !important;
  background: linear-gradient(135deg, #1a1a2e, #24243e) !important;
  color: #e0e0e0 !important;
  overflow-y: visible !important;
  max-height: none !important;
  border: none !important;
  border-radius: 12px !important;
  position: relative !important;
  z-index: 100 !important;
  opacity: 1 !important;
  visibility: visible !important;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
  margin: 20px 0 !important;
}

/* Alo ID Highlighting Styles - Simple Orange */
.alo-id-highlight {
  background: orange;
}

/* Forum Comments Summary - Hidden */
.forum-comments-summary {
  display: none !important;
}

.comments-count {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.total-comments {
  font-size: 1.1em;
  font-weight: bold;
  color: #2c3e50;
}

.alo-mentions {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.95em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.no-alo-mentions {
  background: #95a5a6;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.95em;
}

/* Enhanced Forum Comment Items */
.forum-comment-item {
  background: linear-gradient(135deg, #2b203b, #352845) !important;
  border: 2px solid #4a4a6a !important;
  border-radius: 16px !important;
  padding: 24px !important;
  margin-bottom: 20px !important;
  transition: all 0.3s ease !important;
  color: #e0e0e0 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
  position: relative !important;
  overflow: hidden !important;
}

.forum-comment-item::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 4px !important;
  background: linear-gradient(90deg, #9b59b6, #8e44ad, #9b59b6) !important;
  border-radius: 16px 16px 0 0 !important;
}

.forum-comment-item:hover {
  box-shadow: 0 12px 32px rgba(155, 89, 182, 0.3) !important;
  transform: translateY(-4px) !important;
  border-color: #9b59b6 !important;
  background: linear-gradient(135deg, #352845, #3e2a50) !important;
}

/* Special styling for comments containing alo_id */
.alo-id-comment {
  border: 3px solid #ff6b6b !important;
  background: linear-gradient(135deg, #fff5f5, #ffe8e8) !important;
  position: relative;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.2) !important;
}

.alo-id-comment::before {
  content: "⭐ RELEVANT";
  position: absolute;
  top: -10px;
  right: 15px;
  background: linear-gradient(135deg, #ff6b6b, #ff4757);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(255, 71, 87, 0.3);
}

.alo-id-comment .comment-meta {
  border-bottom: 2px solid #ff6b6b;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.alo-id-indicator {
  background: linear-gradient(135deg, #ff6b6b, #ff4757);
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: bold;
  margin-left: 10px;
  box-shadow: 0 2px 4px rgba(255, 71, 87, 0.2);
}

/* Jump to Relevant Button */
.jump-to-relevant-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9em;
  cursor: pointer;
  margin-left: 10px;
  box-shadow: 0 3px 6px rgba(52, 152, 219, 0.3);
  transition: all 0.3s ease;
}

.jump-to-relevant-btn:hover {
  background: linear-gradient(135deg, #2980b9, #21618c);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(52, 152, 219, 0.4);
}

.jump-to-relevant-btn:active {
  transform: translateY(0);
}

/* Highlight Jump Effect */
.highlight-jump {
  animation: highlight-pulse 3s ease-in-out;
}

@keyframes highlight-pulse {
  0% { 
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.2);
  }
  25% { 
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.6);
    transform: scale(1.02);
  }
  50% { 
    box-shadow: 0 12px 48px rgba(255, 107, 107, 0.8);
    transform: scale(1.03);
  }
  75% { 
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.6);
    transform: scale(1.02);
  }
  100% { 
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.2);
    transform: scale(1);
  }
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Comment Meta Information */
.forum-comment-item .comment-meta {
  font-size: 0.9em !important;
  color: #b0b0c0 !important;
  margin-bottom: 16px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid rgba(155, 89, 182, 0.2) !important;
}

.forum-comment-item .comment-author {
  font-weight: bold !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  font-size: 0.8em !important;
  box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3) !important;
}

.forum-comment-item .comment-source {
  color: #9b59b6 !important;
  font-style: italic !important;
  background: rgba(155, 89, 182, 0.15) !important;
  padding: 4px 10px !important;
  border-radius: 12px !important;
  font-size: 0.85em !important;
  border: 1px solid rgba(155, 89, 182, 0.3) !important;
}

.forum-comment-item .comment-date {
  color: #888 !important;
  margin-left: auto !important;
  font-size: 0.75em !important;
  background: rgba(255, 255, 255, 0.05) !important;
  padding: 4px 8px !important;
  border-radius: 8px !important;
}

.forum-comment-item .comment-body {
  font-size: 1.1em !important;
  line-height: 1.7 !important;
  color: #e0e0e0 !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  background: rgba(255, 255, 255, 0.03) !important;
  padding: 18px !important;
  border-radius: 12px !important;
  border-left: 4px solid #9b59b6 !important;
  margin-top: 8px !important;
  font-family: inherit !important;
}

.no-comments-message, .no-comments {
  color: #b0b0c0 !important;
  font-style: italic !important;
  text-align: center !important;
  padding: 40px 20px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-radius: 12px !important;
  border: 2px dashed rgba(155, 89, 182, 0.3) !important;
  font-size: 1.1em !important;
  margin: 20px 0 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .forum-comment-item {
    padding: 18px !important;
    margin-bottom: 16px !important;
    border-radius: 12px !important;
  }
  
  .forum-comment-item .comment-meta {
    gap: 8px !important;
    font-size: 0.85em !important;
  }
  
  .forum-comment-item .comment-author {
    padding: 4px 8px !important;
    font-size: 0.75em !important;
  }
  
  .forum-comment-item .comment-body {
    font-size: 1em !important;
    padding: 14px !important;
  }
  
  #forum-comments-display {
    padding: 15px !important;
    margin: 15px 0 !important;
  }
}

/* Highlight for search terms in forum comments */
.forum-comment-item .comment-body mark {
  background: linear-gradient(135deg, #f39c12, #e67e22) !important;
  color: #ffffff !important;
  padding: 3px 6px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3) !important;
}

/* Override any inline styles that might conflict */
#forum-comments-display * {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Ensure forum comments display overrides any conflicting styles */
#forum-comments-display.forum-comments-display,
#forum-comments-display {
  background: linear-gradient(135deg, #1a1a2e, #24243e) !important;
  color: #e0e0e0 !important;
  padding: 20px !important;
  border-radius: 12px !important;
  white-space: normal !important;
}

/* Force override of any conflicting forum comment item styles */
.forum-comment-item.forum-comment-item {
  background: linear-gradient(135deg, #2b203b, #352845) !important;
  border: 2px solid #4a4a6a !important;
  border-radius: 16px !important;
  padding: 24px !important;
  color: #e0e0e0 !important;
}

/* AloID indicator styling */
.alo-id-indicator {
  background: linear-gradient(135deg, #ff6b6b, #ff4757) !important;
  color: white !important;
  padding: 4px 10px !important;
  border-radius: 12px !important;
  font-size: 0.75em !important;
  font-weight: bold !important;
  margin-left: 10px !important;
  box-shadow: 0 2px 4px rgba(255, 71, 87, 0.2) !important;
}

/* === User Comments Styling === */

/* Container for the list of user comments */
#user-comments-list {
  /* Add some initial padding if needed */
  padding-left: 10px;
}

/* Individual comment block */
.comment {
  margin-top: 15px; /* Space between top-level comments */
  padding: 10px;
  background-color: #352845; /* Slightly different bg? Or keep parent bg? */
  border-radius: 6px;
  border: 1px solid #4a4a6a; /* Add subtle border */
  position: relative; /* Needed for pseudo-elements like vertical lines */
}

/* Style the header (user, date) */
.comment-header {
  font-size: 0.85em;
  color: #b0b0c0; /* Lighter grey for meta info */
  margin-bottom: 8px;
}

/* Style the main comment text */
.comment-content {
  font-size: 1em;
  color: #e0e0e0; /* Ensure good contrast */
  line-height: 1.4;
  margin-bottom: 8px;
}

/* Container for nested replies */
.replies-container {
  margin-left: 20px; /* Indent replies */
  padding-left: 15px; /* Add padding for the vertical line */
  border-left: 2px solid #4a4a6a; /* Subtle vertical line */
  margin-top: 10px; /* Space above the first reply */
}

/* Adjust top margin for comments inside a replies container */
.replies-container > .comment {
  margin-top: 10px;
}

/* Style the reply link */
.reply-link {
  font-size: 0.8em;
  color: #9b59b6; /* Use theme accent color */
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
}
.reply-link:hover {
  text-decoration: underline;
}

/* Styling for the reply form that appears */
.reply-form {
    margin-top: 10px;
    padding: 10px;
    background-color: #2f233f; /* Slightly different background */
    border-radius: 4px;
    border: 1px solid #4a4a6a;
}
.reply-form textarea {
    width: 100%;
    min-height: 50px;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #4a4a6a;
    border-radius: 4px;
    background-color: #352845;
    color: #e0e0e0;
    margin-bottom: 5px;
}
.reply-form button {
    padding: 5px 10px; /* Smaller padding for reply button */
    font-size: 0.9em;
}
/* Add some basic styling from modal-error */
.reply-form .modal-error {
    color: #e74c3c;
    font-size: 0.85em;
    margin-left: 10px;
    display: inline; /* Make it inline */
}


/* === End User Comments Styling === */
/* --- Styles for Favourites-style Grid (Copied from favourites.html) --- */
.favourites-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 0 auto; /* Center the grid container itself */
    max-width: 90%; /* Prevent grid from becoming too wide, adjust as needed */
    padding: 10px 0; /* Add some vertical padding if needed */
}
.favourite-card {
    position: relative; /* Needed for absolute positioning of menu */
    flex: 0 0 200px; /* Adjusted flex-basis for squareness */
    background: #2b203b;
    border-radius: 8px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    overflow: visible; /* Allow menu to overflow */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center children horizontally */
    /* padding-top: 20px; Removed to prevent extra space */
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid #4a4a6a;
}
.favourite-card:hover {
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
    transform: translateY(-4px);
}
.favourite-card-image {
    width: 200px; /* Adjusted fixed width */
    height: 200px; /* Adjusted fixed height */
    object-fit: cover; /* Maintain aspect ratio, cover the area */
    background: #352845; /* Background for loading/empty */
}
.favourite-card-content {
    padding: 5px 15px 5px 15px; /* T:5, R:15, B:5, L:15 - Reduced vertical padding */
    /* flex-grow: 1; Removed */
    width: 100%; 
    box-sizing: border-box; 
    text-align: center; 
}
.favourite-card-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #e0e0e0; /* Explicit light color */
    margin-bottom: 0; /* Removed bottom margin */
}
/* --- End Favourites Grid Styles --- */