
:root {
  --bg-0: #080e22;
  --bg-1: #101b42;
  --line: rgba(0, 180, 255, 0.16);
  --line-strong: rgba(0, 180, 255, 0.28);
  --surface: rgba(17, 30, 72, 0.62);
  --surface-hover: rgba(25, 43, 99, 0.9);
  --text: #eaf4ff;
  --muted: #a9bed9;
  --accent: #00c2ff;
  --accent-2: #11ffd0;
  --danger: #ff5e7c;
  --radius: 16px;
  --shadow: 0 14px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, #132458, var(--bg-0) 48%), radial-gradient(circle at 100% 100%, #0b2155 0%, transparent 60%), linear-gradient(180deg, #0a1330 0%, #050912 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.2));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-strong);
  backdrop-filter: blur(8px);
  background: rgba(7, 14, 35, 0.72);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent));
}

.brand-name {
  color: var(--accent);
  font-size: 1.4rem;
}

.lang-switch {
  display: flex;
  gap: 8px;
}

.lang-btn {
  border: 1px solid var(--line-strong);
  background: rgba(4, 24, 50, 0.7);
  color: var(--muted);
  border-radius: 9px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.lang-btn.active {
  color: #041224;
  background: linear-gradient(135deg, var(--accent), #8df6ff);
  border-color: transparent;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 16px 40px;
}

.hero {
  text-align: center;
  margin-bottom: 22px;
}

.hero-title {
  margin: 0;
  font-family: "Exo 2", sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.hero-title em {
  color: var(--accent);
  font-style: normal;
}

.hero-subtitle {
  margin: 10px auto 0;
  color: var(--muted);
  max-width: 760px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 170px 170px;
  gap: 12px;
  margin-bottom: 20px;
}

.input,
.select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(3, 20, 48, 0.85);
  color: var(--text);
  padding: 12px;
  font-size: 0.96rem;
}

.input::placeholder {
  color: #6a88af;
}

.catalog-wrap {
  min-height: 220px;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 238px;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  background: var(--surface-hover);
}

.card-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #ffe47a;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.card-title {
  font-family: "Exo 2", sans-serif;
  font-size: 1.08rem;
  line-height: 1.3;
  margin: 0;
}

.card-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/*---------------
 CAMBIO: card-author ahora es flex para mostrar avatar + nombre
---------------*/
.card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d5e6ff;
  font-size: 0.84rem;
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.card-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #26d4ff, #1a8fbf);
  color: #02142a;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(8, 26, 60, 0.6);
  margin-bottom: 12px;
}

.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #26d4ff, #1a8fbf);
  color: #02142a;
  font-weight: 700;
  font-size: 2rem;
}

.card-thumb-placeholder.cat-notebook {
  background: linear-gradient(135deg, #26d4ff, #1a8fbf);
}

.card-thumb-placeholder.cat-landing {
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.card-thumb-placeholder.cat-image {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.card-thumb-placeholder.cat-app {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.card-thumb-placeholder.cat-tool {
  background: linear-gradient(135deg, #f39c12, #e67e22);
}

.card-thumb-placeholder.cat-vibe {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(6, 29, 62, 0.9);
}

.btn-primary {
  color: #02142a;
  background: linear-gradient(135deg, #26d4ff, #89fbff);
}

.state-card {
  border: 1px solid var(--line-strong);
  background: rgba(3, 20, 48, 0.85);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.state-card--error {
  border-color: rgba(255, 94, 124, 0.55);
  color: #ffd6df;
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 9, 22, 0.72);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  width: min(680px, calc(100% - 24px));
  margin: 8vh auto;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, #172c6b, #0f204f);
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(8, 26, 60, 0.9);
  color: var(--text);
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.modal-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #ffe47a;
  margin-bottom: 10px;
}

.modal-content h2 {
  margin: 0;
  font-family: "Exo 2", sans-serif;
}

.modal-author {
  color: var(--muted);
  margin: 8px 0 0;
}

.modal-description {
  color: #deebff;
  line-height: 1.6;
  margin: 14px 0 0;
  white-space: pre-wrap;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .catalog {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}