/* Estilos para el listado de contenidos */

/* Estilos de Categorías */
.categorias {
  margin: 28px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.categoria-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 170px;
  height: 90px;
  border-radius: 16px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
}

.categoria-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.7) 100%);
  z-index: 1;
  transition: background 0.3s ease;
}

.categoria-btn.sin-portada {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

html[data-theme="light"] .categoria-btn.sin-portada {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.categoria-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 173, 181, 0.35);
  border-color: rgba(0, 173, 181, 0.5);
}

.categoria-btn:hover::before {
  background: linear-gradient(180deg, rgba(0, 173, 181, 0.2) 0%, rgba(0, 173, 181, 0.75) 100%);
}

.categoria-btn-text {
  position: relative;
  z-index: 2;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  padding: 6px 12px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
}

html[data-theme="light"] .categoria-btn.sin-portada .categoria-btn-text {
  color: var(--text);
  text-shadow: none;
}

.categoria-btn:hover .categoria-btn-text {
  color: #ffffff;
  transform: scale(1.05);
}

/* Cabecera de Categorías */
.category-section-header {
  margin-top: 48px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.category-section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  display: flex;
  align-items: center;
}

.category-admin-actions {
  display: flex;
  gap: 8px;
}

.btn-edit-category {
  background: rgba(255, 193, 7, 0.12);
  color: #ffc107 !important;
  border: 1px solid rgba(255, 193, 7, 0.25);
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-edit-category:hover {
  background: #ffc107;
  color: #1a1a1a !important;
}

.btn-delete-category {
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545 !important;
  border: 1px solid rgba(220, 53, 69, 0.25);
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-delete-category:hover {
  background: #dc3545;
  color: #ffffff !important;
}

/* Grid y Tarjetas de Contenido */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.content-card {
  background: var(--surface-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.content-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 173, 181, 0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.content-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 173, 181, 0.15);
  border-color: rgba(0, 173, 181, 0.4);
}

.content-card:hover::before {
  opacity: 1;
}

.card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.card-media {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-card:hover .card-media img {
  transform: scale(1.06);
}

.card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-header {
  margin-bottom: 0.75rem;
}

.card-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  margin: 0;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
  flex: 1;
}

.card-description {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 1.25rem 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 4.8rem;
  text-overflow: ellipsis;
}

.card-footer {
  margin-top: auto;
}

.price-button-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.price-card-modern {
  flex: 1;
  background: linear-gradient(135deg, rgba(248, 249, 250, 0.08) 0%, rgba(233, 236, 239, 0.04) 100%);
  border-radius: 14px;
  padding: 10px 14px;
  border: 2px solid var(--border, rgba(255, 255, 255, 0.12));
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.content-card:hover .price-card-modern {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 173, 181, 0.2);
}

html[data-theme="light"] .price-card-modern {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-color: rgba(0, 0, 0, 0.08);
}

.price-card-modern span {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.price-card-modern .price-val-gratis {
  color: #10b981 !important;
}

.price-card-modern .price-val-pago {
  color: #00adb5 !important;
}

.btn-ver-mas-modern {
  flex: 0 0 auto;
  margin-left: auto;
  background: linear-gradient(135deg, #00adb5 0%, #008b92 100%) !important;
  color: white !important;
  border: none !important;
  padding: 10px 20px !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  border-radius: 30px !important;
  box-shadow: 0 6px 20px rgba(0, 173, 181, 0.35) !important;
  transition: all 0.3s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  justify-content: center !important;
}

.content-card:hover .btn-ver-mas-modern {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 173, 181, 0.5) !important;
}

.content-card:hover .btn-ver-mas-modern i {
  transform: translateX(4px);
}

.btn-ver-mas-modern i {
  transition: transform 0.3s ease;
}

@media (max-width: 480px) {
  .price-button-container {
    gap: 8px;
  }
  .price-card-modern {
    padding: 8px 10px;
  }
  .price-card-modern span {
    font-size: 1rem;
  }
  .btn-ver-mas-modern {
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
  }
}

/* Badges y Etiquetas de Precio */
.free-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
  backdrop-filter: blur(4px);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.price-tier-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.price-tier {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.65rem;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.price-tier.tier-gratis {
  background: rgba(52, 211, 153, 0.15);
  color: #10b981;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.price-tier.tier-basico {
  background: rgba(74, 144, 226, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(74, 144, 226, 0.3);
}

.price-tier.tier-avanzado {
  background: rgba(155, 89, 182, 0.15);
  color: #a855f7;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

.price-tier.tier-pro {
  background: rgba(243, 156, 18, 0.15);
  color: #f97316;
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.price-tier.tier-vip {
  background: rgba(229, 231, 235, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(229, 231, 235, 0.3);
}

html[data-theme="dark"] .price-tier.tier-vip {
  background: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Botones Premium */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.2rem;
  border-radius: 12px !important;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  text-align: center;
  line-height: 1;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #00adb5 0%, #008b92 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 173, 181, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #00c5cf 0%, #00adb5 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 173, 181, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-details {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text) !important;
}

.btn-details:hover {
  background: rgba(0, 173, 181, 0.08);
  border-color: rgba(0, 173, 181, 0.3);
  color: #00adb5 !important;
  transform: translateY(-2px);
}

html[data-theme="light"] .btn-details {
  background: rgba(0, 0, 0, 0.02);
}

html[data-theme="light"] .btn-details:hover {
  background: rgba(0, 173, 181, 0.05);
}

/* Sección Admin de la Tarjeta */
.card-admin-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-admin-label {
  font-size: 0.75rem;
  color: #9b59b6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-admin-buttons {
  display: flex;
  gap: 6px;
}

.card-admin-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.9rem;
}

.card-admin-btn:hover {
  transform: translateY(-2px);
}

.card-admin-btn.edit {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107 !important;
  border: 1px solid rgba(255, 193, 7, 0.25);
}

.card-admin-btn.edit:hover {
  background: #ffc107;
  color: #1a1a1a !important;
}

.card-admin-btn.users {
  background: rgba(23, 162, 184, 0.15);
  color: #17a2b8 !important;
  border: 1px solid rgba(23, 162, 184, 0.25);
}

.card-admin-btn.users:hover {
  background: #17a2b8;
  color: #ffffff !important;
}

.card-admin-btn.delete {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545 !important;
  border: 1px solid rgba(220, 53, 69, 0.25);
}

.card-admin-btn.delete:hover {
  background: #dc3545;
  color: #ffffff !important;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .card-content {
    padding: 1rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-footer-main {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .price-block {
    align-items: center;
  }

  .card-actions {
    justify-content: center;
    width: 100%;
  }

  .btn {
    flex: 1 1 0%;
    min-width: 100px;
  }

  /* Estilos para el mensaje de Próximamente */
  .proximamente-container {
    max-width: 600px;
    width: 100%;
    margin: 40px auto;
    box-sizing: border-box;
    background: var(--surface-bg);
    border: 1px solid var(--border);
    padding: 48px 32px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    text-align: center;
  }

  @media (max-width: 768px) {
    .proximamente-container {
      margin: 20px auto;
      padding: 32px 18px;
      border-radius: 16px;
    }
    .proximamente-title {
      font-size: 1.75rem;
    }
    .proximamente-text {
      font-size: 1rem;
    }
  }

  .proximamente-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 173, 181, 0.08) 0%, transparent 60%);
    pointer-events: none;
  }

  .proximamente-icon {
    font-size: 3.5rem;
    color: #00adb5;
    margin-bottom: 24px;
    display: inline-block;
    animation: lock-pulse 2s infinite ease-in-out;
  }

  .proximamente-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text);
  }

  .proximamente-text {
    font-size: 1.15rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
  }

  @keyframes lock-pulse {
    0% {
      transform: scale(1);
      opacity: 0.9;
    }

    50% {
      transform: scale(1.08);
      opacity: 1;
      filter: drop-shadow(0 0 8px rgba(0, 173, 181, 0.5));
    }

    100% {
      transform: scale(1);
      opacity: 0.9;
    }
  }
}

/* Accesibilidad: Reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  body.user-reduced-motion .categoria-btn,
  body.user-reduced-motion .categoria-btn::before,
  body.user-reduced-motion .categoria-btn-text,
  body.user-reduced-motion .content-card,
  body.user-reduced-motion .content-card::before,
  body.user-reduced-motion .card-media img,
  body.user-reduced-motion .btn-ver-mas-modern,
  body.user-reduced-motion .btn-ver-mas-modern i,
  body.user-reduced-motion .btn,
  body.user-reduced-motion .card-admin-btn,
  body.user-reduced-motion .proximamente-icon {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
