/* ═══════════════════════════════════════════════════
   ShinobiCTF Dialogue System — dialogue.css
   Place in: /themes/shinobi/static/css/dialogue.css
   ═══════════════════════════════════════════════════ */

/* ── Full-screen overlay ── */
.dialogue-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  padding: 0 24px 48px;
  opacity: 0;
  animation: dg-fadeIn 0.4s ease forwards;
}
.dialogue-overlay.closing {
  animation: dg-fadeOut 0.35s ease forwards;
}

@keyframes dg-fadeIn { to { opacity: 1; } }
@keyframes dg-fadeOut { to { opacity: 0; } }

/* ── Dialogue container ── */
.dialogue-box {
  width: 100%;
  max-width: 820px;
  position: relative;
  transform: translateY(40px);
  opacity: 0;
  animation: dg-slideUp 0.45s 0.15s ease forwards;
}
@keyframes dg-slideUp { to { transform: translateY(0); opacity: 1; } }

/* ── NPC portrait + name ── */
.dialogue-speaker {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: -2px;
  padding-left: 18px;
  position: relative;
  z-index: 2;
}
.dialogue-portrait {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #D72638;
  box-shadow: 0 0 18px rgba(215, 38, 56, 0.45), 0 0 40px rgba(215, 38, 56, 0.15);
  object-fit: cover;
  background: #1a1a1a;
}
.dialogue-name {
  font-family: 'Robotica', 'Rubik', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: #D72638;
  text-shadow: 0 0 12px rgba(215, 38, 56, 0.5);
  padding-bottom: 10px;
}

/* ── Text panel ── */
.dialogue-panel {
  background: linear-gradient(135deg, rgba(18, 18, 22, 0.96), rgba(26, 20, 22, 0.98));
  border: 1px solid rgba(215, 38, 56, 0.35);
  border-radius: 6px;
  box-shadow:
    0 0 30px rgba(215, 38, 56, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.6);
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
}
.dialogue-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #D72638 30%, #D72638 70%, transparent);
  opacity: 0.7;
}
.dialogue-panel::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 60px; height: 60px;
  border-right: 2px solid rgba(215, 38, 56, 0.2);
  border-bottom: 2px solid rgba(215, 38, 56, 0.2);
  border-radius: 0 0 6px 0;
  pointer-events: none;
}

.dialogue-text {
  font-family: 'Rubik', sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #d4d4d4;
  min-height: 52px;
}
.dialogue-text .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: #D72638;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: dg-blink 0.7s step-end infinite;
}
@keyframes dg-blink { 50% { opacity: 0; } }

/* ── Advance indicator ── */
.dialogue-advance {
  position: absolute;
  bottom: 12px;
  right: 18px;
  font-family: 'Rubik', sans-serif;
  font-size: 0.75rem;
  color: rgba(215, 38, 56, 0.6);
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.3s;
}
.dialogue-advance.visible {
  opacity: 1;
  animation: dg-pulse 1.5s ease-in-out infinite;
}
@keyframes dg-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.dialogue-advance .arrow {
  display: inline-block;
  animation: dg-bounce 1s ease-in-out infinite;
  margin-left: 4px;
}
@keyframes dg-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* ── Choices ── */
.dialogue-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
  opacity: 0;
  animation: dg-fadeIn 0.3s ease forwards;
}
.dialogue-choice {
  background: rgba(215, 38, 56, 0.08);
  border: 1px solid rgba(215, 38, 56, 0.25);
  border-radius: 4px;
  padding: 12px 18px 12px 36px;
  color: #d4d4d4;
  font-family: 'Rubik', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
}
.dialogue-choice::before {
  content: '►';
  position: absolute;
  left: 14px;
  color: #D72638;
  font-size: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s;
}
.dialogue-choice:hover {
  background: rgba(215, 38, 56, 0.16);
  border-color: rgba(215, 38, 56, 0.5);
  color: #fff;
  box-shadow: 0 0 12px rgba(215, 38, 56, 0.15);
}
.dialogue-choice:hover::before { opacity: 1; }

/* ── Skip hint ── */
.dialogue-skip {
  position: fixed;
  top: 24px;
  right: 28px;
  font-family: 'Rubik', sans-serif;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.04em;
  z-index: 100000;
}
.dialogue-skip kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  padding: 2px 6px;
  font-family: 'Rubik', sans-serif;
  font-size: 0.7rem;
}

/* ── Replay button (injected into challenge modal) ── */
.replay-dialogue-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(215, 38, 56, 0.1);
  border: 1px solid rgba(215, 38, 56, 0.3);
  border-radius: 4px;
  padding: 6px 14px;
  color: #D72638;
  font-family: 'Rubik', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}
.replay-dialogue-btn:hover {
  background: rgba(215, 38, 56, 0.2);
  border-color: #D72638;
  box-shadow: 0 0 10px rgba(215, 38, 56, 0.2);
}
