* {
  box-sizing: border-box;
}


body {
  margin: 0;

  font-family:
    Arial,
    "Noto Sans KR",
    sans-serif;

  background: #f5f5f5;

  color: #222;
}


/* ==========================================
   전체 Container
========================================== */

.container {
  width: 90%;

  max-width: 1200px;

  margin: 20px auto;
}


/* ==========================================
   Header
========================================== */

.page-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 30px;
}


.page-header h1 {
  margin: 0;
}


/* ==========================================
   동영상 목록
========================================== */

.video-list {

  display: grid;

  grid-template-columns:
    repeat(3, 1fr);

  gap: 30px;
}


/* ==========================================
   카드
========================================== */

.video-card {

  background: white;

  border-radius: 10px;

  overflow: hidden;

  padding-bottom: 20px;

  box-shadow:
    0 3px 12px
    rgba(0, 0, 0, 0.08);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}


.video-card:hover {

  transform:
    translateY(-3px);

  box-shadow:
    0 8px 20px
    rgba(0, 0, 0, 0.12);
}


/* ==========================================
   Thumbnail
========================================== */

.thumbnail-link {
  display: block;
}


.thumbnail-link img {

  display: block;

  width: 100%;

  aspect-ratio: 16 / 9;

  object-fit: cover;
}


/* ==========================================
   제목
========================================== */

.video-card h2 {

  font-size: 15px;

  line-height: 1.4;

  margin:
    15px 20px 10px;
}


/* ==========================================
   설명
========================================== */

.video-card p {
  font-size: 15px;
  margin:
    0 20px;

  color: #666;

  line-height: 1.6;
}


/* ==========================================
   Category
========================================== */

.category {

  display: inline-block;

  margin:
    15px 20px 0;

  padding:
    5px 10px;

  background: #eee;

  border-radius: 5px;

  font-size: 14px;
}


/* ==========================================
   관리자 페이지
========================================== */

.admin-container {

  max-width: 800px;
}


.video-form {

  background: white;

  padding: 35px;

  border-radius: 10px;

  box-shadow:
    0 3px 12px
    rgba(0, 0, 0, 0.08);
}


.form-group {

  margin-bottom: 25px;
}


.form-group label {

  display: block;

  margin-bottom: 8px;

  font-weight: bold;
}


.form-group input,
.form-group textarea {

  width: 100%;

  padding: 12px 14px;

  border:
    1px solid #ccc;

  border-radius: 5px;

  font-size: 16px;
}


.form-group textarea {

  resize: vertical;

}


/* ==========================================
   버튼
========================================== */

.form-buttons {

  display: flex;

  gap: 10px;

  margin-top: 30px;
}


.submit-button {

  border: none;

  padding:
    12px 20px;

  border-radius: 5px;

  background: #222;

  color: white;

  font-size: 16px;

  cursor: pointer;
}


.cancel-button,
.add-button,
.back-button {

  display: inline-block;

  padding:
    12px 20px;

  background: #eee;

  color: #222;

  text-decoration: none;

  border-radius: 5px;
}


.add-button {

  background: #222;

  color: white;
}


/* ==========================================
   Error
========================================== */

.error-message {

  margin-bottom: 20px;

  padding: 15px;

  background: #ffe5e5;

  color: #b00000;

  border-radius: 5px;
}


/* ==========================================
   데이터 없음
========================================== */

.empty-message {

  padding: 50px;

  text-align: center;

  background: white;

  border-radius: 10px;

  color: #777;
}


/* ==========================================
   YouTube Player
========================================== */

.youtube-player {

  width: 100%;

  aspect-ratio: 16 / 9;

  margin:
    25px 0;
}


.youtube-player iframe {

  width: 100%;

  height: 100%;

  border: none;
}


/* ==========================================
   상세 설명
========================================== */

.description {

  margin-top: 25px;

  font-size: 17px;

  line-height: 1.8;

  white-space: pre-line;

  background: white;

  padding: 25px;

  border-radius: 10px;
}


/* ==========================================
   모바일
========================================== */

@media (max-width: 768px) {

  .video-list {

    grid-template-columns: 1fr;

  }


  .container {

    width: 94%;

    margin:
      0px auto;

  }


  .page-header {

    flex-direction: column;

    align-items: flex-start;

    gap: 15px;

  }


  .video-form {

    padding: 20px;

  }

}
/* ==========================================
   Video Preview
========================================== */

.video-preview {
  position: relative;

  width: 100%;

  aspect-ratio: 16 / 9;

  overflow: hidden;

  cursor: pointer;

  background: #000;
}


/* Thumbnail */

.video-thumbnail {
  display: block;

  width: 100%;

  height: 100%;

  object-fit: cover;
}


/* Play Button */

.play-button {

  position: absolute;

  top: 50%;

  left: 50%;

  transform:
    translate(-50%, -50%);

  width: 70px;

  height: 50px;

  display: flex;

  align-items: center;

  justify-content: center;

  background: rgba(0, 0, 0, 0.75);

  color: white;

  font-size: 25px;

  border-radius: 12px;

  pointer-events: none;
}


/* iframe */

.video-preview iframe {

  display: block;

  width: 100%;

  height: 100%;

  border: none;
}

/* ==========================================
   제목
========================================== */

.video-card h2 {

  font-size: 12px;

  line-height: 1.0;

  margin:
    5px 20px 10px;
}


/* ==========================================
   설명
========================================== */

.video-card p {
  font-size: 12px;
  margin:
    0 20px;

  color: #666;

  line-height: 1.2;
}

.youtube-container {
    width: 100%;
    max-width: 840px;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
}

.youtube-container iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}
