/* CSS del panel de edición in-context (/editor) y de la vista de admin
   embebida — todo lo que no es parte del sistema de diseño público
   (ese vive en src/design-system-v2/, con sus propios .css por
   componente). Se carga global desde src/app/(frontend)/layout.tsx. */

/* --- Estados vacíos (mientras no hay contenido cargado en el CMS) --- */
.lqa-empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #495057;
  font-size: 16px;
}

/* --- Vista espejo de edición (/editor) --- */

.lqa-editor-topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: #001b4c;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 13px;
}

.lqa-editor-topbar a {
  color: #f1d21b;
  text-decoration: none;
  font-weight: 700;
}

.lqa-editor-logout {
  background: none;
  border: 0;
  padding: 0;
  color: #f1d21b;
  font-weight: 700;
  font-family: inherit;
  font-size: inherit;
  text-decoration: none;
  cursor: pointer;
}

.lqa-editor-logout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lqa-editor-nav {
  display: flex;
  gap: 16px;
}

/* Topbar de la vista de edición: en mobile no entran los dos grupos
   (nav de secciones + usuario/links) en una sola fila, así que se
   apilan en columna. */
@media (max-width: 700px) {
  .lqa-editor-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .lqa-editor-nav {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* Sección sin permiso: se ve, no se toca. */
.lqa-locked-section {
  position: relative;
  opacity: 0.5;
  filter: grayscale(40%);
  pointer-events: none;
  user-select: none;
}

.lqa-edit-btn {
  position: relative;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1d21b;
  border: 1px solid #d4b100;
  color: #111;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 4px;
}

.lqa-editmodal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.lqa-editmodal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 35, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: lqa-editmodal-fade-in 0.18s ease;
}

.lqa-editmodal-box {
  position: relative;
  width: min(1100px, 100%);
  height: min(calc(100vh - 48px), 860px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(15, 20, 35, 0.4);
  animation: lqa-editmodal-pop-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.lqa-editmodal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--dsv2-color-mpf-blue, #243151);
  color: #fff;
  font-family: var(--dsv2-font-body, Arial, sans-serif);
  flex: 0 0 auto;
}

.lqa-editmodal-title {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lqa-editmodal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.lqa-editmodal-refresh {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lqa-editmodal-refresh:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
}

.lqa-editmodal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lqa-editmodal-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lqa-editmodal-iframe {
  flex: 1;
  border: 0;
  width: 100%;
  background: #f5f5f5;
}

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

@keyframes lqa-editmodal-pop-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 700px) {
  .lqa-editmodal {
    padding: 0;
  }

  .lqa-editmodal-box {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

.lqa-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
}

.lqa-active-toggle input:disabled {
  cursor: not-allowed;
}

.lqa-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: #eee;
  color: #333;
}

.lqa-status-draft {
  background: #e5e7eb;
  color: #374151;
}

.lqa-status-pending {
  background: #fde68a;
  color: #7c5a00;
}

.lqa-status-published {
  background: #bbf7d0;
  color: #14532d;
}

.lqa-status-rejected {
  background: #fecaca;
  color: #7f1d1d;
}

/* --- Editor in-context v2: overlay sobre cards reales (sin grid
   duplicado), slot de "+ agregar" y panel lateral QuickEdit --- */

.lqa-card-overlay {
  position: relative;
}

.lqa-card-overlay-bar {
  position: absolute;
  top: 8px;
  right: 8px;
  left: 8px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.lqa-card-overlay-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #f1d21b;
  border: 1px solid #d4b100;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.lqa-card-overlay-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #fff;
  border: 1px solid #dc2626;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.lqa-confirm-delete {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lqa-confirm-delete-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.lqa-confirm-delete-box {
  position: relative;
  width: min(360px, calc(100% - 32px));
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 24px 70px rgba(15, 20, 35, 0.4);
}

.lqa-confirm-delete-message {
  margin: 0 0 16px;
  font-size: 14px;
  color: #333;
}

.lqa-confirm-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.lqa-confirm-delete-actions button {
  border: 0;
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.lqa-confirm-delete-cancel {
  background: #eee;
  color: #333;
}

.lqa-confirm-delete-confirm {
  background: #dc2626;
  color: #fff;
}

.lqa-confirm-delete-actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lqa-card-overlay-review {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  z-index: 20;
  display: flex;
  gap: 6px;
}

.lqa-card-overlay-review button {
  flex: 1;
  border: 0;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lqa-card-overlay-review button:first-child {
  background: #16a34a;
  color: #fff;
}

.lqa-card-overlay-review button:last-child {
  background: #dc2626;
  color: #fff;
}

.lqa-card-overlay-active {
  display: inline-flex;
  align-items: center;
  height: 28px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 4px;
  padding: 4px 8px;
}

.lqa-card-overlay-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid #dc2626;
  border-radius: 4px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lqa-card-overlay-remove:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lqa-featured-picker.lqa-editmodal-box {
  width: min(560px, 100%);
  height: min(70vh, 640px);
}

.lqa-featured-picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lqa-featured-picker-empty {
  color: #555;
  font-size: 14px;
}

.lqa-featured-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.lqa-featured-picker-item:hover {
  border-color: #f1d21b;
}

.lqa-featured-picker-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lqa-featured-picker-item img {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.lqa-add-card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 90px;
  border: 2px dashed #9a9a9a;
  border-radius: 6px;
  background: transparent;
  color: #555;
  font-size: 13px;
  cursor: pointer;
}

.lqa-add-card-slot:hover {
  border-color: #f1d21b;
  color: #111;
}

.lqa-add-card-slot-icon {
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}

.lqa-quickedit {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.lqa-quickedit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.lqa-quickedit-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.lqa-quickedit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #001b4c;
  color: #fff;
}

.lqa-quickedit-title {
  font-weight: 700;
  font-size: 15px;
}

.lqa-quickedit-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.lqa-quickedit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.lqa-quickedit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #333;
}

.lqa-quickedit-field input[type='text'],
.lqa-quickedit-field input[type='url'],
.lqa-quickedit-field textarea {
  font-weight: 400;
  padding: 8px 10px;
  border: 1px solid #d7d7d7;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.lqa-quickedit-preview {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  background: #f5f5f5;
  border-radius: 4px;
}

.lqa-quickedit-error {
  color: #dc2626;
  font-size: 13px;
  margin: 0;
}

.lqa-quickedit-actions {
  display: flex;
  justify-content: flex-end;
}
