a {
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

.resource-container {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 16px 48px;
}

.resource-title {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.resource-cover img,
.preview-still img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 4px;
  background: #111;
}

.preview-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.preview-gallery .preview-still img {
  max-height: 240px;
  width: 100%;
}

.resource-description {
  margin: 16px 0;
  line-height: 1.6;
}

.media-panel {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 12px;
  margin: 20px 0;
}

.media-player {
  width: 100%;
  max-height: 540px;
  background: #000;
  display: block;
}

.player-status {
  color: #bbb;
  font-size: 0.85rem;
  margin: 10px 4px;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  cursor: pointer;
  background: #555;
  color: #fff;
  font-size: 0.95rem;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary { background: #2980b9; color: #fff; }
.btn-secondary { background: #16a085; color: #fff; }
.btn-buy { background: #c0392b; color: #fff; }

.owned-badge {
  align-self: center;
  color: #2ecc71;
  font-weight: 600;
}

.back-button {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 20px;
  background: #2c3e50;
  color: #fff !important;
  border-radius: 6px;
  text-decoration: none !important;
  font-weight: 600;
}

.back-button:hover {
  background: #1a252f;
  color: #fff !important;
}

.content-item {
  text-decoration: none !important;
  color: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-item .item-title,
.content-item .item-description,
.content-item .item-meta {
  color: inherit;
  text-decoration: none;
}

.content-item .item-description {
  opacity: 0.85;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-heading {
  margin-bottom: 16px;
  grid-column: 1 / -1;
}

.no-results {
  grid-column: 1 / -1;
  padding: 24px;
  color: #666;
}

.list-footer {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 24px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.pagination.always-on {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
}

.page-link {
  padding: 6px 12px;
  background: #3498db;
  color: #fff !important;
  border-radius: 4px;
  text-decoration: none !important;
}

.page-link.disabled {
  background: #bdc3c7;
  color: #fff !important;
  cursor: default;
}

.page-info {
  color: #555;
  font-size: 0.95rem;
}

.sort-bar.in-footer {
  display: flex;
  gap: 10px;
  margin: 0;
}

.sort-bar.in-footer a {
  padding: 6px 12px;
  border-radius: 4px;
  background: #ecf0f1;
  color: #2c3e50 !important;
  text-decoration: none !important;
}

.sort-bar.in-footer a.active {
  background: #2980b9;
  color: #fff !important;
  font-weight: 600;
}

/* Tag sidebar */
.tag-sidebar .sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.tag-sidebar .sidebar-section + .sidebar-section {
  margin-top: 22px;
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  border: none;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.tag-pill.tag-subject {
  background: #d6eaf8;
  color: #1a5276;
}

.tag-pill.tag-style {
  background: #f5e6ff;
  color: #6c3483;
}

.tag-pill.selected {
  box-shadow: 0 0 0 2px currentColor;
  font-weight: 700;
  transform: translateY(-1px);
}

.tag-hint {
  color: #95a5a6;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }

  .list-footer {
    flex-direction: column;
    align-items: stretch;
  }
}
