/* ===== Estilos básicos ===== */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #0b1220;
  color: #e6e6e6;
}

.container {
  width: min(1000px, 92%);
  margin: 24px auto;
}

h1, h2 { margin: 0 0 12px; }

/* ===== Controles ===== */
.controls label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

input[type="url"] {
  flex: 1;
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2b3550;
  outline: none;
  background: #0f1a33;
  color: #e6e6e6;
}

button {
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
}

#btnAdd {
  background: #2563eb;
  color: white;
}

#btnDelete {
  background: #ef4444;
  color: white;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Mensajes ===== */
.msg {
  display: block;
  margin-top: 10px;
  min-height: 18px;
  font-size: 14px;
}

.msg.ok { color: #22c55e; }
.msg.error { color: #f87171; }

/* ===== Galería ===== */
.gallery {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.gallery img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease;
  cursor: pointer;
}

.gallery img:hover {
  transform: scale(1.02);
}

/* Selección */
.gallery img.selected {
  border: 4px solid #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

/* Animación al agregar */
.gallery img.fade-in {
  animation: fadeIn 220ms ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

