/* ======================== */
/* Reset cơ bản và font */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  min-height: 100vh;
}

/* ======================== */
/* Container chính */
.container {
  display: flex;
  height: 100vh;
  flex-wrap: nowrap;
}

/* ======================== */
/* Sidebar bên trái */
.sidebar {
  width: 20%;
  background: rgba(247, 247, 247, 1);
  padding: 20px 0;
}

.sidebar ul {
  list-style: none;
  padding: 30px 0;
}

.sidebar li {
  margin: 0;
  text-align: center;
  padding: 30px 0;
  height: 40px;
  display: flex;            
  justify-content: center;   
  align-items: center;      
}

.sidebar li:hover {
  background-color: #ccc;
}

.sidebar a {
  color: #000;
  text-decoration: none;
  font-size: 18px;
}

/* ======================== */
/* Content bên phải */
.content {
  width: 80%;
  background: #dbdada;
  padding: 20px;
  padding-top: 60px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  overflow-y: auto;
}

/* ======================== */
/* Card video */
.video-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  max-height: 300px;
}

.video-card:hover {
  transform: scale(1.03);
}

.video-card img {
  width: 100%;
  aspect-ratio: 16 / 9; /* giữ tỷ lệ video */
  object-fit: cover; /* tránh méo hình */
  display: block;
}

.video-card a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  /* flex-grow: 1; */
}

.video-card h3 {
  padding: 10px;
  font-size: 16px;
  color: #333;
  line-height: 1.2;
  flex-shrink: 0; /* không bị co chữ */
}

/* ======================== */
/* Iframe video responsive */
iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
}

.thumbnail-wrapper {
    position: relative;
    display: inline-block;
}

.thumbnail-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

.thumbnail-wrapper .duration {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 2px 5px;
    font-size: 12px;
    border-radius: 3px;
    font-weight: 700;
}


/* ======================== */
/* Media Queries */
/* Tablet: từ 769px đến 1024px */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 25%;
  }
  .content {
    width: 75%;
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile: từ 481px đến 768px */
@media only screen and (min-width: 481px) and (max-width: 768px) {
  .container {
    flex-direction: column; /* Sidebar trên, content dưới */
  }

  .sidebar {
    width: 100%;
    order: 1;
  }

  .sidebar ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
  }

  .sidebar li {
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    height: auto;
    flex: 1;
    text-align: center;
  }

  .content {
    width: 100%;
    order: 2;
    grid-template-columns: 1fr; /* 1 video 1 hàng */
  }
}

/* Mobile nhỏ: từ 0px đến 480px */
@media only screen and (max-width: 480px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    order: 1;
  }

  .sidebar ul {
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
  }

  .sidebar li {
    font-size: 9px;
    padding: 6px;
    font-weight: 600;
    flex: 1;
    text-align: center;
  }

  .content {
    width: 100%;
    order: 2;
    grid-template-columns: 1fr; /* 1 video 1 hàng */
  }
}
