/* Favicon Studio Pro — favicon-studio.css v3.0.0
   Estudio de Favicons & App Icons para MousyTools.
   Estándar: Dark OLED (#000000), Acentos Violeta Neón (#55378e, #8f6cc7, #bda0e2).
   Cero Emojis — 100% Iconografía SVG Profesional. */

.hidden {
  display: none !important;
}

/* ── Panel Izquierdo: Previsualización de Origen & Formatos con Miniaturas ── */
.fav-source-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fav-source-preview-box {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  background:
    linear-gradient(45deg, #14151a 25%, transparent 25%),
    linear-gradient(-45deg, #14151a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #14151a 75%),
    linear-gradient(-45deg, transparent 75%, #14151a 75%),
    #0c0d11;
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.fav-source-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.fav-source-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fav-source-name {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-source-details {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
}

.fav-source-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.fav-btn-action-sm {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-family: var(--font-ui, sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fav-btn-action-sm:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.fav-btn-action-sm.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Lista de formatos con miniaturas reales */
.fav-format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 6px;
  transition: all 0.15s ease;
}

.fav-format-row:hover {
  background: rgba(85, 55, 142, 0.08);
  border-color: rgba(143, 108, 199, 0.25);
}

.fav-format-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.fav-format-thumb {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #111217;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.fav-format-thumb img, .fav-format-thumb canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.fav-format-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fav-format-filename {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-format-sub {
  font-size: 0.65rem;
  color: var(--text-muted, #94a3b8);
}

.fav-format-dl-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 4px;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.fav-format-dl-btn:hover {
  color: #fff;
  background: var(--brand, #55378e);
  border-color: var(--brand-light, #8f6cc7);
}

/* ── Mesa Central de Trabajo ── */
.fav-stage-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface-elevated, #0d0c13);
}

.fav-stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  z-index: 10;
  flex-shrink: 0;
}

.fav-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: var(--brand-lighter, #bda0e2);
  background: rgba(85, 55, 142, 0.18);
  border: 1px solid rgba(143, 108, 199, 0.35);
  padding: 4px 10px;
  border-radius: 6px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-view-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.fav-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-ui, sans-serif);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.fav-view-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.fav-view-btn.active {
  color: #fff;
  background: var(--brand, #55378e);
  box-shadow: 0 2px 10px rgba(85, 55, 142, 0.45);
}

.fav-stage-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* ── Zona de Carga Vacía (Empty State) ── */
.fav-empty-drop {
  border: 2px dashed rgba(143, 108, 199, 0.4);
  border-radius: 18px;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(85, 55, 142, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 520px;
  margin: auto !important;
}

.fav-empty-drop:hover, .fav-empty-drop.dragover {
  border-color: var(--brand-lighter, #bda0e2);
  background: rgba(85, 55, 142, 0.12);
  box-shadow: 0 0 30px rgba(143, 108, 199, 0.2);
}

.fav-empty-icon {
  width: 54px;
  height: 54px;
  color: var(--brand-light, #8f6cc7);
  margin-bottom: 14px;
}

.fav-empty-h2 {
  font-family: var(--font-display, sans-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
}

.fav-empty-p {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  margin: 0 0 18px;
  max-width: 360px;
  line-height: 1.5;
}

/* ── 1. MATRIZ DE ICONOS (VISTA DESTACADA / GRID) ── */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.matrix-card {
  background: rgba(18, 20, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.matrix-card:hover {
  background: rgba(25, 28, 38, 0.9);
  border-color: rgba(143, 108, 199, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.matrix-card-preview-box {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #18191d 25%, transparent 25%),
    linear-gradient(-45deg, #18191d 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #18191d 75%),
    linear-gradient(-45deg, transparent 75%, #18191d 75%),
    #0f1013;
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.matrix-card-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.matrix-card-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.matrix-card-name {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matrix-card-meta {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
}

.matrix-card-dl {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: var(--font-ui, sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.matrix-card-dl:hover {
  background: var(--brand, #55378e);
  border-color: var(--brand-light, #8f6cc7);
  box-shadow: 0 4px 12px rgba(85, 55, 142, 0.35);
}

/* ── Insignia de la Matriz en Toolbar ── */
.fav-matrix-header-badge {
  display: flex;
  align-items: center;
}

.fav-matrix-badge-pill {
  font-family: var(--font-ui, sans-serif);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--brand-lighter, #bda0e2);
  background: rgba(143, 108, 199, 0.14);
  border: 1px solid rgba(143, 108, 199, 0.28);
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
}


/* ── Visor de Código ── */
.code-viewer-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.code-tabs-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 5px;
}

.code-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.code-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.code-tab-btn.active {
  color: var(--brand-lighter, #bda0e2);
  background: rgba(85, 55, 142, 0.25);
}

.code-box-container {
  position: relative;
  background: #09090d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  font-family: var(--font-mono, monospace);
  font-size: 0.67rem;
  line-height: 1.45;
  color: #e2e8f0;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.btn-copy-code {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(143, 108, 199, 0.35);
  background: rgba(85, 55, 142, 0.3);
  color: #fff;
  font-size: 0.63rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-copy-code:hover { background: var(--brand, #55378e); }

/* ── Responsive ── */
@media (max-width: 1199px) {
  .fav-simulation-grid {
    grid-template-columns: 1fr 210px;
  }
  .real-phone-device {
    width: 176px;
    height: 310px;
  }
}

@media (max-width: 640px) {
  .fav-simulation-grid {
    grid-template-columns: 1fr;
  }
  .matrix-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Phone View Home Screen ── */
.phone-view-home {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Dock apps: tamaño compacto ── */
.real-phone-dock .phone-app-squircle {
  width: 30px;
  height: 30px;
}

/* ── Matrix: el grid respeta padding pero ocupa todo el ancho disponible ── */
#mockupStage .matrix-grid {
  max-width: 100%;
  padding: 4px;
}
