/* ==========================================================================
   PelelecApp - Estilos Forenses, Mensagens Apagadas e Visualização Única
   ========================================================================== */

/* Deleted Message Bubble */
.deleted-message-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-style: italic;
  color: var(--text-muted);
  user-select: none;
}

.deleted-icon {
  font-size: 15px;
  opacity: 0.7;
}

.recover-btn {
  margin-top: 6px;
  background: rgba(255, 183, 77, 0.12);
  border: 1px dashed #ffb74d;
  color: #ffb74d;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.recover-btn:hover {
  background: #ffb74d;
  color: #111;
}

/* Cellebrite Recovered State */
.forensic-recovered {
  border-left: 3px solid #ffb74d !important;
  background: rgba(255, 183, 77, 0.08) !important;
  animation: forensicFlash 0.6s ease;
}

@keyframes forensicFlash {
  0% {
    background: rgba(255, 183, 77, 0.4);
  }
  100% {
    background: rgba(255, 183, 77, 0.08);
  }
}

.forensic-stamp {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #ffb74d;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.forensic-badge-tag {
  background: #ffb74d22;
  border: 1px solid #ffb74d66;
  color: #ffb74d;
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}

/* View Once (1x) Bubble */
.view-once-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-once-box:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffb74d;
}

.view-once-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px dashed #ffb74d;
  color: #ffb74d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.view-once-info {
  display: flex;
  flex-direction: column;
}

.view-once-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.view-once-hint {
  font-size: 11px;
  color: #ffb74d;
}

/* Audio Player Bubble */
.audio-player-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  padding: 4px 0;
}

.audio-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.audio-play-btn:hover {
  background-color: var(--accent-green);
}

.audio-waveform-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audio-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}

.wave-bar {
  width: 3px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  transition: height 0.1s ease, background-color 0.1s ease;
}

.audio-player-wrapper.playing .wave-bar {
  background-color: var(--accent-green);
  animation: waveDance 0.8s infinite ease-in-out alternate;
}

@keyframes waveDance {
  0% { transform: scaleY(0.4); }
  100% { transform: scaleY(1.3); }
}

.audio-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
}

.transcript-toggle-btn {
  background: none;
  border: none;
  color: var(--text-link);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.audio-transcript-box {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 2px solid var(--accent-green);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-primary);
  border-radius: 0 6px 6px 0;
  display: none;
}

.audio-transcript-box.open {
  display: block;
  animation: fadeIn 0.2s ease;
}

.media-bubble-card {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
  background-color: #0b141a;
  max-width: 320px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
}

.media-bubble-card:hover {
  opacity: 0.95;
}

.media-bubble-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  background-color: #111b21;
}

.media-thumbnail-graphic {
  width: 100%;
  height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 16px;
  color: #fff;
  position: relative;
}

.media-thumbnail-graphic.dubai {
  background: linear-gradient(135deg, #1f4037, #99f2c8);
  color: #111;
}

.media-thumbnail-graphic.epol {
  background: linear-gradient(135deg, #0d1b2a, #1b263b);
  border: 1px solid #415a77;
  font-family: monospace;
}

.media-thumbnail-graphic.arenamrv {
  background: linear-gradient(135deg, #000000, #333333);
  border: 1px solid #fff3;
}

.media-caption-text {
  font-size: 12px;
  padding: 6px 10px;
  background-color: rgba(0, 0, 0, 0.4);
  color: #fff;
}

/* Fact-Check / Source Pill */
.fact-check-pill {
  margin-top: 6px;
  background: rgba(83, 189, 235, 0.08);
  border-left: 2px solid var(--text-link);
  padding: 4px 8px;
  border-radius: 0 4px 4px 0;
  font-size: 11px;
  color: var(--text-link);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.fact-check-pill:hover {
  text-decoration: underline;
}

/* Modals System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content-card {
  background-color: var(--bg-sidebar);
  border-radius: 12px;
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal-content-card {
  transform: scale(1);
}

.modal-header {
  padding: 14px 20px;
  background-color: var(--bg-sidebar-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--icon-color);
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Realistic iOS Apple Notes Modal */
.apple-notes-card {
  background-color: #1e1e1e !important;
  color: #f2f2f7 !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  border: 1px solid #333 !important;
}

.notes-header-bar {
  background: #2c2c2e;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #3a3a3c;
  color: #e5a93c;
  font-size: 14px;
  font-weight: 600;
}

.notes-paper {
  background: #1c1c1e;
  padding: 24px;
  min-height: 280px;
}

.notes-date {
  font-size: 12px;
  color: #8e8e93;
  text-align: center;
  margin-bottom: 16px;
  font-weight: 500;
}

.notes-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
  border-bottom: 1px solid #2c2c2e;
  padding-bottom: 8px;
}

.notes-body-text {
  font-size: 16px;
  line-height: 1.6;
  color: #e5e5ea;
  white-space: pre-wrap;
  font-weight: 400;
}

.notes-forensic-footer {
  margin-top: 24px;
  padding: 12px;
  background: rgba(229, 169, 60, 0.12);
  border-left: 3px solid #e5a93c;
  border-radius: 4px;
  font-size: 11.5px;
  color: #ffd279;
}

/* Forensic Report Statistics Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.stat-box {
  background-color: var(--bg-sidebar-header);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stat-value {
  font-size: 18px;
  font-weight: 800;
  color: #ffb74d;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.forensic-step-list {
  list-style: none;
  counter-reset: forensic-counter;
  margin-top: 10px;
}

.forensic-step-list li {
  counter-increment: forensic-counter;
  margin-bottom: 8px;
  font-size: 12.5px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.forensic-step-list li::before {
  content: counter(forensic-counter);
  background: #ffb74d;
  color: #111;
  font-weight: bold;
  font-size: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* O dourado claro original é reservado ao fundo escuro. */
body[data-theme="light"] .forensic-badge-tag { color: #725000; border-color: #b59c62; }
