/* ═══════════════════════════════════════════════════════════════════════════
   GISCUS COMMENTS - PyStatR+ Branded Styling
   File: scss/components/giscus-pystatrplus.css
   
   Custom styling for Giscus comment widget to match PyStatR+ aesthetic:
   - Deep space backgrounds
   - Cyan accent highlights
   - Gold interactive elements
   - Futuristic, geometric feel
   ═══════════════════════════════════════════════════════════════════════════ */

/* ==========================================================================
   COMMENT SECTION WRAPPER
   ========================================================================== */

.giscus-wrapper {
  position: relative;
  margin: 3rem 0;
  padding: 2.5rem;
  background: linear-gradient(135deg, #0B1120 0%, #1E293B 100%);
  border-radius: 20px;
  border: 1px solid rgba(34, 211, 238, 0.15);
  overflow: hidden;
}

/* Subtle grid overlay for depth */
.giscus-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(34, 211, 238, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Corner accent glow */
.giscus-wrapper::after {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   SECTION HEADER
   ========================================================================== */

.comments-header {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(34, 211, 238, 0.1);
}

.comments-label {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 20px;
  color: #22d3ee;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.comments-title {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  font-family: 'Poppins', sans-serif;
}

.comments-title span {
  background: linear-gradient(135deg, #22d3ee, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.comments-subtitle {
  color: #9CA3AF;
  font-size: 0.95rem;
  margin: 0;
}

/* ==========================================================================
   GISCUS IFRAME CONTAINER
   ========================================================================== */

.giscus-container {
  position: relative;
  z-index: 2;
}

/* Target the Giscus iframe wrapper */
.giscus,
.giscus-frame {
  width: 100% !important;
  border: none !important;
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   GISCUS THEME OVERRIDES (via CSS custom properties)
   These work with Giscus transparent/custom themes
   ========================================================================== */

.giscus-wrapper {
  /* Primary colors */
  --color-canvas-default: transparent;
  --color-canvas-overlay: #0B1120;
  --color-canvas-inset: rgba(15, 23, 42, 0.6);
  --color-canvas-subtle: rgba(30, 41, 59, 0.8);
  
  /* Border colors */
  --color-border-default: rgba(34, 211, 238, 0.2);
  --color-border-muted: rgba(34, 211, 238, 0.1);
  
  /* Text colors */
  --color-fg-default: #E5E7EB;
  --color-fg-muted: #9CA3AF;
  --color-fg-subtle: #6B7280;
  
  /* Accent colors - PyStatR+ cyan */
  --color-accent-fg: #22d3ee;
  --color-accent-emphasis: #22d3ee;
  
  /* Button colors - PyStatR+ gold for primary actions */
  --color-btn-primary-bg: linear-gradient(135deg, #FACC15, #EAB308);
  --color-btn-primary-text: #0B1120;
  --color-btn-primary-hover-bg: #FDE047;
}

/* ==========================================================================
   REACTIONS & COMMENTS COUNT STYLING
   ========================================================================== */

/* Style the reactions section above comments */
.giscus-wrapper .BtnGroup {
  border-radius: 12px;
  overflow: hidden;
}

/* ==========================================================================
   SIGN IN PROMPT ENHANCEMENT  
   ========================================================================== */

.sign-in-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(34, 211, 238, 0.3);
  border-radius: 12px;
  margin-top: 1.5rem;
}

.sign-in-prompt p {
  color: #9CA3AF;
  margin: 0;
  font-size: 0.9rem;
}

.sign-in-prompt .github-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #FACC15, #EAB308);
  color: #0B1120;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(250, 204, 21, 0.25);
}

.sign-in-prompt .github-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(250, 204, 21, 0.35);
  background: linear-gradient(135deg, #FDE047, #FACC15);
}

.sign-in-prompt .github-btn svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 767px) {
  .giscus-wrapper {
    margin: 2rem -1rem;
    padding: 1.5rem 1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .comments-title {
    font-size: 1.25rem;
  }
  
  .comments-subtitle {
    font-size: 0.875rem;
  }
  
  .sign-in-prompt {
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.giscus-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #9CA3AF;
}

.giscus-loading::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid rgba(34, 211, 238, 0.2);
  border-top-color: #22d3ee;
  border-radius: 50%;
  margin-right: 0.75rem;
  animation: spin 1s linear infinite;
}

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

/* ==========================================================================
   ENHANCED FOCUS STATES FOR ACCESSIBILITY
   ========================================================================== */

.giscus-wrapper a:focus-visible,
.giscus-wrapper button:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 2px;
}
