/* =============================================
   media.css — styles for media.html
   ============================================= */

/* --- page title --- */
.media-title-section {
  text-align: center;
}

.media-title-section h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.media-subtitle {
  font-size: 0.9rem;
  opacity: 0.7;
  margin: 0;
}


/* --- controls bar --- */
.media-controls {
  margin-bottom: 1.5rem;
}

.media-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-start;
}

.media-controls-label {
  font-size: 0.72rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.45;
  display: block;
  margin-bottom: 0.4rem;
}

.media-sort-group,
.media-jump-group,
.media-alter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* buttons sit directly in the group — lay them out horizontally */
.media-sort-group {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.media-sort-group .media-controls-label {
  margin-bottom: 0;
  margin-right: 0.25rem;
  white-space: nowrap;
}

/* sort buttons */
.media-sort-btn {
  background: transparent;
  border: 1px solid #e0c8d8;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
  display: inline-block;
}

.media-sort-btn:hover {
  background: #fff0f7;
}

.media-sort-btn.active {
  background: #ffd6ea;
  border-color: #ffd6ea;
  font-weight: bold;
}

/* jump links */
.media-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.media-jump-link {
  font-size: 0.78rem;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: 1px solid #e0c8d8;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  transition: background 0.15s;
}

.media-jump-link:hover {
  background: #fff0f7;
}


/* --- log sections --- */
#media-log-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 3rem;
}

/* each section card needs explicit white in case .card gets overridden */
#media-log-container .card {
  background: white;
}

.media-section {
  /* inherits .card */
  background: white !important;
}

.media-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.media-section-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.media-section-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  opacity: 0.5;
}

.media-avg {
  color: #c8860a;
  opacity: 0.8 !important;
}


/* --- table --- */
.media-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.media-table thead th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.45;
  padding: 0 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  font-weight: bold;
}

.media-table tbody tr {
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background 0.1s;
}

.media-table tbody tr:last-child {
  border-bottom: none;
}

.media-table tbody tr:hover {
  background: rgba(255, 214, 234, 0.15);
}

.media-table td {
  padding: 0.6rem 0.5rem;
  vertical-align: middle;
}


/* --- column widths --- */
.media-col-title    { width: auto; }
.media-col-status   { width: 100px; white-space: nowrap; }
.media-col-score    { width: 90px; white-space: nowrap; }
.media-col-date     { width: 110px; white-space: nowrap; }
.media-col-watchers { width: 110px; }


/* --- title cell --- */
.media-title {
  display: block;
  font-weight: bold;
  line-height: 1.3;
}

.media-notes {
  display: block;
  font-size: 0.76rem;
  opacity: 0.55;
  margin-top: 0.15rem;
  line-height: 1.4;
  font-style: italic;
}


/* --- status badge --- */
.media-status {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: bold;
  text-transform: lowercase;
}

.media-status-finished      { background: #d4edda; color: #2d6a3f; }
.media-status-watching,
.media-status-in-progress   { background: #cce5ff; color: #1a4f7a; }
.media-status-dropped       { background: #f8d7da; color: #721c24; }
.media-status-want-to-watch,
.media-status-want-to       { background: #fff3cd; color: #856404; }


/* --- stars --- */
.media-stars {
  color: #e8a020;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.media-no-score {
  opacity: 0.3;
}


/* --- date --- */
.media-ongoing {
  font-size: 0.75rem;
  opacity: 0.4;
  font-style: italic;
}


/* --- watcher avatars --- */
.media-watcher-group {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}

.media-watcher-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 0.15s;
}

.media-watcher-avatar:hover {
  transform: scale(1.2);
  z-index: 1;
  position: relative;
}

.media-watcher-unknown {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eee;
  border: 2px solid white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  opacity: 0.5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}


/* --- empty state --- */
.media-empty {
  font-size: 0.82rem;
  opacity: 0.45;
  font-style: italic;
  margin: 0.5rem 0;
}


/* --- responsive --- */
@media (max-width: 680px) {
  .media-col-date,
  .media-col-status { display: none; }

  .media-controls-row {
    flex-direction: column;
    gap: 0.75rem;
  }
}
/* ── alter filter bar ─────────────────────────────────────────── */
.media-controls-row + .media-controls-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.07);
}

.media-alter-group {
  width: 100%;
}

#media-alter-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

#media-alter-filter .filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #e0c8d8;
  background: transparent;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
  color: inherit;
}

#media-alter-filter .filter-btn img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

#media-alter-filter .filter-btn:hover {
  background: #fff0f7;
}

#media-alter-filter .filter-btn.active {
  background: #ffd6ea;
  border-color: #ffd6ea;
  font-weight: bold;
}