/**
 * DocuPlay - Modo Consultor (Feedback In-Situ)
 * Estilos visuales de alto impacto y máximo contraste (Estándar AgenteZ)
 */

/* ── 1. Pestaña Lateral Retráctil Izquierda ── */
.docu-consultant-tab-wrapper {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999990;
  user-select: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.docu-consultant-tab-wrapper.retracted {
  transform: translateY(-50%) translateX(calc(-100% + 10px));
}

.docu-consultant-tab-wrapper.retracted:hover {
  transform: translateY(-50%) translateX(0);
}

.docu-consultant-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #020617;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border: none;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(245, 158, 11, 0.4);
  writing-mode: vertical-lr;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.docu-consultant-tab-btn:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.6);
}

.docu-consultant-tab-edge {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: #fef08a;
  box-shadow: 0 0 8px rgba(254, 240, 138, 0.9);
}

.docu-consultant-tab-icon {
  font-size: 14px;
  margin-bottom: 4px;
  transform: rotate(90deg);
}

/* ── 2. Botón de Header / Shortcode ── */
.docu-consultant-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  user-select: none;
}

.docu-consultant-header-btn:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.docu-consultant-pulse-dot {
  position: relative;
  display: inline-flex;
  width: 8px;
  height: 8px;
}

.docu-consultant-pulse-dot .dot-wave {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fbbf24;
  opacity: 0.75;
  animation: consultant-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.docu-consultant-pulse-dot .dot-core {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

@keyframes consultant-ping {
  75%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.docu-consultant-kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}

/* ── 3. Barra Superior de Inspección Flotante ── */
.docu-inspector-bar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 90%;
  max-width: 620px;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(245, 158, 11, 0.65);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75), 0 0 20px rgba(245, 158, 11, 0.25);
  backdrop-filter: blur(12px);
  color: #f8fafc;
  user-select: none;
  animation: consultant-slide-down 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes consultant-slide-down {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.docu-inspector-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docu-inspector-radar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 18px;
  animation: consultant-spin 8s linear infinite;
}

@keyframes consultant-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.docu-inspector-titles h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fde68a;
  text-transform: uppercase;
}

.docu-inspector-titles p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #cbd5e1;
}

.docu-inspector-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.docu-inspector-esc-tag {
  font-family: monospace;
  font-size: 10px;
  color: #94a3b8;
  background: #1e293b;
  border: 1px solid #334155;
  padding: 3px 7px;
  border-radius: 6px;
}

.docu-inspector-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.docu-inspector-close-btn:hover {
  background: #334155;
  color: #ffffff;
}

/* ── 4. Recuadro de Resalte Sobre el Elemento Inspeccionado ── */
.docu-consultant-highlight-box {
  position: absolute;
  z-index: 999997;
  pointer-events: none;
  outline: 2px solid #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.5), inset 0 0 15px rgba(245, 158, 11, 0.15);
  border-radius: 4px;
  transition: all 0.05s ease-out;
}

.docu-consultant-selector-tag {
  position: absolute;
  top: -24px;
  left: 0;
  background: #0f172a;
  color: #fde68a;
  border: 1px solid #f59e0b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  pointer-events: none;
}

/* Modo Crosshair en Cursor */
body.docu-consultant-inspecting,
body.docu-consultant-inspecting * {
  cursor: crosshair !important;
}

/* ── 5. Modal de Formulario de Feedback ── */
.docu-feedback-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: consultant-fade-in 0.2s ease;
}

@keyframes consultant-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.docu-feedback-modal-content {
  background: #0b0f19;
  border: 1px solid #334155;
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(245, 158, 11, 0.15);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
}

.docu-fb-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.docu-fb-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.docu-fb-selector-badge {
  display: inline-block;
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docu-fb-modal-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Captura de Pantalla Preview */
.docu-fb-screenshot-preview {
  position: relative;
  width: 100%;
  height: 170px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #020617;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.docu-fb-screenshot-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.docu-fb-screenshot-overlay-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.85);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Tipo de Reporte */
.docu-fb-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docu-fb-label {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docu-fb-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.docu-fb-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid #1e293b;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.docu-fb-type-btn:hover {
  background: #1e293b;
  border-color: #475569;
  color: #ffffff;
}

.docu-fb-type-btn.active[data-type="bug"] {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #fca5a5;
}

.docu-fb-type-btn.active[data-type="improvement"] {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #6ee7b7;
}

.docu-fb-type-btn.active[data-type="ui"] {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #7dd3fc;
}

.docu-fb-type-btn.active[data-type="critical"] {
  background: rgba(220, 38, 38, 0.25);
  border-color: #dc2626;
  color: #f87171;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.35);
}

.docu-fb-input,
.docu-fb-textarea,
.docu-fb-select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #ffffff;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  transition: all 0.2s ease;
}

.docu-fb-input:focus,
.docu-fb-textarea:focus,
.docu-fb-select:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.docu-fb-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Acordeón de Telemetría Técnica */
.docu-fb-telemetry-accordion {
  border: 1px solid #1e293b;
  border-radius: 10px;
  background: #060911;
  overflow: hidden;
}

.docu-fb-telemetry-header {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.docu-fb-telemetry-header:hover {
  color: #cbd5e1;
}

.docu-fb-telemetry-body {
  padding: 10px 14px;
  border-top: 1px solid #1e293b;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  color: #94a3b8;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
}

/* Footer Modal */
.docu-fb-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #0f172a;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.docu-fb-btn-cancel {
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.docu-fb-btn-cancel:hover {
  background: #1e293b;
  color: #ffffff;
}

.docu-fb-btn-submit {
  padding: 9px 22px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #020617;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
}

.docu-fb-btn-submit:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5);
  transform: translateY(-1px);
}

.docu-fb-btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── 6. Toast Notification ── */
.docu-consultant-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 14px;
  background: #020617;
  border: 1px solid #10b981;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 15px rgba(16, 185, 129, 0.3);
  color: #ffffff;
  font-family: system-ui, -apple-system, sans-serif;
  animation: consultant-toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes consultant-toast-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.docu-toast-icon {
  font-size: 20px;
}

.docu-toast-title {
  font-size: 13px;
  font-weight: 800;
  color: #6ee7b7;
  margin: 0;
}

.docu-toast-sub {
  font-size: 11px;
  color: #cbd5e1;
  margin: 2px 0 0;
}
