body {
  font-family: sans-serif;
  background: #f8f9fa;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}




.main-container {
  width: 100%;
  max-width: 720px;
  padding: 6rem 1rem 2rem;
}


h1 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 2rem;
  color: white;
  margin: 0;
  padding: 1rem;
  background: #007bff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 999;
  transition: top 0.3s ease;
}

.video-card {
  background: white;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
@media screen and (max-width: 720px) {
    .clips-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
        margin-top: 1rem;
    }
}

.clips-grid img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 6px;
}


input[type='text'], input[type='number'] {
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}


form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: center;
  justify-content: space-between;
}

form label {
  font-size: 0.9rem;
  color: #444;
  margin-right: 0.3rem;
}

form input[type="text"],
form input[type="number"] {
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  flex: 1;
  min-width: 100px;
}


form button {
  background: #007bff;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease-in-out;
}



form button:hover:not(:disabled) {
  background: #0056b3;
  transform: scale(1.03);
}

.thumb-overlay {
  position: absolute;
  top: 4px;
  left: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 95%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.error-popup {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: #dc3545;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  display: none;
}

/* Thumb container sets positioning context and aspect ratio */
.thumb-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;     /* keep a consistent box */
}

/* Thumbnail fills container */
.video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin-bottom: 1rem;
}

/* The important bit: iframe overlays and fills the box */
.thumb-iframe {
    position: absolute;
    inset: 0;        /* top/right/bottom/left: 0 */
    width: 100%;
    height: 100%;
    border: 0;
    z-index: 3;      /* above image/overlay */
}

/* Flash popup */
.flash-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);  /* centers it horizontally and vertically */
    background: #f44336; /* red for error */
    color: #fff;
    padding: 14px 24px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    font-size: 16px;
    font-weight: 500;
    z-index: 9999;
    max-width: 80vw;
    text-align: center;
}