/* =========================================================
   CyberRoad — Notas e Ideas
   Estilos específicos para la sección de notas
   ========================================================= */

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.notes-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0;
}

.btn-nueva-nota {
  background: var(--blue);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  font-size: .95rem;
}

.btn-nueva-nota:hover {
  background: #3db8c8;
  transform: translateY(-2px);
}

/* Filtros */
.filtros-seccion {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 32px;
}

.filtros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.filtro-grupo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filtro-grupo label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-family: var(--font-mono);
}

.filtro-grupo select,
.filtro-grupo input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .9rem;
  transition: border-color .15s;
}

.filtro-grupo select:focus,
.filtro-grupo input:focus {
  outline: none;
  border-color: var(--blue);
}

/* Grid de notas */
.notas-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* Tarjeta de nota */
.nota-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.nota-card:hover {
  border-color: var(--ink-faint);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  transform: translateY(-4px);
}

.nota-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--blue);
}

.nota-card.idea::before { background: var(--blue); }
.nota-card.mejora::before { background: var(--amber); }
.nota-card.bug::before { background: var(--red); }
.nota-card.contenido::before { background: #10b981; }
.nota-card.examenes::before { background: #f59e0b; }
.nota-card.ui::before { background: #8b5cf6; }
.nota-card.otro::before { background: var(--ink-dim); }

.nota-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.nota-titulo {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
  flex: 1;
  word-break: break-word;
}

.nota-titulo a {
  color: var(--blue);
  text-decoration: none;
}

.nota-titulo a:hover {
  text-decoration: underline;
}

.nota-acciones {
  display: flex;
  gap: 8px;
}

.btn-accion {
  background: transparent;
  border: 1px solid var(--line);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  font-size: .9rem;
  transition: background .15s, border-color .15s, color .15s;
}

.btn-accion:hover {
  background: var(--panel-2);
  border-color: var(--ink-faint);
  color: var(--ink);
}

.nota-descripcion {
  color: var(--ink-dim);
  font-size: .9rem;
  line-height: 1.5;
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.nota-descripcion a {
  color: var(--blue);
  text-decoration: underline;
  word-break: break-word;
}

.nota-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .8rem;
  font-family: var(--font-mono);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.badge.categoria {
  background: rgba(53, 184, 196, .15);
  color: var(--blue);
}

.badge.prioridad-alta {
  background: rgba(228, 72, 62, .15);
  color: var(--red);
}

.badge.prioridad-media {
  background: rgba(245, 158, 11, .15);
  color: #f59e0b;
}

.badge.prioridad-baja {
  background: rgba(16, 185, 129, .15);
  color: #10b981;
}

.badge.estado-pendiente {
  background: rgba(107, 114, 128, .15);
  color: var(--ink-dim);
}

.badge.estado-progreso {
  background: rgba(245, 158, 11, .15);
  color: #f59e0b;
}

.badge.estado-completado {
  background: rgba(16, 185, 129, .15);
  color: #10b981;
}

.nota-etiquetas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.etiqueta {
  display: inline-block;
  padding: 4px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: .75rem;
  color: var(--ink-dim);
}

.nota-fecha {
  font-size: .8rem;
  color: var(--ink-faint);
  margin-top: 4px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-contenido {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-cerrar {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--ink-dim);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}

.btn-cerrar:hover {
  color: var(--ink);
}

.form-grupo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-grupo label {
  font-weight: 600;
  font-size: .9rem;
  color: var(--ink);
}

.form-grupo input,
.form-grupo select,
.form-grupo textarea {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .9rem;
  transition: border-color .15s;
}

.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--panel-2);
}

.form-grupo textarea {
  min-height: 100px;
  resize: vertical;
  font-family: var(--font-body);
}

.etiquetas-input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  font-size: .9rem;
}

.etiquetas-pista {
  font-size: .8rem;
  color: var(--ink-faint);
  margin-top: 4px;
}

.form-botones {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  justify-content: flex-end;
}

.btn-primario {
  background: var(--blue);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.btn-primario:hover {
  background: #3db8c8;
}

.btn-secundario {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.btn-secundario:hover {
  background: var(--panel-2);
  border-color: var(--ink-faint);
}

.btn-eliminar {
  background: rgba(228, 72, 62, .1);
  color: var(--red);
  border: 1px solid rgba(228, 72, 62, .3);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.btn-eliminar:hover {
  background: rgba(228, 72, 62, .2);
  border-color: var(--red);
}

.sin-notas {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-dim);
}

.sin-notas p {
  font-size: 1rem;
  margin: 0;
}

.sin-notas .emoji {
  font-size: 3rem;
  margin-bottom: 16px;
}

@media (max-width: 700px) {
  .notes-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filtros-grid {
    grid-template-columns: 1fr;
  }

  .notas-container {
    grid-template-columns: 1fr;
  }
}
