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

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

/* Shared button style */
.mesh-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;
}

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

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

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

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

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

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

#mesh-to-4d-grid .mesh-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;
}

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

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

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

/* Optional: Add text prompts below videos */
#mesh-to-4d-grid .mesh-to-4d-prompt {
  font-family: 'Comic Sans MS', 'Comic Sans', cursive, sans-serif;
  font-size: 0.75rem;
  font-weight: bold;
  color: #2c3e50;
  margin-top: -2px;
  text-align: center;
}

/* Plus symbol between 3D mesh video and text */
#mesh-to-4d-grid .mesh-to-4d-plus {
  font-size: 1.5rem;
  font-weight: bold;
  color: #666;
  margin: 2px 0 0 0;
  line-height: 1;
  text-align: center;
}

/* Responsive: fall back to 2 columns on narrow screens */
@media (max-width: 900px) {

    #mesh-to-4d-grid .mesh-to-4d-header-row,
    #mesh-to-4d-grid .mesh-to-4d-video-row {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: auto;
    }

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