/* =============================================
   DEEP AGILE - ESTILOS ESPECÍFICOS
   ============================================= */

:root {
  --accent-deep: #9f7aea;  /* Violeta para Deep Agile */
  --accent-deep-light: rgba(159, 122, 234, 0.15);
  --accent-deep-border: rgba(159, 122, 234, 0.3);
}

/* HERO DEL FRAMEWORK */
#libro-hero {
  background: linear-gradient(
    135deg,
    rgba(159, 122, 234, 0.03) 0%,
    rgba(88, 166, 255, 0.02) 50%,
    transparent 100%
  );
  border-bottom: 1px solid var(--border);
}

.framework-badge-placeholder {
  position: relative;
  width: 280px;
  aspect-ratio: 6/9;
  border-radius: 6px 12px 12px 6px;
  border: 1px solid var(--accent-deep-border);
  background: linear-gradient(135deg, var(--accent-deep-light), rgba(159, 122, 234, 0.05));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    -8px 0 0 rgba(0,0,0,0.2),
    0 30px 80px rgba(159, 122, 234, 0.1),
    0 0 60px rgba(159, 122, 234, 0.08);
  transform: perspective(600px) rotateY(-8deg);
  transition: transform 0.5s var(--ease-out);
}

#libro-hero:hover .framework-badge-placeholder {
  transform: perspective(600px) rotateY(0deg) scale(1.02);
}

/* EFECTO DE GLOW PARA SECCIONES */
.section-glow {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.section-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(159, 122, 234, 0.08), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.section-glow:hover {
  border-color: var(--accent-deep);
  box-shadow: 0 8px 24px rgba(159, 122, 234, 0.12);
}

.section-glow:hover::before {
  opacity: 1;
}

/* ESTRUCTURA DE PROBLEMAS */
#framework-problema .feature-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

#framework-problema .feature-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

#framework-problema .feature-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  opacity: 0;
  animation: slideInIcon 0.6s var(--ease-out) forwards;
}

#framework-problema .feature-item:nth-child(1) .feature-icon { animation-delay: 0.1s; }
#framework-problema .feature-item:nth-child(2) .feature-icon { animation-delay: 0.2s; }
#framework-problema .feature-item:nth-child(3) .feature-icon { animation-delay: 0.3s; }
#framework-problema .feature-item:nth-child(4) .feature-icon { animation-delay: 0.4s; }

@keyframes slideInIcon {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#framework-problema .feature-item div {
  flex: 1;
  color: var(--txt-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

#framework-problema .feature-item strong {
  color: var(--txt);
  font-weight: 500;
}

/* TARJETA DE CONTEXTO */
.prefacio-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-deep-border);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.prefacio-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 80% at 100% 0%, rgba(159, 122, 234, 0.1), transparent);
  pointer-events: none;
}

.prefacio-card:hover {
  border-color: var(--accent-deep);
  box-shadow: 0 8px 20px rgba(159, 122, 234, 0.15);
}

.prefacio-card > * { position: relative; z-index: 1; }

.prefacio-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.prefacio-card h3 {
  color: var(--txt);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.prefacio-card p {
  color: var(--txt-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.prefacio-card p:last-of-type {
  margin-bottom: 0;
}

.prefacio-autor {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  color: var(--txt);
  font-weight: 500;
  font-size: 0.85rem;
}

.prefacio-autor span {
  color: var(--txt-muted);
  display: block;
  font-weight: 400;
  margin-top: 0.3rem;
}

/* GRID DE PILARES */
#framework-pilares .indice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.capitulo-card {
  padding: 1.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.capitulo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 40% 60% at 50% 0%, rgba(159, 122, 234, 0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.capitulo-card:hover {
  border-color: var(--accent-deep);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(159, 122, 234, 0.12);
}

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

.capitulo-card > * {
  position: relative;
  z-index: 1;
}

.cap-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-deep);
  line-height: 1;
}

.cap-titulo {
  font-size: 1rem;
  color: var(--txt);
  font-weight: 600;
  line-height: 1.3;
}

.cap-desc {
  font-size: 0.85rem;
  color: var(--txt-muted);
  font-weight: 300;
  line-height: 1.4;
}

/* TABLA DE ESTADO */
#framework-estado {
  background: linear-gradient(135deg, rgba(159, 122, 234, 0.02), transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.estado-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}

.estado-table {
  width: 100%;
  border-collapse: collapse;
}

.estado-table thead {
  background: linear-gradient(135deg, rgba(159, 122, 234, 0.08), rgba(88, 166, 255, 0.04));
  border-bottom: 1px solid var(--border);
}

.estado-table th {
  padding: 1.2rem 1.5rem;
  text-align: left;
  font-weight: 600;
  color: var(--txt);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.estado-table td {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--txt-muted);
  font-size: 0.92rem;
}

.estado-table td:first-child {
  color: var(--txt);
}

.estado-table tbody tr {
  transition: background 0.2s;
}

.estado-table tbody tr:hover {
  background: rgba(159, 122, 234, 0.04);
}

.estado-table tbody tr:hover td {
  color: var(--txt);
}

/* SECCIONES DE VOLÚMENES */
#volumen-i,
#volumen-ii {
  border-top: 1px solid var(--border);
}

#volumen-i {
  background: linear-gradient(135deg, rgba(159, 122, 234, 0.03), transparent);
}

#volumen-i .columna:first-child,
#volumen-ii .columna:last-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* CARDS DE CARACTERÍSTICAS */
#volumen-i .columna:last-child > div,
#volumen-ii .columna:first-child > div {
  background: var(--bg-card);
  border: 1px solid var(--accent-deep-border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

#volumen-i .columna:last-child > div::before,
#volumen-ii .columna:first-child > div::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 0%, rgba(159, 122, 234, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

#volumen-i .columna:last-child > div:hover,
#volumen-ii .columna:first-child > div:hover {
  border-color: var(--accent-deep);
  box-shadow: 0 8px 24px rgba(159, 122, 234, 0.12);
}

#volumen-i .columna:last-child > div:hover::before,
#volumen-ii .columna:first-child > div:hover::before {
  opacity: 1;
}

#volumen-i .columna:last-child > div h3,
#volumen-ii .columna:first-child > div h3 {
  position: relative;
  z-index: 1;
}

#volumen-i .columna:last-child > div ul,
#volumen-ii .columna:first-child > div ul {
  position: relative;
  z-index: 1;
}

#volumen-i .columna:last-child > div ul li,
#volumen-ii .columna:first-child > div ul li {
  color: var(--txt-muted);
  font-size: 0.9rem;
}

/* SECCIÓN DE AUDIENCIAS */
#framework-para-quien {
  background: linear-gradient(135deg, rgba(159, 122, 234, 0.02), transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.tres-columnas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

#framework-para-quien .tres-columnas > div {
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

#framework-para-quien .tres-columnas > div::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 40% 40% at 50% 0%, rgba(159, 122, 234, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

#framework-para-quien .tres-columnas > div:hover {
  border-color: var(--accent-deep);
  box-shadow: 0 8px 24px rgba(159, 122, 234, 0.12);
  transform: translateY(-4px);
}

#framework-para-quien .tres-columnas > div:hover::before {
  opacity: 1;
}

#framework-para-quien .tres-columnas > div > * {
  position: relative;
  z-index: 1;
}

/* SECCIÓN COLABORAR */
#colaborar {
  background: linear-gradient(135deg, rgba(159, 122, 234, 0.02), transparent);
  border-top: 1px solid var(--border);
}

/* FOOTER CUSTOMIZADO */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

footer p {
  color: var(--txt-muted);
}

footer a {
  color: var(--accent-deep);
  transition: color 0.2s;
  position: relative;
}

footer a:hover {
  color: #b596d4;
}

/* ANIMACIONES DE ENTRADA */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-label {
  animation: fadeInUp 0.6s var(--ease-out) backwards;
  animation-delay: 0.1s;
}

.section-title {
  animation: fadeInUp 0.6s var(--ease-out) backwards;
  animation-delay: 0.2s;
}

.section-sub {
  animation: fadeInUp 0.6s var(--ease-out) backwards;
  animation-delay: 0.3s;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .indice-grid {
    grid-template-columns: 1fr;
  }

  .tres-columnas {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .estado-table {
    font-size: 0.85rem;
  }

  .estado-table th,
  .estado-table td {
    padding: 0.8rem 1rem;
  }
}
