/* Comments Section Styles */
.comments-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 2px solid var(--border-color);
  position: relative;
}

.comments-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
  border-radius: 2px;
}

.comments-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

.comments-header h3 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.comments-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
}

.comments-wrapper {
  background: transparent;
  border-radius: 6px;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.comments-wrapper:hover {
  border-color: var(--accent-color);
}

/* Responsive design */
@media (max-width: 768px) {
  .comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
  }
  
  .comments-header h3 {
    font-size: 1.5rem;
  }
  
  .comments-header p {
    font-size: 0.95rem;
  }
  
  .comments-wrapper {
    padding: 0.25rem;
    border-radius: 4px;
  }
}

/* Loading state */
.comments-wrapper:empty::before {
  content: "Loading comments...";
  display: block;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

/* Animation for comments section */
.comments-section {
  animation: fadeInUp 0.8s ease-out;
}

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

/* Fallback message styles */
.comments-fallback {
  text-align: center;
  padding: 2.5rem 1rem;
}

.fallback-content h4 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.fallback-content p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.fallback-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.fallback-btn {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  color: white;
  border: none;
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fallback-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
}

/* Giscus iframe styling */
.giscus-frame {
  border: none !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  background: transparent !important;
}

.giscus-container iframe {
  border-radius: 8px;
  transition: all 0.3s ease;
  background: transparent !important;
}

/* Enhanced Theme System */
/* Light Theme Base */
.giscus-container[data-theme="light"] {
  background: #ffffff;
  border-color: #e1e5e9;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.giscus-container[data-theme="light"]:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Dark Theme Base */
.giscus-container[data-theme="dark"] {
  background: #1a1a1a;
  border-color: #333333;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.05);
}

.giscus-container[data-theme="dark"]:hover {
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.08);
}

/* Theme-specific container styling */
/* Light Mode */
.light-mode .giscus-container {
  background: #ffffff;
  border-color: #e1e5e9;
  color: #1f2937;
}

/* Dark Mode */
.dark-mode .giscus-container {
  background: #1a1a1a;
  border-color: #333333;
  color: #f9fafb;
}

/* Solarized Dark */
.solarized-dark-mode .giscus-container {
  background: #002b36;
  border-color: #073642;
  color: #839496;
}

/* Monokai */
.monokai-mode .giscus-container {
  background: #272822;
  border-color: #3e3d32;
  color: #f8f8f2;
}

/* Dracula */
.dracula-mode .giscus-container {
  background: #282a36;
  border-color: #44475a;
  color: #f8f8f2;
}

/* Gruvbox Dark */
.gruvbox-dark-mode .giscus-container {
  background: #282828;
  border-color: #504945;
  color: #ebdbb2;
}

/* Nord */
.nord-mode .giscus-container {
  background: #2e3440;
  border-color: #434c5e;
  color: #eceff4;
}

/* One Dark */
.one-dark-mode .giscus-container {
  background: #282c34;
  border-color: #3e4451;
  color: #abb2bf;
}

/* Material Dark */
.material-dark-mode .giscus-container {
  background: #121212;
  border-color: #1e1e1e;
  color: #ffffff;
}

/* Pastel Mode */
.pastel-mode .giscus-container {
  background: #fefefe;
  border-color: #e8e8e8;
  color: #5a5a5a;
}

/* Eye Soothing */
.eye-soothing-mode .giscus-container {
  background: #f5f5dc;
  border-color: #d4d4b4;
  color: #4a4a4a;
}

/* Solarized Light */
.solarized-light-mode .giscus-container {
  background: #fdf6e3;
  border-color: #eee8d5;
  color: #586e75;
}

/* Material Light */
.material-light-mode .giscus-container {
  background: #fafafa;
  border-color: #e0e0e0;
  color: #212121;
}

/* Giscus Footer Styling - Universal */
.giscus-container .giscus-frame footer {
  color: var(--text-secondary) !important;
  font-size: 0.8rem !important;
  opacity: 0.8 !important;
  text-align: center !important;
  padding: 0.5rem 0 !important;
  border-top: 1px solid var(--border-color) !important;
  margin-top: 1rem !important;
}

/* Giscus iframe styling */
.comments-wrapper iframe {
  border: none !important;
  border-radius: 6px !important;
  background: transparent !important;
  /* Hide the "powered by giscus" text by clipping the bottom */
  clip-path: inset(0 0 20px 0) !important;
}

/* Adaptive theme styling */
.comments-wrapper {
  background: transparent;
  transition: all 0.3s ease;
}

/* Light theme styling */
.comments-wrapper[data-theme="light"] {
  background: #f8f9fa;
  border-color: #e9ecef;
}

/* Dark theme styling */
.comments-wrapper[data-theme="dark"] {
  background: #1a1a1a;
  border-color: #2d2d2d;
}

/* Hide just the powered by giscus text at the very bottom */
.comments-wrapper iframe {
  clip-path: inset(0 0 0 0) !important;
}





/* Ensure giscus text is always readable */
.giscus-container iframe {
  color-scheme: auto !important;
}

/* Theme transition animations */
.giscus-container {
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}
