/* =====================================================================
   RESET / BASE
===================================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: #0B0C0E;
  color: #fff;
}

body {
  font-family: Arial, Helvetica, sans-serif;
}



/* =====================================================================
   HEADER
===================================================================== */

.site-header {
  min-height: 360px;
  padding: 20px 50px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: #0B0C0E;
  border-bottom: 2px solid #E50914;
}


.header-logo img {
  height: 320px;
  width: auto;
  display: block;
}


.header-search {
  width: 320px;
}


#searchInput {
  width: 100%;
  padding: 10px 14px;

  border: 1px solid #333;
  border-radius: 8px;

  background: #111;
  color: #fff;
  font-size: 14px;
}


#searchInput:focus {
  outline: none;
  border-color: #666;
}



/* =====================================================================
   PAGE LAYOUT
===================================================================== */

.page-layout {
  display: flex;
  gap: 32px;
  padding: 24px 50px 36px;
}


.main-content {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}



/* =====================================================================
   ACTOR SIDEBAR
===================================================================== */

.actor-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #111;
  border-radius: 14px;
  padding: 18px;
}


.actor-sidebar h2 {
  margin: 0 0 14px;
  font-size: 18px;
}


#actor-sort {
  width: 100%;
  margin-bottom: 14px;
}


.actor-link {
  display: block;
  padding: 8px 0;
  color: #ddd;
  text-decoration: none;
  font-size: 14px;
}


.actor-link:hover {
  color: #fff;
  text-decoration: underline;
}


.actor-count {
  margin-left: 8px;
  color: #999;
  font-size: 0.9em;
}



/* =====================================================================
   CONTROLS
===================================================================== */

#actor-sort,
#video-sort {
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: #222;
  color: #fff;
}


.video-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}


.video-toolbar label {
  color: #bbb;
  font-size: 14px;
}


#video-sort {
  min-width: 170px;
}



/* =====================================================================
   VIDEO GRID
===================================================================== */

#video-container {
  width: 100%;
}


.video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}


.video-card {
  overflow: hidden;
  cursor: pointer;
  background: #111;
  border-radius: 10px;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}


.video-card:hover {
  transform: scale(1.04);
  background: #181818;
  z-index: 2;
}



/* =====================================================================
  VIDEO THUMBNAIL
===================================================================== */

.thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1b1b1b;
}


.video-thumbnail {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}


.play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}


.video-card:hover .play-icon {
  opacity: 1;
}


.play-icon svg {
  width: 52px;
  height: 52px;
}



/* =====================================================================
   VIDEO INFO
===================================================================== */

.video-info {
  min-height: 76px;
  padding: 8px 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


.video-info h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  margin-top: 6px;
}


.video-views {
  color: #aaa;
  font-size: 12px;
  white-space: nowrap;
}


.video-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}


.tag-pill {
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}



/* =====================================================================
   EMPTY / ERROR STATES
===================================================================== */

.error,
.empty {
  grid-column: 1 / -1;
  color: #ccc;
  font-size: 16px;
}



/* =====================================================================
   MODAL
===================================================================== */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
}


.modal.open {
  display: flex;
}


.modal-content {
  position: relative;
  width: 85vw;
  max-width: 1100px;
  aspect-ratio: 16 / 9;
}


.modal-content video {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}


.close-button {
  position: absolute;
  top: -46px;
  right: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
}



/* =====================================================================
   RESPONSIVE
===================================================================== */

@media (max-width: 1200px) {
  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


@media (max-width: 800px) {
  .site-header {
    padding-left: 24px;
    padding-right: 24px;
  }

  .header-logo img {
    height: 220px;
  }

  .header-search {
    width: 240px;
  }

  .page-layout {
    padding-left: 24px;
    padding-right: 24px;
  }

  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


@media (max-width: 520px) {
  .site-header {
    min-height: auto;
    flex-direction: column;
    gap: 18px;
  }

  .header-logo img {
    height: 140px;
  }

  .header-search {
    width: 100%;
  }

  .page-layout {
    gap: 18px;
    padding: 20px 16px;
  }

  .actor-sidebar {
    width: 180px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }
}
