/* Base styles */
body {
  font-family: 'Noto Sans Tamil', sans-serif;
  background-color: #111;
  color: #eee;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Main program layout */
.programs-container {
  display: grid;
  grid-template-columns: repeat(1, 1fr); /* Default: 1 card per row */
  gap: 2rem;
  padding: 4rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Card style */
.program-card {
  width: 100%; /* fill grid cell */
  max-width: 350px; /* max width limit */
  height: 360px;
  background-color: #1c1c2b;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  text-align: center;
  padding: 1.5rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 0 auto; /* center card within grid cell */
}

.program-card:hover {
  transform: scale(1.08);
  box-shadow: 0 0 24px rgba(0, 255, 255, 0.5);
}

/* Program logo inside card */
.program-logo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
}

/* Program title */
.program-title {
  font-family: 'Orbitron', sans-serif;
  color: #fff;
  font-size: 1.4rem;
  font-weight: bold;
  margin-top: 0.5rem;
}

/* Modal popup */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 10, 10, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-in-out;
  padding: 1rem; /* Small padding so modal-content doesn't stick to edges */
  overflow-y: auto; /* Allow scrolling on small devices */
  box-sizing: border-box;
}

/* Modal content */
.modal-content {
  background-color: #2e2e3e;
  color: #fff;
  padding: 2rem 2.5rem;
  border-radius: 20px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh; /* Limit height to 90% of viewport */
  overflow-y: auto; /* Scroll inside modal content if needed */
  text-align: center;
  position: relative;
  box-shadow: 0 0 24px rgba(0, 255, 255, 0.4);
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Modal logo image */
.modal-logo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 16px;
  margin: 0 auto 1rem;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
  transition: transform 0.3s ease;
}

.modal-logo:hover {
  transform: scale(1.1) rotate(2deg);
}

/* Close button inside modal */
.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2.2rem;
  color: #ccc;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  line-height: 1;
  user-select: none;
  transition: color 0.2s ease;
  z-index: 1100;
  /* Increase hit area for touch */
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.close-btn:hover {
  color: #fff;
  background-color: rgba(0, 255, 255, 0.2);
}

/* Participant list styling */
.participant-list {
  margin-top: 1rem;
  text-align: left;
  font-size: 1rem;
  padding-left: 1.2rem;
  line-height: 1.6;
}

.participant-list li {
  margin: 0.3rem 0;
}

/* Modal fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive grid columns */
@media (min-width: 768px) {
  .programs-container {
    grid-template-columns: repeat(2, 1fr); /* Tablets: 2 per row */
  }
}

@media (min-width: 1024px) {
  .programs-container {
    grid-template-columns: repeat(3, 1fr); /* Desktop: 3 per row */
  }
}

/* Responsive modal content for very small devices */
@media (max-width: 480px) {
  .modal-content {
    padding: 1.5rem 1.8rem;
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 15px;
  }

  .modal-logo {
    width: 150px;
    height: 150px;
  }

  .close-btn {
    top: 10px;
    right: 15px;
    font-size: 2rem;
    width: 36px;
    height: 36px;
  }

  .participant-list {
    font-size: 0.9rem;
    padding-left: 1rem;
  }
}
