/* =================================================================
   Kima Academy - Enhanced Flowchart Styles
   ================================================================= */

/* Container */
.kima-program-flowchart {
  position: relative;
  overflow: hidden;
}

.kima-program-flowchart::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(0, 97, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.flowchart-container {
  position: relative;
  z-index: 1;
}

/* Node Styles */
.flowchart-node {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
  border: 2px solid #e1e8f0;
  border-radius: 16px;
  padding: 28px 24px;
  min-height: 160px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flowchart-node::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 97, 255, 0.08), transparent);
  transition: left 0.5s;
}

.flowchart-node:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: #0061ff;
  box-shadow: 0 16px 48px rgba(0, 97, 255, 0.15);
}

.flowchart-node:hover::before {
  left: 100%;
}

.flowchart-node:active {
  transform: translateY(-6px) scale(1.01);
}

.node-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0061ff 0%, #0051d5 100%);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 97, 255, 0.3);
  flex-shrink: 0;
}

.node-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0b1220;
  margin: 0 0 8px;
  line-height: 1.3;
}

.node-subtitle {
  font-size: 0.95rem;
  color: #5b667a;
  margin: 0;
  line-height: 1.5;
}

/* Arrows */
.flowchart-arrow {
  position: relative;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #0061ff 0%, #00a8ff 100%);
  margin: 0 20px;
  align-self: center;
  flex-shrink: 0;
}

.flowchart-arrow::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid #00a8ff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

@keyframes flow-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.flowchart-arrow {
  animation: flow-pulse 2s ease-in-out infinite;
}

.flowchart-arrow-down {
  position: relative;
  width: 4px;
  height: 60px;
  background: linear-gradient(180deg, #0061ff 0%, #00a8ff 100%);
  margin: 20px auto;
  flex-shrink: 0;
}

.flowchart-arrow-down::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-top: 12px solid #00a8ff;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

/* Multi-track Card embedded */
.multitrack-card-wrapper {
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  border: 2px solid #e1e8f0;
  border-radius: 16px;
  padding: 32px;
  margin: 32px 0;
}

.multitrack-card-wrapper h3 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #0b1220;
  margin: 0 0 32px;
}

.multitrack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.multitrack-item {
  text-align: center;
}

.multitrack-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: white;
  border: 2px solid #e1e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.multitrack-icon i {
  font-size: 1.75rem;
  color: #0061ff;
}

.multitrack-item h5 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0b1220;
  margin: 0 0 8px;
}

.multitrack-item p {
  font-size: 0.9rem;
  color: #5b667a;
  margin: 0;
  line-height: 1.6;
}

/* Desktop Layout */
@media (min-width: 1024px) {
  .flowchart-container {
    max-width: 1200px;
    margin: 0 auto;
  }

  .flowchart-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
  }

  .flowchart-row .flowchart-node {
    flex: 0 1 320px;
  }
}

/* Tablet Layout */
@media (min-width: 768px) and (max-width: 1023px) {
  .flowchart-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }

  .flowchart-row:first-child .flowchart-node:last-child {
    grid-column: 3;
  }

  .flowchart-arrow {
    align-self: center;
  }

  .flowchart-node {
    min-height: 140px;
  }

  .multitrack-card-wrapper {
    grid-column: 1 / -1;
  }

  .multitrack-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Layout */
@media (max-width: 767px) {
  .flowchart-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .flowchart-arrow {
    width: 4px;
    height: 40px;
    margin: 0 auto;
    background: linear-gradient(180deg, #0061ff 0%, #00a8ff 100%);
  }

  .flowchart-arrow::after {
    bottom: -8px;
    top: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%) rotate(90deg);
    border-left: 12px solid #00a8ff;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
  }

  .flowchart-node {
    width: 100%;
    min-height: 120px;
    padding: 20px 16px;
  }

  .node-number {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .node-title {
    font-size: 1.1rem;
  }

  .node-subtitle {
    font-size: 0.9rem;
  }

  .multitrack-card-wrapper {
    padding: 24px 16px;
  }

  .multitrack-card-wrapper h3 {
    font-size: 1.35rem;
  }

  .multitrack-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Program Benefits Section (inside modals) */
.program-benefits-section {
  margin: 24px 0 32px;
  padding: 24px;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  border: 2px solid #e1e8f0;
  border-radius: 12px;
}

.program-benefits-section h4 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0b1220;
  margin: 0 0 24px;
}

.program-benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.program-benefit-item {
  text-align: center;
  padding: 16px 12px;
}

.program-benefit-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  background: white;
  border: 2px solid #e1e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.program-benefit-icon i {
  font-size: 1.5rem;
  color: #0061ff;
}

.program-benefit-item h5 {
  font-size: 1rem;
  font-weight: 700;
  color: #0b1220;
  margin: 0 0 6px;
  line-height: 1.3;
}

.program-benefit-item p {
  font-size: 0.875rem;
  color: #5b667a;
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 767px) {
  .program-benefits-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .program-benefits-section {
    padding: 20px 16px;
  }

  .program-benefits-section h4 {
    font-size: 1.25rem;
  }
}
