/* ========== Couch & Agora – Diskurs Modules ==========
   
   BEREINIGT: Dark Mode wurde in zentrales Snippet ausgelagert
   
   Enthält:
   - Resonanz des Tages
   - Themen-Pulsar
   - Diskurs-Ticker
   - Diskurs-Level-System
   - Diskurs-Heatmap
   
   ====================================================== */

/* ========== Resonanz des Tages ========== */

.ca-resonanz-des-tages {
  background: linear-gradient(135deg, #f0efea 0%, #e8e5dc 100%);
  border: 2px solid var(--ca-accent, #0F766E);
  border-radius: 14px;
  padding: 1.5rem 1.8rem;
  margin: 2rem 0;
  box-shadow: 0 10px 30px rgba(15, 118, 110, .12);
  position: relative;
  overflow: hidden;
}

/* Subtiler Glanz-Effekt */
.ca-resonanz-des-tages::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,.15) 0%, transparent 70%);
  pointer-events: none;
}

.rdt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.rdt-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ca-accent, #0F766E);
}

.rdt-tags {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.rdt-quote {
  margin: 0 0 1.2rem;
  padding: 0;
  border: none;
}

.rdt-quote p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ca-text-primary, #2E2E2E);
  font-style: italic;
  position: relative;
}

/* Anführungszeichen */
.rdt-quote p::before {
  content: '„';
  font-size: 2.5rem;
  color: var(--ca-accent, #0F766E);
  opacity: .3;
  position: absolute;
  left: -1.2rem;
  top: -.5rem;
  font-family: Georgia, serif;
}

.rdt-meta {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: 1rem;
  font-size: .95rem;
  color: var(--ca-text-secondary, #6a655f);
}

.rdt-author {
  font-weight: 600;
  color: var(--ca-text-primary, #2E2E2E);
}

.rdt-context {
  font-size: .9rem;
}

.rdt-context a {
  color: var(--ca-accent, #0F766E);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.rdt-context a:hover {
  border-bottom-style: solid;
}

.rdt-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--ca-accent, #0F766E);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  transition: gap .2s ease;
}

.rdt-link:hover {
  gap: .7rem;
  text-decoration: underline;
}

/* ========== Themen-Pulsar ========== */

.ca-themen-pulsar-wrap {
  margin: 2rem 0;
  background: var(--ca-bg-card, #fff);
  border: 1px solid var(--ca-border-light, #e6e3dd);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
}

.tp-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.tp-title {
  margin: 0 0 .4rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ca-text-primary, #2E2E2E);
}

.tp-subtitle {
  margin: 0;
  font-size: .95rem;
  color: var(--ca-text-secondary, #6a655f);
}

#ca-themen-pulsar {
  position: relative;
  width: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tp-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.tp-empty {
  text-align: center;
  color: var(--ca-text-secondary, #6a655f);
  font-style: italic;
  padding: 3rem 1rem;
  margin: 0;
}

.tp-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, .85);
  color: #fff;
  padding: .4rem .8rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transition: opacity .2s ease;
}

.tp-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ca-border-light, #e6e3dd);
}

.tp-all-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--ca-accent, #0F766E);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  transition: gap .2s ease;
}

.tp-all-link:hover {
  gap: .7rem;
  text-decoration: underline;
}

/* ========== Diskurs-Ticker ========== */

.dt-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dt-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.8rem;
  border-bottom: 1px solid var(--ca-border-light, #e6e3dd);
  transition: background 0.2s ease, opacity 0.3s ease;
}

.dt-item:last-child {
  border-bottom: none;
}

.dt-item:hover {
  background: var(--ca-bg-subtle, #f5f3ef);
}

.dt-item-new {
  opacity: 0;
  transform: translateY(-10px);
}

.dt-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.dt-content {
  flex: 1;
  min-width: 0;
}

.dt-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ca-text-primary, #2E2E2E);
}

.dt-section {
  color: var(--ca-accent, #0F766E);
  font-style: italic;
}

.dt-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.3rem;
  font-size: 0.85rem;
}

.dt-link {
  color: var(--ca-accent, #0F766E);
  text-decoration: none;
}

.dt-link:hover {
  text-decoration: underline;
}

.dt-time {
  color: var(--ca-text-secondary, #6a655f);
}

.dt-toggle {
  cursor: pointer;
}

.dt-count {
  background: var(--ca-accent, #0F766E);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ========== Diskurs-Level-System ========== */

/* Detaillierte Ansicht */
.ca-diskurs-level.style-detailed {
  background: linear-gradient(135deg, #f0efea 0%, #e8e5dc 100%);
  border: 1px solid var(--ca-border-light, #e6e3dd);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
}

.dl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.dl-phase {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ca-accent, #0F766E);
}

.dl-level {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ca-text-secondary, #6a655f);
  background: rgba(15, 118, 110, .1);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.dl-progress-wrap {
  margin-bottom: 1rem;
}

.dl-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--ca-border-light, #e6e3dd);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.dl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ca-accent, #0F766E), #14b8a6);
  border-radius: 999px;
  transition: width .3s ease;
}

.dl-goal {
  font-size: 0.88rem;
  color: var(--ca-text-secondary, #6a655f);
  text-align: center;
}

.dl-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ca-border-light, #e6e3dd);
}

.dl-stat {
  text-align: center;
}

.dl-stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ca-accent, #0F766E);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.dl-stat span {
  display: block;
  font-size: 0.85rem;
  color: var(--ca-text-secondary, #6a655f);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Minimale Ansicht (Inline) */
.ca-diskurs-level.style-minimal {
  display: inline-block;
}

.dl-minimal {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0.9rem;
  background: var(--ca-bg-subtle, #f5f3ef);
  border: 1px solid var(--ca-border-light, #e6e3dd);
  border-radius: 999px;
}

.dl-minimal .dl-phase {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ca-accent, #0F766E);
}

.dl-progress-mini {
  width: 60px;
  height: 6px;
  background: var(--ca-border-light, #e6e3dd);
  border-radius: 999px;
  overflow: hidden;
}

.dl-progress-mini .dl-progress-fill {
  height: 100%;
  background: var(--ca-accent, #0F766E);
  border-radius: 999px;
}

.dl-level-mini {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ca-text-secondary, #6a655f);
  white-space: nowrap;
}

/* ========== Diskurs-Heatmap ========== */

.ca-heat-marker {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.6rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 600;
  vertical-align: middle;
  cursor: pointer;
  transition: all .2s ease;
  animation: heatPulse 2s infinite;
}

@keyframes heatPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

.ca-heat-marker:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  animation: none;
}

.heat-count {
  font-size: 0.9em;
  font-weight: 700;
}

/* Level-spezifische Farben */
.heat-level-5 {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, .3);
}

.heat-level-4 {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  box-shadow: 0 2px 8px rgba(249, 115, 22, .3);
}

.heat-level-3 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, .3);
}

.heat-level-2 {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  box-shadow: 0 2px 8px rgba(20, 184, 166, .3);
}

.heat-level-1 {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, .3);
}

/* Legende */
.ca-heatmap-legend {
  background: linear-gradient(135deg, #f0efea 0%, #e8e5dc 100%);
  border: 1px solid var(--ca-border-light, #e6e3dd);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  margin: 2rem 0;
}

.ca-heatmap-legend h4 {
  margin: 0 0 0.8rem;
  font-size: 1.2rem;
  color: var(--ca-accent, #0F766E);
}

.ca-heatmap-legend p {
  margin: 0 0 1rem;
  line-height: 1.6;
  color: var(--ca-text-primary, #2E2E2E);
}

.heat-legend-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.heat-legend-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem;
  background: rgba(255,255,255,.5);
  border-radius: 8px;
  transition: background .2s ease;
}

.heat-legend-list li:hover {
  background: rgba(255,255,255,.8);
}

.heat-demo {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9em;
  font-weight: 600;
  min-width: 100px;
  justify-content: center;
}

.heat-legend-note {
  padding: 0.8rem;
  background: rgba(15, 118, 110, .08);
  border-left: 3px solid var(--ca-accent, #0F766E);
  border-radius: 4px;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.heat-legend-note strong {
  color: var(--ca-accent, #0F766E);
}

/* Click-to-scroll Enhancement */
.ca-heat-marker {
  position: relative;
}

.ca-heat-marker::after {
  content: '↓';
  position: absolute;
  right: -0.3rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7em;
  opacity: 0;
  transition: opacity .2s ease;
}

.ca-heat-marker:hover::after {
  opacity: 0.7;
}

/* ========== Responsive ========== */

@media (max-width: 640px) {
  .ca-resonanz-des-tages {
    padding: 1.2rem 1.4rem;
  }
  
  .rdt-quote p {
    font-size: .98rem;
  }
  
  .rdt-quote p::before {
    font-size: 2rem;
    left: -.8rem;
  }
  
  .rdt-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .ca-themen-pulsar-wrap {
    padding: 1.2rem;
  }
  
  #ca-themen-pulsar {
    min-height: 250px;
  }
  
  .ca-diskurs-level.style-detailed {
    padding: 1rem 1.2rem;
  }
  
  .dl-stats {
    gap: 0.8rem;
  }
  
  .dl-stat strong {
    font-size: 1.3rem;
  }
  
  .dl-stat span {
    font-size: 0.75rem;
  }
  
  .ca-heat-marker {
    font-size: 0.75em;
    padding: 0.2rem 0.5rem;
    margin-left: 0.4rem;
  }
  
  .heat-count {
    display: none; /* Nur Icon auf Mobile */
  }
  
  .ca-heatmap-legend {
    padding: 1rem 1.2rem;
  }
  
  .heat-demo {
    min-width: 80px;
    font-size: 0.8em;
  }
}

/* ========== Print ========== */

@media print {
  .ca-heat-marker {
    display: none;
  }
}

/* ========== Reduced Motion ========== */

@media (prefers-reduced-motion: reduce) {
  .rdt-link,
  .tp-all-link {
    transition: none;
  }
  
  .diskurs-badge.hot {
    animation: none;
  }
  
  .dl-progress-fill {
    transition: none;
  }
  
  .ca-heat-marker {
    animation: none !important;
  }
  
  .ca-heat-marker,
  .ca-heat-marker::after {
    transition: none;
  }
}