/* ═══════════════════════════════════════════════════════════
   REPOSITORIO DE DATOS - Estilos Premium
   ═══════════════════════════════════════════════════════════ */

:root {
  --repo-bg: #F8FAFC;
  --repo-surface: #FFFFFF;
  --repo-border: #E2E8F0;
  --repo-border-focus: #3B82F6;
  --repo-text-dark: #0F172A;
  --repo-text-muted: #64748B;
  --repo-primary: #1E3A8A;
  --repo-primary-light: #EFF6FF;
  --repo-accent: #2563EB;
  --repo-radius-lg: 1rem;
  --repo-radius-md: 0.75rem;
  --repo-radius-sm: 0.5rem;
  --repo-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --repo-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --repo-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --repo-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* ── Contenedor Principal ── */
.repositorio-page {
  background-color: var(--repo-bg);
  min-height: 80vh;
  padding-bottom: 4rem;
}

.repositorio-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  box-sizing: border-box;
}

/* ── Destacados Section ── */
.repo-featured-section {
  margin-bottom: 3.5rem;
}

.repo-section-header {
  margin-bottom: 1.5rem;
}

.repo-section-subtitle {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--repo-accent);
  margin-bottom: 0.25rem;
}

.repo-section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--repo-text-dark);
  margin: 0;
  letter-spacing: -0.02em;
}

.repo-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.repo-featured-card {
  position: relative;
  background: var(--repo-surface);
  border-radius: var(--repo-radius-lg);
  border: 1px solid var(--repo-border);
  overflow: hidden;
  box-shadow: var(--repo-shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.repo-featured-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--repo-shadow-hover);
  border-color: rgba(37, 99, 235, 0.35);
}

.repo-featured-banner {
  height: 140px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.repo-featured-banner-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
}

.repo-featured-icon-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: var(--repo-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--repo-shadow-md);
}

.repo-badge-destacado {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.repo-featured-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ── Barra de Control & Filtros ── */
.repo-controls-card {
  background: var(--repo-surface);
  border: 1px solid var(--repo-border);
  border-radius: var(--repo-radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--repo-shadow-sm);
  margin-bottom: 2rem;
}

.repo-filter-row {
  margin-bottom: 1.25rem;
}

.repo-filter-row:last-child {
  margin-bottom: 0;
}

.repo-filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--repo-text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.repo-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.repo-pill {
  appearance: none;
  background: #F1F5F9;
  color: var(--repo-text-muted);
  border: 1px solid transparent;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  user-select: none;
}

.repo-pill:hover {
  background: #E2E8F0;
  color: var(--repo-text-dark);
}

.repo-pill.active {
  background: var(--repo-accent);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.repo-pill-helix.active {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ── Barra de Resultados y Vistas (Header Bar) ── */
.repo-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.repo-count-badge {
  font-size: 0.9375rem;
  color: var(--repo-text-muted);
}

.repo-count-badge strong {
  color: var(--repo-text-dark);
  font-weight: 800;
}

.repo-view-tabs {
  display: inline-flex;
  background: #E2E8F0;
  padding: 3px;
  border-radius: 9999px;
  gap: 2px;
}

.repo-view-tab {
  background: transparent;
  border: none;
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--repo-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.repo-view-tab i {
  font-size: 0.9375rem;
}

.repo-view-tab.active {
  background: #ffffff;
  color: var(--repo-text-dark);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* ── Vista Tarjetas (Grid) ── */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.repo-card {
  background: var(--repo-surface);
  border: 1px solid var(--repo-border);
  border-radius: var(--repo-radius-lg);
  overflow: hidden;
  box-shadow: var(--repo-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
}

.repo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--repo-shadow-lg);
  border-color: rgba(37, 99, 235, 0.3);
}

.repo-card-top-bar {
  height: 4px;
  width: 100%;
}

.repo-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.repo-card-meta-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.repo-card-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--repo-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.repo-card-tags-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.repo-helix-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.repo-year-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--repo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.repo-card-type-label {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.repo-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--repo-text-dark);
  line-height: 1.4;
  margin: 0 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.repo-card:hover .repo-card-title {
  color: var(--repo-accent);
}

.repo-card-desc {
  font-size: 0.8125rem;
  color: var(--repo-text-muted);
  line-height: 1.55;
  margin: 0 0 1rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.repo-card-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.repo-hashtag {
  font-size: 0.6875rem;
  background: #F1F5F9;
  color: var(--repo-text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-weight: 500;
}

.repo-card-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--repo-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.repo-card-author-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.repo-card-author-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--repo-text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repo-card-format-info {
  font-size: 0.6875rem;
  color: var(--repo-text-muted);
}

.repo-btn-action {
  appearance: none;
  background: transparent;
  border: 1px solid var(--repo-border);
  color: var(--repo-text-dark);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.repo-btn-action:hover {
  background: var(--repo-accent);
  color: #ffffff;
  border-color: var(--repo-accent);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

/* ── Vista Lista (Tabla) ── */
.repo-list-view {
  background: var(--repo-surface);
  border: 1px solid var(--repo-border);
  border-radius: var(--repo-radius-lg);
  overflow: hidden;
  box-shadow: var(--repo-shadow-sm);
}

.repo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.repo-table th {
  background: #F8FAFC;
  padding: 1rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--repo-text-muted);
  border-bottom: 1px solid var(--repo-border);
}

.repo-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--repo-border);
  font-size: 0.875rem;
  vertical-align: middle;
}

.repo-table tr:last-child td {
  border-bottom: none;
}

.repo-table tr:hover td {
  background-color: #F8FAFC;
}

.repo-table-title-cell {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.repo-table-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--repo-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.repo-table-title-text {
  font-weight: 600;
  color: var(--repo-text-dark);
  line-height: 1.3;
}

.repo-table-author-sub {
  font-size: 0.75rem;
  color: var(--repo-text-muted);
}

/* ── Estado Vacío ── */
.repo-empty-state {
  background: var(--repo-surface);
  border: 2px dashed var(--repo-border);
  border-radius: var(--repo-radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  color: var(--repo-text-muted);
}

.repo-empty-state i {
  font-size: 3rem;
  color: #CBD5E1;
  margin-bottom: 1rem;
  display: inline-block;
}

.repo-empty-state h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--repo-text-dark);
  margin: 0 0 0.5rem 0;
}

.repo-empty-state p {
  font-size: 0.875rem;
  margin: 0;
}

/* ── CTA Banner Proponer Recurso ── */
.repo-cta-box {
  margin-top: 4rem;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, hsl(216, 50%, 24%) 0%, hsl(280, 67%, 51%) 100%);
  position: relative;
  overflow: hidden;
  padding: 3rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.repo-cta-bg-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.2;
  pointer-events: none;
}

.repo-cta-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.repo-cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.repo-cta-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.75rem 0;
  line-height: 1.25;
}

.repo-cta-desc {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  margin: 0;
}

.repo-cta-btn {
  position: relative;
  z-index: 1;
  appearance: none;
  background: #ffffff;
  color: var(--repo-primary);
  border: none;
  padding: 0.85rem 2rem;
  border-radius: 9999px;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.repo-cta-btn:hover {
  background: #F8FAFC;
  transform: scale(1.03);
  box-shadow: 0 15px 20px -3px rgba(0, 0, 0, 0.25);
  color: var(--repo-primary);
}

/* ── Modal de Detalle de Recurso ── */
.repo-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.repo-modal.open {
  display: flex;
  animation: repoFadeIn 0.2s ease;
}

@keyframes repoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.repo-modal-content {
  background: var(--repo-surface);
  width: 100%;
  max-width: 640px;
  border-radius: 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.repo-modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--repo-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.repo-modal-close {
  background: #F1F5F9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--repo-text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.repo-modal-close:hover {
  background: #E2E8F0;
  color: var(--repo-text-dark);
}

.repo-modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  max-height: 70vh;
}

.repo-modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--repo-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #F8FAFC;
}

/* ═══════════════════════════════════════════════════════════
   ESTILOS: TARJETA DE CONTENIDO EXCLUSIVO (AUTH GATE)
   ═══════════════════════════════════════════════════════════ */

.exclusivo-wrapper {
  position: relative;
  width: 100%;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  box-sizing: border-box;
}

.exclusivo-modal-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  z-index: 10;
}

.exclusivo-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 40px 48px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05),
              0 20px 40px -10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.exclusivo-icon-box {
  background-color: #f1f5f9;
  color: #1e293b;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.exclusivo-info-box {
  margin-bottom: 28px;
}

.exclusivo-titulo {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}

.exclusivo-descripcion {
  font-size: 14px;
  line-height: 1.5;
  color: #64748b;
  margin: 0;
}

.exclusivo-botones-box {
  display: flex;
  width: 100%;
  gap: 12px;
}

.btn-exclusivo {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-registrarse {
  background-color: #1e293b;
  color: #ffffff;
  border: 1px solid transparent;
}

.btn-registrarse:hover {
  background-color: #0f172a;
}

.btn-login {
  background-color: #f8fafc;
  color: #1e293b;
  border: 1px solid #e2e8f0;
}

.btn-login:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-exclusivo svg {
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .repo-featured-grid,
  .repo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .repo-featured-grid,
  .repo-grid {
    grid-template-columns: 1fr;
  }

  .repo-cta-box {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
  }

  .repositorio-container {
    padding: 0 1rem;
  }
  
  .repo-controls-card {
    padding: 1.25rem;
  }

  .exclusivo-card {
    padding: 30px 20px;
  }

  .exclusivo-botones-box {
    flex-direction: column;
  }
}
