/* RepositorioBuscador.css — modal buscador/adopción del repositorio (producción) */
.repo-overlay{
  display:none; position:fixed; inset:0; z-index:99999;
  background:rgba(15,23,32,.6); backdrop-filter:blur(3px);
  align-items:center; justify-content:center; padding:12px;
  animation:repoFade .16s ease;
}
@keyframes repoFade{ from{opacity:0} to{opacity:1} }
.repo-card{
  background:#fff; width:min(940px,96vw); max-height:92vh; border-radius:16px;
  display:flex; flex-direction:column; overflow:hidden; min-height:0;
  box-shadow:0 24px 70px rgba(0,0,0,.4); animation:repoUp .2s cubic-bezier(.2,.8,.2,1);
}
@keyframes repoUp{ from{transform:translateY(14px);opacity:.6} to{transform:none;opacity:1} }
.repo-view{ display:flex; flex-direction:column; min-height:0; flex:1 1 auto; }

/* ---- header ---- */
.repo-header{ display:flex; align-items:center; gap:10px; padding:14px 16px; border-bottom:1px solid #eef1f4; }
.repo-title{ font-weight:700; font-size:16px; color:#0f2a3d; flex:1 1 auto; text-align:left; }
.repo-view-adoptar .repo-title,.repo-view-subir .repo-title{ text-align:center; }
.repo-close{ border:0; background:#f1f4f7; border-radius:9px; width:34px; height:34px; cursor:pointer; font-size:15px; color:#556; transition:background .12s; }
.repo-close:hover{ background:#e6eaef; }
.repo-back{ border:0; background:transparent; color:#2b8a63; font-weight:600; font-size:14px; cursor:pointer; padding:6px 4px; }
.repo-back:hover{ color:#1c6b4b; }

/* ---- buscar ---- */
.repo-search-row{ position:relative; padding:12px 16px 8px; }
.repo-search-ico{ position:absolute; left:28px; top:50%; transform:translateY(-30%); font-size:15px; opacity:.5; pointer-events:none; }
.repo-input{ width:100%; padding:12px 14px 12px 40px; border:1px solid #d7dbe0; border-radius:11px; font-size:15px; outline:none; transition:border .12s, box-shadow .12s; }
.repo-input:focus{ border-color:#2b8a63; box-shadow:0 0 0 3px rgba(43,138,99,.16); }
.repo-grid{
  overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  padding:10px 16px 14px; display:grid;
  grid-template-columns:repeat(auto-fill,minmax(148px,1fr)); gap:12px;
  flex:1 1 auto; min-height:0;
}
.repo-item{
  border:1px solid #eef0f2; border-radius:13px; padding:9px; cursor:pointer; background:#fff;
  display:flex; flex-direction:column; transition:transform .09s ease, box-shadow .14s ease, border-color .14s;
}
.repo-item:hover{ transform:translateY(-3px); box-shadow:0 8px 22px rgba(20,60,45,.14); border-color:#bfe3d1; }
.repo-thumb{ width:100%; aspect-ratio:1/1; background:#f8fafb; border-radius:9px; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.repo-thumb img{ width:100%; height:100%; object-fit:contain; }
.repo-item-name{ font-weight:600; font-size:13px; margin-top:7px; color:#122; line-height:1.22; max-height:2.5em; overflow:hidden; }
.repo-item-desc{ font-size:11px; color:#6a7681; margin-top:2px; line-height:1.2; max-height:2.4em; overflow:hidden; }
.repo-item-cat{ font-size:10px; color:#8b5cf6; margin-top:3px; font-weight:600; }
.repo-item-stars{ font-size:11px; color:#e0a200; margin-top:5px; }
.repo-item-stars span{ color:#9aa4ac; }
.repo-estado{ padding:0 16px 8px; font-size:13px; color:#6a7681; }
.repo-footer{ padding:12px 16px; border-top:1px solid #eef1f4; }
.repo-btn-nuevo{ width:100%; padding:12px; border:1px dashed #b9c2cc; background:#f7f9fb; border-radius:11px; cursor:pointer; font-size:13px; color:#3a4a56; transition:.14s; }
.repo-btn-nuevo:hover{ background:#eef6f1; border-color:#2b8a63; color:#186; }

/* ---- adoptar (detalle) ---- */
.repo-detalle{ overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; min-height:0; flex:1 1 auto; padding:16px; display:grid; grid-template-columns:230px 1fr; gap:18px; }
.repo-det-media{ background:#f8fafb; border-radius:13px; overflow:hidden; aspect-ratio:1/1; display:flex; align-items:center; justify-content:center; }
.repo-det-media img{ width:100%; height:100%; object-fit:contain; }
.repo-det-info{ display:flex; flex-direction:column; min-width:0; overflow:hidden; }
.repo-det-name{ font-size:19px; font-weight:700; color:#0f2a3d; }
.repo-det-desc{ font-size:14px; color:#556; margin-top:5px; }
.repo-det-cat{ display:inline-block; margin-top:9px; font-size:11px; font-weight:600; color:#2b8a63; background:#eaf6ef; padding:3px 9px; border-radius:20px; width:max-content; }
.repo-det-lock{ font-size:12px; color:#8a7a3a; background:#fdf7e3; border:1px solid #f0e4b8; padding:8px 10px; border-radius:9px; margin-top:12px; }
.repo-form{ margin-top:auto; padding-top:16px; }
.repo-form-row{ display:flex; gap:12px; }
.repo-field{ flex:1 1 0; min-width:0; margin-bottom:12px; }
.repo-field label{ display:block; font-size:12px; font-weight:600; color:#556; margin-bottom:5px; }
.repo-field input,.repo-field textarea{ width:100%; box-sizing:border-box; padding:11px 12px; border:1px solid #d7dbe0; border-radius:10px; font-size:15px; outline:none; transition:border .12s,box-shadow .12s; }
.repo-field input:focus,.repo-field textarea:focus{ border-color:#2b8a63; box-shadow:0 0 0 3px rgba(43,138,99,.15); }
.repo-input-money{ position:relative; }
.repo-input-money span{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#8a94a0; font-size:15px; }
.repo-input-money input{ padding-left:26px; }
.repo-form-err{ color:#c0392b; font-size:13px; margin-bottom:10px; }
.repo-btn-save{
  width:100%; padding:13px; border:0; border-radius:11px; cursor:pointer; font-size:15px; font-weight:600;
  color:#fff; background:linear-gradient(135deg,#2fa06f,#1f8a5c); display:flex; align-items:center; justify-content:center; gap:8px;
  transition:filter .12s, transform .06s;
}
.repo-btn-save:hover{ filter:brightness(1.05); }
.repo-btn-save:active{ transform:translateY(1px); }
.repo-btn-save:disabled{ filter:grayscale(.4) brightness(.95); cursor:default; }

/* ---- subir ---- */
.repo-subir-body{ overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; min-height:0; flex:1 1 auto; padding:16px; }
.repo-subir-note{ font-size:12px; color:#8a7a3a; background:#fdf7e3; border:1px solid #f0e4b8; padding:9px 11px; border-radius:9px; margin-bottom:14px; }
.repo-drop{ position:relative; border:2px dashed #c4ccd4; border-radius:13px; min-height:160px; display:flex; align-items:center; justify-content:center; cursor:pointer; background:#fafbfc; overflow:hidden; transition:border-color .14s, background .14s; margin-bottom:14px; }
.repo-drop:hover,.repo-drop.is-over{ border-color:#2b8a63; background:#f1f8f4; }
.repo-drop-inner{ text-align:center; color:#6a7681; }
.repo-drop-ico{ font-size:34px; }
.repo-drop-txt{ font-size:13px; margin-top:6px; }
.repo-drop-txt small{ color:#9aa4ac; }
.repo-drop-preview{ max-width:100%; max-height:240px; object-fit:contain; }

/* ---- spinner ---- */
.repo-spin{ width:15px; height:15px; border:2px solid rgba(255,255,255,.4); border-top-color:#fff; border-radius:50%; display:inline-block; animation:repoSpin .7s linear infinite; }
@keyframes repoSpin{ to{ transform:rotate(360deg) } }

/* ---- responsive ---- */
@media (max-width:560px){
  /* En iOS 100vh incluye la barra de Safari => la card se sale por abajo y el scroll
     queda inalcanzable. Usar 100dvh (dynamic viewport) y alinear arriba, no centrar. */
  .repo-overlay{ padding:0; align-items:stretch; justify-content:stretch; }
  .repo-card{
    width:100vw; border-radius:0;
    height:100vh; height:100dvh;
    max-height:100vh; max-height:100dvh;
  }
  .repo-grid{ grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:10px; }
  .repo-detalle{ grid-template-columns:1fr; }
  .repo-det-media{ max-width:220px; margin:0 auto; }
}

/* ---- badge privado ---- */
.repo-item-badge{
  position:absolute; top:16px; right:16px;
  background:rgba(15,23,32,.75); backdrop-filter:blur(6px);
  color:#fff; font-size:11px; padding:3px 7px; border-radius:7px;
  z-index:2;
}
.repo-thumb{ position:relative; }

/* ---- aviso duplicado ---- */
.repo-form-warn{
  color:#8a7a3a; background:#fdf7e3; border:1px solid #f0e4b8;
  padding:8px 10px; border-radius:9px; font-size:12px; margin-bottom:10px;
}
