/* ============================================
   COURSE INDEX - Estilos
   Vista de índice completo del curso
   Versión: 1.0 | Enero 2026
   ============================================ */

/* === BOTÓN TRIGGER === */
.ci-trigger {
  background: var(--bg-card, #1a1a24);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ci-trigger:hover {
  background: var(--bg-secondary, #12121a);
  border-color: var(--accent-blue, #4488ff);
}

/* === MODAL === */
.ci-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ci-modal.open {
  opacity: 1;
  visibility: visible;
}

/* === OVERLAY === */
.ci-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* === CONTENT === */
.ci-content {
  position: relative;
  background: var(--bg-secondary, #12121a);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.ci-modal.open .ci-content {
  transform: translateY(0);
}

/* === HEADER === */
.ci-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border, #2a2a3a);
}

.ci-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #f0f0f5);
  margin: 0;
}

.ci-close {
  background: none;
  border: none;
  color: var(--text-secondary, #8888a0);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.ci-close:hover {
  background: var(--bg-card, #1a1a24);
  color: var(--text-primary, #f0f0f5);
}

/* === BODY === */
.ci-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* === MODULE === */
.ci-module {
  background: var(--bg-card, #1a1a24);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border, #2a2a3a);
}

.ci-module.complete {
  border-color: var(--accent-green, #00d4aa);
}

.ci-module-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ci-module-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ci-module-icon {
  font-size: 1.5rem;
}

.ci-module-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ci-module-num {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-secondary, #8888a0);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ci-module-title {
  font-weight: 600;
  color: var(--text-primary, #f0f0f5);
}

.ci-module-status {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary, #8888a0);
  background: var(--bg-primary, #0a0a0f);
  padding: 4px 8px;
  border-radius: 4px;
}

.ci-module-arrow {
  color: var(--text-secondary, #8888a0);
  transition: transform 0.2s ease;
}

/* === LESSONS === */
.ci-lessons {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--bg-primary, #0a0a0f);
}

.ci-lessons.open {
  max-height: 500px;
}

.ci-module-header:has(+ .ci-lessons.open) .ci-module-arrow {
  transform: rotate(180deg);
}

.ci-lesson {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border, #2a2a3a);
  transition: background 0.2s ease;
}

.ci-lesson:last-child {
  border-bottom: none;
}

.ci-lesson:hover {
  background: var(--bg-card, #1a1a24);
}

.ci-lesson.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.ci-lesson.completed .ci-lesson-status {
  color: var(--accent-green, #00d4aa);
}

.ci-lesson.in_progress .ci-lesson-status {
  color: var(--accent-yellow, #ffcc00);
}

.ci-lesson-status {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
}

.ci-lesson-id {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent-blue, #4488ff);
  min-width: 30px;
}

.ci-lesson-title {
  flex: 1;
  color: var(--text-primary, #f0f0f5);
  font-size: 0.9rem;
}

.ci-lesson-phases {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-secondary, #8888a0);
}

/* === FOOTER === */
.ci-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border, #2a2a3a);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ci-progress {
  flex: 1;
  height: 6px;
  background: var(--bg-card, #1a1a24);
  border-radius: 3px;
  overflow: hidden;
}

.ci-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green, #00d4aa), var(--accent-blue, #4488ff));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.ci-progress-text {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary, #8888a0);
  min-width: 100px;
  text-align: right;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .ci-content {
    width: 95%;
    max-height: 90vh;
    border-radius: 12px;
  }
  
  .ci-module-header {
    padding: 0.75rem;
  }
  
  .ci-lesson {
    padding: 0.5rem 0.75rem;
  }
  
  .ci-lesson-phases {
    display: none;
  }
}
