/* ===============================
   POST PAGE STYLES
   Light mode (default)
=================================*/

/* Layout */
.post-container {
  display: flex;
  gap: 2rem;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #222;
  background-color: #f9f9f9;
  box-sizing: border-box;
}

/* Two-column layout (desktop) */
.layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 10px;
}

/* Main content */
.main {
  flex: 3;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-width: 0;
}

/* ===============================
   INFO CARD
=================================*/
.info-card {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  padding-top: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
  align-items: flex-start;
  flex-wrap: wrap;
}

.info-card img {
  width: 220px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.info-details {
  flex: 1;
  padding: 20px;
}

.info-details h2 {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 8px;
}

.info-details p {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
  font-size: 14px;
}

.info-grid span {
  font-weight: bold;
  color: #444;
}

/* ===============================
   TAGS
=================================*/
.tags {
  margin-top: 0.75rem;
}

.tag {
  display: inline-block;
  background-color: #e0e7ff;
  color: #3730a3;
  padding: 0.25rem 0.6rem;
  margin: 0 0.3rem 0.3rem 0;
  border-radius: 12px;
  font-size: 0.85rem;
  cursor: default;
  user-select: none;
  white-space: nowrap;
}

/* ===============================
   RATING + ACTION BUTTONS
=================================*/
.rating-buttons {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.rating {
  font-size: 1.25rem;
  color: #f59e0b;
  font-weight: 700;
  user-select: none;
  white-space: nowrap;
}

.buttons {
  display: flex;
  gap: 10px;
}

.buttons button {
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: opacity 0.25s ease;
}

.buttons button:hover {
  opacity: 0.85;
}

.trailer-btn {
  background-color: #e50914;
  color: #fff;
}

.bookmark-btn {
  background-color: #6a1b9a;
  color: #fff;
}

/* ===============================
   SYNOPSIS
=================================*/
.synopsis {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.05);
}

.synopsis h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #1f2937;
}

.synopsis p {
  font-size: 1rem;
  line-height: 1.6;
  color: #4b5563;
  margin-top: 0.75rem;
}

/* ===============================
   SIDEBAR
=================================*/
.aside {
  width: 100%;
  margin-top: 1rem;
}

.aside-box {
  background: #fff;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.drama-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.aside-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
}

.aside-card img {
  width: 50px;
  height: 50px;
  border-radius: 10%;
  object-fit: cover;
}

.aside-info {
  flex: 1;
}

.view-btn {
  background: #6a0dad;
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.25s;
}

.view-btn:hover {
  background: #520a9e;
}

.view-btn.disabled {
  background: #aaa;
  pointer-events: none;
}

/* ===============================
   EPISODES
=================================*/
.episode-section {
  background: #111;
  color: #fff;
  border-radius: 8px;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.episode-header {
  display: flex;
  gap: 10px;
  background: #1a1a1a;
  padding: 15px;
  justify-content: space-between;
}

.episode-btn {
  flex: 1;
  background: #6a1b9a;
  padding: 12px;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.episode-btn:hover {
  background: #8e24aa;
}

.episode-btn span {
  display: block;
  font-size: 14px;
  opacity: 0.8;
}

.episode-btn strong {
  font-size: 18px;
}

.episode-table {
  width: 100%;
  padding-bottom: 12px;
}

.episode-row {
  display: grid;
  grid-template-columns: 60px 1fr 80px 160px 120px;
  padding: 12px 15px;
  border-top: 1px solid #333;
  align-items: center;
}

.episode-row.header {
  background: #222;
  font-weight: bold;
}

.episode-row:hover {
  background: rgba(255,255,255,0.05);
  cursor: pointer;
}

.col {
  padding: 4px 6px;
}

.col.date {
  font-size: 0.85rem;
  color: #aaa;
}

.sub-tag {
  display: inline-block;
  background: #f39c12;
  color: #000;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}



/* ===============================
   DOWNLOAD SLIDE PANEL
=================================*/
/* -- Download panel (hidden by default, animates open/close) -- */
.download-section {
  grid-column: 1 / -1;              /* span full row */
  max-height: 0;                    /* collapsed */
  opacity: 0;
  overflow: hidden;
  background: #1e1e1e;
  border-radius: 8px;
  margin-top: 8px;
  padding: 0 20px;                  /* horizontal padding while closed */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);

  /* grid layout for two rows: links + close button */
  display: grid;
  grid-template-rows: auto auto;
  gap: 20px;
  justify-items: center;            /* center everything */
  transition: max-height 0.36s ease, opacity 0.28s ease, padding 0.28s ease;
  pointer-events: none;             /* block pointer when closed */
}

/* open state */
.download-section.open {
  max-height: 420px;                /* large enough to show links */
  opacity: 1;
  padding: 20px;
  pointer-events: auto;
}

/* Row that holds the horizontal links */
.download-links {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;                  /* wrap on smaller widths */
  width: 100%;
  max-width: 700px;                 /* keeps the row compact on large screens */
}

/* link buttons */
.download-section a {
  padding: 10px 18px;
  background: #3ba7e6;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.22s ease, transform 0.16s ease;
}

.download-section a:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

/* close button centered in second row */
.download-section .close-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #ff6b6b;
  color: #ff6b6b;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  justify-self: center;             /* center in the grid column */
}

.download-section .close-btn:hover {
  background: #2a2a2a;
  color: #ff3b3b;
}

/* small screens: stack links vertically */
@media (max-width: 800px) {
  .download-links {
    flex-direction: column;
    align-items: center;
  }
  .download-section a {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
}


.download-btn{
  background-color: #2563eb; /* Green background */
  color: white;              /* White text */
  border: none;              /* Remove default border */
  padding: 12px 24px;        /* Some padding */
  font-size: 16px;           /* Font size */
  border-radius: 6px;        /* Rounded corners */
  cursor: pointer;           /* Pointer cursor on hover */
  transition: background-color 0.3s ease; /* Smooth hover transition */
  display: inline-block;     /* Inline-block for button size */
  text-align: center;        /* Center text */
  text-decoration: none;     /* Remove underline if used on a link */
}
.download-btn:hover {
  background-color: #1e40af; /* Darker green on hover */
}



/* ===============================
   DARK MODE
=================================*/
.dark .post-container,
.dark .episode-section {
  background: #121212;
  color: #e0e0e0;
}

.dark .info-card,
.dark .synopsis,
.dark .aside-box {
  background: #1e1e1e;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.7);
}

.dark .info-details h2,
.dark .synopsis h3,
.dark .aside-box h4,
.dark .col,
.dark .rating,
.dark .tag,
.dark .dropdown-content a,
.dark .close-btn {
  color: #e0e0e0;
}

.dark .info-details p,
.dark .synopsis p,
.dark .info-grid div,
.dark .col.date,
.dark .dropdown-content a {
  color: #b0b0b0;
}

.dark .tag {
  background-color: #3b82f6;
  color: #dbeafe;
}

.dark .buttons button,
.dark .download-btn {
  background-color: #2563eb;
  color: #e0e0e0;
}

.dark .buttons button:hover,
.dark .download-btn:hover {
  background-color: #1e40af;
}

.dark .trailer-btn {
  background-color: #4f46e5;
}

.dark .trailer-btn:hover {
  background-color: #3730a3;
}

.dark .bookmark-btn {
  background-color: #059669;
}

.dark .bookmark-btn:hover {
  background-color: #047857;
}

.dark .rating {
  color: #fbbf24;
}

.dark .info-grid div span {
  color: #a5b4fc;
}

.dark .episode-header {
  background: transparent;
}

.dark .episode-row.header {
  background: #374151;
  color: #d1d5db;
}

.dark .episode-row {
  border-bottom: 1px solid #4b5563;
}

.dark .sub-tag {
  background: #2563eb;
  color: #dbeafe;
}

.dark .dropdown-content {
  background: #1f2937;
  box-shadow: 0 4px 8px rgb(0 0 0 / 0.9);
}

.dark .dropdown-content a:hover {
  background: #2563eb;
  color: #e0e7ff;
}

.dark .close-btn {
  color: #9ca3af;
}

.dark .close-btn:hover {
  color: #60a5fa;
}

/* ===============================
   RESPONSIVE
=================================*/
@media (max-width: 900px) {
  .post-container {
    flex-direction: column;
    gap: 20px;
    padding: 1.2rem;
  }

  .main, .aside {
    flex: none;
    width: 100%;
  }

  .info-card {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 1.2rem;
  }

  .info-card img {
    width: 100%;
    max-width: 300px;
  }

  .info-details {
    width: 100%;
    padding: 10px 0;
  }
}

@media (max-width: 800px) {
  .episode-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    grid-template-areas:
      "ep title action"
      "date date date";
    gap: 10px;
    padding: 12px;
    margin: 10px 0;
    background: #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  }

  .episode-row.header {
    display: none;
  }

  .col:nth-child(1) { grid-area: ep; font-weight: 700; text-align: center; }
  .col:nth-child(2) { grid-area: title; overflow: hidden; text-overflow: ellipsis; }
  .col.date { grid-area: date; font-size: 0.75rem; color: #aaa; }
  .col.action { grid-area: action; text-align: right; }

  .download-btn {
    width: 100%;
    text-align: center;
  }

  .dropdown-content {
    left: 0;
    transform: none;
    width: 100%;
    max-width: 90vw;
  }
}

@media (max-width: 480px) {
  .episode-row {
    grid-template-columns: 30px 1fr auto;
    font-size: 0.85rem;
    gap: 8px;
  }

  .buttons button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .rating-buttons {
    justify-content: center;
    gap: 8px;
  }

  .rating {
    font-size: 1.1rem;
    margin-top: 4px;
  }

  .episode-btn {
    min-width: 110px;
    font-size: 0.9rem;
  }
}

/* ===============================
   ANIMATIONS
=================================*/
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(10%);
  }
}



.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
  gap: 10px;
}

.pagination a,
.pagination span {
  padding: 8px 14px;
  background: #222;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}

.pagination a:hover {
  background: #444;
}

.pagination .current {
  background: #e50914;
  font-weight: bold;
}
