/* ==========================================================================
   VISOR Y LECTOR DE LIBROS ELECTRÓNICOS - FIJATE TOOLS
   Sistema de Modales Accesibles y Diálogos de Confirmación
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-dialog {
  background: var(--bg-card, #161b22);
  border: 1px solid var(--border-color, rgba(240, 246, 252, 0.15));
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: scale(0.94) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-overlay.open .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color, rgba(240, 246, 252, 0.1));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.modal-title-group svg {
  color: var(--primary-color, #3b82f6);
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #f0f6fc);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #8b949e);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 75vh;
  color: var(--text-secondary, #8b949e);
  line-height: 1.6;
  font-size: 0.92rem;
}

.modal-body p {
  margin-bottom: 0.75rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color, rgba(240, 246, 252, 0.1));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Campos de Formulario dentro de Modales */
.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary, #f0f6fc);
  margin-bottom: 0.4rem;
}

.form-textarea, .form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color, rgba(240, 246, 252, 0.15));
  border-radius: 8px;
  color: var(--text-primary, #f0f6fc);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-textarea:focus, .form-input:focus {
  border-color: var(--primary-color, #3b82f6);
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
}

/* Atajos de Teclado */
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color, rgba(240, 246, 252, 0.08));
  border-radius: 8px;
}

.shortcut-label {
  font-size: 0.82rem;
  color: var(--text-primary, #f0f6fc);
}

.shortcut-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  color: #fff;
}

/* ==========================================================================
   MODAL DE EXPORTACIÓN PARA KINDLE
   ========================================================================== */

.kindle-export-modal-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.kindle-export-hero {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color, rgba(240, 246, 252, 0.08));
  padding: 1rem;
  border-radius: 12px;
}

.kindle-thumb-preview-wrap {
  position: relative;
  width: 100px;
  min-width: 100px;
  aspect-ratio: 1 / 1.42;
  background: #0f172a;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.kindle-thumb-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kindle-thumb-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #f59e0b;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.kindle-export-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.kindle-export-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #f0f6fc);
  margin: 0;
  line-height: 1.3;
}

.kindle-export-author {
  font-size: 0.84rem;
  color: var(--text-secondary, #8b949e);
  margin-bottom: 0.5rem;
}

.kindle-dest-paths {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
}

.kindle-path-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
}

.kindle-path-label {
  color: var(--text-muted, #6e7681);
  font-weight: 600;
  min-width: 55px;
}

.kindle-path-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  background: rgba(0, 0, 0, 0.4);
  color: #60a5fa;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.kindle-guide-box {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
}

.kindle-guide-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 0.5rem;
}

.kindle-steps-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.84rem;
  color: var(--text-secondary, #8b949e);
  line-height: 1.55;
}

.kindle-steps-list li {
  margin-bottom: 0.35rem;
}

.kindle-steps-list li strong {
  color: var(--text-primary, #f0f6fc);
}

.kindle-steps-list code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.08);
  color: #f59e0b;
  padding: 1px 4px;
  border-radius: 3px;
}

.kindle-export-status {
  padding: 0.6rem 0.9rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  font-size: 0.84rem;
  color: #60a5fa;
  text-align: center;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}
