/* CreaTV — Device Config: ícono discreto + modal de configuración */

/* ── Ícono discreto top-right del splash ─────────────────────── */
#btn-device-config {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 28, 26, 0.55);
  border: 1px solid rgba(232, 245, 242, 0.10);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
  z-index: 30;
  padding: 0;
}
#btn-device-config:hover,
#btn-device-config.focused {
  color: var(--accent-focus);
  border-color: var(--accent-focus);
  transform: rotate(45deg);
}
#btn-device-config svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ── Modal de configuración ──────────────────────────────────── */
#device-config-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#device-config-modal.visible {
  display: flex;
  opacity: 1;
}

.dc-card {
  background: rgba(13, 28, 26, 0.92);
  border: 1px solid rgba(232, 245, 242, 0.12);
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.dc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(232, 245, 242, 0.06);
}
.dc-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
  margin: 0;
}
.dc-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: inherit;
  line-height: 1;
}
.dc-close:hover { background: rgba(255, 255, 255, 0.10); color: var(--text-primary); }

.dc-device {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: rgba(107, 170, 160, 0.06);
  border-bottom: 1px solid rgba(232, 245, 242, 0.06);
}
.dc-device-icon {
  font-size: 28px;
  width: 40px;
  text-align: center;
}
.dc-device-text {
  flex: 1;
  min-width: 0;
}
.dc-device-label {
  font-size: 12px; /* mínimo legible: subido desde 11 px */
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.dc-device-name {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 2px;
}

/* UA debug — útil cuando un TV no se detecta correctamente. Truncado por
   defecto, se expande con un toque/click para ver el User-Agent completo. */
.dc-device-ua {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
  letter-spacing: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.dc-device-ua:hover { opacity: 1; }
.dc-device-ua.expanded {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-all;
  opacity: 1;
}

.dc-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 245, 242, 0.18) transparent;
}
.dc-list::-webkit-scrollbar { width: 6px; }
.dc-list::-webkit-scrollbar-thumb { background: rgba(232, 245, 242, 0.18); border-radius: 3px; }

.dc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  margin: 2px 0;
  transition: background 0.12s ease;
}
.dc-item:hover { background: rgba(255, 255, 255, 0.03); }
.dc-item.dc-disabled { opacity: 0.45; }

.dc-item-info { flex: 1; min-width: 0; }
.dc-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}

/* Badge "Recomendado" al lado del título — usado por la opción APK Android */
.dc-item-recommended {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(212, 236, 90, 0.15);
  color: var(--accent-focus);
  border: 1px solid rgba(212, 236, 90, 0.30);
  border-radius: 999px;
  text-transform: uppercase;
  vertical-align: middle;
}
.dc-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

/* Estado: badge a la derecha */
.dc-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}
.dc-status.applied  { background: rgba(77, 201, 138, 0.12); color: var(--accent-success); }
.dc-status.pending  { background: rgba(232, 160, 48, 0.12); color: var(--accent-warning); }
.dc-status.action   { background: rgba(212, 236, 90, 0.12); color: var(--accent-focus); cursor: pointer; border: 1px solid rgba(212, 236, 90, 0.25); }
.dc-status.action:hover { background: rgba(212, 236, 90, 0.18); }
.dc-status.unavailable { background: rgba(255, 255, 255, 0.04); color: var(--text-muted); }

/* Hint de instalación manual (iOS/TV) */
.dc-hint {
  margin: 4px 14px 12px;
  padding: 10px 14px;
  background: rgba(122, 175, 192, 0.08);
  border-left: 3px solid var(--accent-info);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.dc-hint strong { color: var(--text-primary); }

.dc-footer {
  padding: 14px 22px;
  border-top: 1px solid rgba(232, 245, 242, 0.06);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.dc-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.4px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.dc-btn-primary {
  background: var(--crea-teal);
  color: var(--bg-primary);
}
.dc-btn-primary:hover { background: var(--crea-mint); }
.dc-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(232, 245, 242, 0.12);
}
.dc-btn-ghost:hover { color: var(--text-primary); border-color: rgba(232, 245, 242, 0.25); }

/* Responsive */
@media (max-width: 480px) {
  #btn-device-config { width: 36px; height: 36px; top: 12px; right: 12px; }
  .dc-card { max-height: 92vh; }
  .dc-header h2 { font-size: 16px; }
  .dc-item-title { font-size: 13px; }
  .dc-item-desc  { font-size: 11px; }
}
