/* Program Grid Styles */
.program-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(5, 1fr);
  margin: 40px 0;
  opacity: 1;
  transform: translateY(0);
}

.program-card {
  background: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  cursor: default;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 140px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
  transform: translateY(30px);
}

/* Clean fade-in animation */
.program-card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Lazy loading placeholder */
.program-card.lazy-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}


.program-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Mobile touch interactions */
@media (max-width: 767px) {
  .program-card:active {
    transform: translateY(-2px) scale(0.98);
    transition: all 0.1s ease;
  }
}

.program-card:hover .program-icon img {
  transform: scale(1.08);
}

.program-icon {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  margin-bottom: 8px;
}

.program-icon img {
  width: auto;
  height: auto;
  min-width: 56px;
  min-height: 56px;
  max-width: 72px;
  max-height: 72px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.program-label {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  color: #333333;
  text-align: center;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 100%;
  flex-shrink: 0;
  min-height: 2.4em;
  word-wrap: break-word;
  hyphens: auto;
  margin-top: 4px;
}

/* Clickable "Lainnya" card styles */
.program-card.is-link {
  cursor: pointer;
  transition: all 0.2s ease;
}

.program-card.is-link:hover,
.program-card.is-link:focus {
  background: #007bff;
  color: #ffffff;
  transform: translateY(-6px);
  box-shadow: 0 15px 40px rgba(0, 123, 255, 0.3);
}

.program-card.is-link:hover .program-label,
.program-card.is-link:focus .program-label {
  color: #ffffff;
}

.program-card.is-link:hover .program-icon img,
.program-card.is-link:focus .program-icon img {
  filter: invert(1) brightness(100%);
  transform: scale(1.08);
}

.program-card.is-link:focus {
  outline: 3px solid rgba(0, 123, 255, 0.4);
  outline-offset: 2px;
}

/* Large tablet styles (992px - 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
  .program-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  
  .program-card {
    min-height: 140px;
    padding: 18px 14px;
  }
  
  .program-icon img {
    min-width: 52px;
    min-height: 52px;
    max-width: 64px;
    max-height: 64px;
  }
  
  .program-label {
    font-size: 13px;
    min-height: 2.6em;
  }
}

/* Medium tablet styles (768px - 991px) */
@media (max-width: 991px) and (min-width: 768px) {
  .program-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  
  .program-card {
    min-height: 135px;
    padding: 16px 12px;
  }
  
  .program-icon img {
    min-width: 50px;
    min-height: 50px;
    max-width: 60px;
    max-height: 60px;
  }
  
  .program-label {
    font-size: 12px;
    min-height: 2.4em;
  }
}

/* Large mobile styles (576px - 767px) */
@media (max-width: 767px) and (min-width: 576px) {
  .program-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 30px 0;
  }
  
  .program-card {
    min-height: 140px;
    max-height: 180px;
    padding: 16px 12px;
    justify-content: space-between;
    /* Use same simple animation as desktop */
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
  }
  
  .program-card.fade-in {
    opacity: 1;
    transform: translateY(0);
  }
  
  .program-icon {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
  }
  
  .program-icon img {
    min-width: 48px;
    min-height: 48px;
    max-width: 56px;
    max-height: 56px;
  }
  
  .program-label {
    font-size: 12px;
    min-height: 2.4em;
    flex-shrink: 0;
    line-height: 1.2;
    margin-top: 2px;
  }
}

/* Medium mobile styles (480px - 575px) */
@media (max-width: 575px) and (min-width: 480px) {
  .program-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 25px 0;
  }
  
  .program-card {
    min-height: 135px;
    max-height: 175px;
    padding: 14px 10px;
    justify-content: space-between;
    /* Use same simple animation as desktop */
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
  }
  
  .program-card.fade-in {
    opacity: 1;
    transform: translateY(0);
  }
  
  .program-icon {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
  }
  
  .program-icon img {
    min-width: 46px;
    min-height: 46px;
    max-width: 54px;
    max-height: 54px;
  }
  
  .program-label {
    font-size: 11px;
    min-height: 2.2em;
    flex-shrink: 0;
    line-height: 1.1;
    margin-top: 2px;
  }
}

/* Small mobile styles (360px - 479px) */
@media (max-width: 479px) and (min-width: 360px) {
  .program-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
  }
  
  .program-card {
    min-height: 130px;
    max-height: 170px;
    padding: 12px 8px;
    justify-content: space-between;
    /* Use same simple animation as desktop */
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
  }
  
  .program-card.fade-in {
    opacity: 1;
    transform: translateY(0);
  }
  
  .program-icon {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
  }
  
  .program-icon img {
    min-width: 44px;
    min-height: 44px;
    max-width: 52px;
    max-height: 52px;
  }
  
  .program-label {
    font-size: 10px;
    min-height: 2em;
    flex-shrink: 0;
    line-height: 1.1;
    margin-top: 2px;
  }
}

/* Extra small mobile (<360px) */
@media (max-width: 359px) {
  .program-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
  }
  
  .program-card {
    min-height: 125px;
    max-height: 165px;
    padding: 10px 6px;
    justify-content: space-between;
    /* Use same simple animation as desktop */
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
  }
  
  .program-card.fade-in {
    opacity: 1;
    transform: translateY(0);
  }
  
  .program-icon {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
  }
  
  .program-icon img {
    min-width: 40px;
    min-height: 40px;
    max-width: 48px;
    max-height: 48px;
  }
  
  .program-label {
    font-size: 9px;
    min-height: 1.8em;
    flex-shrink: 0;
    line-height: 1.0;
    margin-top: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .program-card,
  .program-icon img,
  .program-grid {
    transition: none;
    animation: none;
  }
  
  .program-card {
    opacity: 1;
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .program-card {
    border: 2px solid #000000;
  }
  
  .program-card.is-link:focus {
    outline: 4px solid #000000;
  }
}
