:root{
  --bg:#0f1724;
  --card:#0b1220;
  --muted:#9aa6b2;
  --accent:#e5e7eb;
  --primary:#1f6feb;
  --glass: rgba(255,255,255,0.03);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter, system-ui, Arial, sans-serif;
  background: linear-gradient(180deg, #071028 0%, #071b2b 100%);
  color:var(--accent);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding:28px;
}

.container{
  max-width:980px;
  margin:0 auto;
}

header h1{margin:0 0 6px 0; font-size:1.6rem}
.muted{color:var(--muted)}
.small{font-size:0.85rem}

.card{
  background:var(--card);
  border-radius:10px;
  padding:14px;
  margin:14px 0;
  box-shadow: 0 6px 18px rgba(2,6,23,0.6);
}

.form-card{padding:18px}
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px,1fr));
  gap:12px;
}

label span{display:block; margin-bottom:6px; color:var(--muted); font-size:0.9rem}
input[type="text"], input[type="file"]{
  width:100%;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.06);
  background:var(--glass);
  color:var(--accent);
  outline:none;
}
input[type="file"]{padding:6px 0}

.evidence-section{margin-top:12px}
.evidence-header{display:flex; justify-content:space-between; align-items:center; margin-bottom:8px}
.link-btn{
  background:none;
  border:none;
  color:var(--muted);
  cursor:pointer;
  text-decoration:underline;
  font-size:0.9rem;
}

.previews{
  display:flex;
  gap:8px;
  margin-top:8px;
  flex-wrap:wrap;
}
.preview{
  width:110px;
  height:80px;
  border-radius:6px;
  overflow:hidden;
  position:relative;
  border:1px solid rgba(255,255,255,0.05);
}
.preview img{width:100%; height:100%; object-fit:cover; display:block}
.preview .pcount{
  position:absolute;
  bottom:4px;
  right:6px;
  background:rgba(0,0,0,0.45);
  color:#fff;
  font-size:0.75rem;
  padding:2px 6px;
  border-radius:12px;
}

.actions{display:flex; gap:10px; margin-top:12px; align-items:center}
.btn{
  padding:8px 12px;
  border-radius:8px;
  background:transparent;
  color:var(--accent);
  border:1px solid rgba(255,255,255,0.06);
  cursor:pointer;
}
.btn.primary{
  background:var(--primary);
  border-color:transparent;
  color:white;
  box-shadow:0 6px 12px rgba(31,111,235,0.12);
}

.output{
  min-height:160px;
  padding:12px;
  border-radius:8px;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border:1px solid rgba(255,255,255,0.03);
  white-space:pre-wrap;
  outline:none;
}

@media (max-width:520px){
  .grid{grid-template-columns:1fr}
  .preview{width:48%; height:90px}
}

.btn.danger {
  background-color: #dc3545;
  color: white;
}

.btn.danger:hover {
  background-color: #b02a37;
}

/* Área de pegado de imágenes */
.paste-area {
  border: 2px dashed #3a6ff7;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: #b0b0b0;
  margin-top: 10px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.paste-area:hover {
  background-color: rgba(58, 111, 247, 0.1);
  border-color: #5b8cff;
}

.paste-area img {
  display: inline-block;
  width: 100px;
  height: auto;
  margin: 5px;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(255,255,255,0.3);
}
/* === Autocompletado dinámico === */
.autocomplete-container {
  position: relative;
  width: 100%;
}

.sugerencias {
  position: absolute;
  background-color: #1e293b; /* tono oscuro */
  border: 1px solid #334155;
  border-radius: 0.5rem;
  list-style: none;
  margin-top: 3px;
  padding: 0;
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  z-index: 20;
}

.sugerencias li {
  padding: 8px 10px;
  cursor: pointer;
  color: #f1f5f9;
}

.sugerencias li:hover {
  background-color: #2563eb;
  color: #ffffff;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.tag {
  background: #1e88e5;
  color: #fff;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tag span {
  cursor: pointer;
  font-weight: bold;
}
/* === Sección de plantillas === */
.templates-section {
  margin-top: 40px;
}

.plantillas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.plantilla-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 15px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plantilla-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.plantilla-card h3 {
  margin-bottom: 8px;
  color: #4fc3f7;
}

.plantilla-card p {
  font-size: 0.9em;
  opacity: 0.8;
  margin-bottom: 15px;
}

.plantilla-actions {
  display: flex;
  gap: 10px;
}

.plantilla-actions button {
  flex: 1;
  padding: 6px 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  font-size: 0.9em;
}

.btn-copy {
  background: #1e88e5;
}

.btn-view {
  background: #00bfa5;
}

/* === Modal === */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.hidden { display: none; }

.modal-content {
  background: #121212;
  border-radius: 10px;
  padding: 20px;
  width: 80%;
  max-width: 700px;
  color: white;
  position: relative;
}

.close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 22px;
  cursor: pointer;
  color: #f44336;
}

pre {
  white-space: pre-wrap;
  font-family: "Consolas", monospace;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px;
  overflow-y: auto;
  max-height: 400px;
}
