/* Container for the Text-to-4D grid */
#txt-to-4d-grid {
  margin-top: 32px;
}

/* Set buttons - same style as other grids */
.txt-to-4d-set-buttons {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

/* Shared button style */
.txt-to-4d-set-buttons button {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  background: #f5f5f5;
  font-size: 0.9rem;
}

.txt-to-4d-set-buttons button:hover {
  background: #e9e9e9;
}

.txt-to-4d-set-buttons .txt-to-4d-set-button.txt-to-4d-active {
  background: #ddd;
  font-weight: 600;
}

/* Table structure */
#txt-to-4d-grid .txt-to-4d-video-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Each set contains 2 rows */
#txt-to-4d-grid .txt-to-4d-video-set {
  display: none;
  flex-direction: column;
  gap: 12px;
}

#txt-to-4d-grid .txt-to-4d-video-set.txt-to-4d-active {
  display: flex;
}

/* 4 columns per row: Text, Video, Text, Video */
#txt-to-4d-grid .txt-to-4d-header-row,
#txt-to-4d-grid .txt-to-4d-video-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}

#txt-to-4d-grid .txt-to-4d-header-row {
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  border-bottom: 1px solid #ddd;
  padding-bottom: 6px;
  margin-bottom: 4px;
}

#txt-to-4d-grid .txt-to-4d-header-cell {
  padding: 4px 2px;
}

#txt-to-4d-grid .txt-to-4d-video-row .txt-to-4d-cell {
  background: #fdfdfd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Style for text prompts - centered, Comic Sans MS, no box */
#txt-to-4d-grid .txt-to-4d-prompt-box {
  width: 100%;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#txt-to-4d-grid .txt-to-4d-prompt-text {
  font-family: 'Comic Sans MS', 'Comic Sans', cursive, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  color: #2c3e50;
  text-align: center;
  line-height: 1.3;
  word-wrap: break-word;
}

/* Style for videos */
#txt-to-4d-grid video {
  width: 100%;
  display: block;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: #000;
}

/* Responsive: fall back to 2 columns on narrow screens */
@media (max-width: 900px) {
  #txt-to-4d-grid .txt-to-4d-header-row,
  #txt-to-4d-grid .txt-to-4d-video-row {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
  }

  #txt-to-4d-grid .txt-to-4d-prompt-box {
    min-height: 100px;
  }

  #txt-to-4d-grid .txt-to-4d-prompt-text {
    font-size: 1.2rem;
  }

  #txt-to-4d-grid .txt-to-4d-header-row::after {
    content: "Scroll horizontally on small screens.";
    grid-column: 1 / -1;
    font-size: 0.75rem;
    color: #888;
    margin-top: 4px;
  }
}
