.preview-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.preview-container img,
.preview-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  transition: opacity 0.18s;
}
.preview-container video {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}
body {
  margin: 0;
  background: #0b0b0b;
  color: white;
  font-family: Arial, sans-serif;
}

header {
  background: #111;
  padding: 15px 30px;
  display: flex;
  align-items: center;
  gap: 20px;
}

h1 span {
  color: orange;
}

input[type="text"]#search {
  padding: 12px 16px;
  background: #181818;
  border: 1.5px solid #333;
  border-radius: 6px;
  color: #fff;
  font-size: 17px;
  margin-bottom: 18px;
  transition: border 0.2s;
  box-shadow: 0 2px 8px #0002;
}
input[type="text"]#search:focus {
  outline: none;
  border: 1.5px solid orange;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
  padding: 30px 20px 40px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.card {
  text-decoration: none;
  color: white;
  background: #181818;
  border-radius: 8px;
  box-shadow: 0 2px 12px #0003;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px) scale(1.025);
  box-shadow: 0 6px 24px #0005;
}

.card img {
  width: 100%;
  border-radius: 4px;
}

.card h3 {
  margin: 8px 0 2px;
  font-size: 16px;
}

.card p {
  color: #aaa;
  font-size: 14px;
}

.watch {
  padding: 20px;
}

video {
  width: 100%;
  max-height: 70vh;
  background: black;
}

.watch-layout {
  display: grid;
  grid-template-columns: 3fr 1.3fr;
  gap: 20px;
  padding: 20px;
}

.main-video video {
  width: 100%;
  background: black;
  border-radius: 6px;
}

.meta {
  color: #aaa;
  font-size: 14px;
}

.sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.sidebar h3 {
  margin-bottom: 10px;
}

.recommendations a {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  text-decoration: none;
  color: white;
}

.recommendations img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 4px;
}

.recommendations h4 {
  font-size: 14px;
  margin: 0;
}

/* Mobile */
@media (max-width: 900px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

/* Verbeterde mobiele ondersteuning */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 8px;
  }
  header h1 {
    font-size: 1.4em;
    text-align: center;
    margin-bottom: 6px;
  }
  #loginform,
  #accountname,
  #uploadbtn {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  #loginform {
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }
  #uploadbtn {
    width: 100%;
    margin-top: 6px;
    padding: 10px 0;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px 4vw 30px 4vw;
  }
  .card {
    font-size: 15px;
  }
  .main-video video {
    max-height: 40vh;
  }
  .sidebar {
    padding-top: 18px;
  }
  .recommendations img {
    width: 90px;
    height: 50px;
  }
  .recommendations h4 {
    font-size: 13px;
  }
  .preview-container {
    aspect-ratio: 16/9;
    min-height: 120px;
  }
  #uploadpopup {
    min-width: 0 !important;
    width: 96vw !important;
    left: 2vw !important;
    right: 2vw !important;
    padding: 18px 6vw !important;
    box-sizing: border-box;
  }
  #uploadform input,
  #uploadform button,
  #uploadform progress {
    font-size: 16px !important;
  }
  #uploadform input[type="text"] {
    min-width: 0;
    width: 100%;
  }
  #uploadform input[type="file"] {
    width: 100%;
  }
  #closeupload {
    width: 100%;
    margin-top: 10px;
  }
  .meta {
    font-size: 13px;
  }
  .main-video h2 {
    font-size: 1.1em;
    word-break: break-word;
  }
  .main-video {
    padding: 0 2vw;
  }
  .sidebar h3 {
    font-size: 1em;
  }
}

/* Extra: Zorg dat inputs en knoppen goed te bedienen zijn */
input, button, select, textarea {
  font-size: 16px;
}
