/* ========== featured-images ========== */
.aspect-wrapper {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

.aspect-ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: #ddd;
}

.aspect-ratio img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ========== Single Anime ========== */
#anime-single,
.anime-info {
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
  font-family: system-ui, sans-serif;
}

#anime-single h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111827;
}
@media (min-width: 768px) {
  #anime-single h1 {
    font-size: 2.25rem;
  }
}

#anime-single p.italic {
  color: #6B7280;
  font-style: italic;
}

#anime-single ul li strong,
.anime-meta-list strong {
  font-weight: 600;
  color: #333;
}

#anime-single .badge {
  background-color: #DBEAFE;
  color: #1D4ED8;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  margin: 0.25rem 0.25rem 0 0;
}
#anime-single .badge-studio {
  background-color: #E9D5FF;
  color: #7C3AED;
}

#anime-single .watch-now {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: #DC2626;
  color: white;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  margin-top: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s ease;
}
#anime-single .watch-now:hover {
  background-color: #B91C1C;
}

#anime-single .prose {
  line-height: 1.7;
  color: #374151;
  margin-top: 2rem;
}

.watch-single,
.img-single {
  display: flex;
  justify-content: center;
  align-items: center;
  height: auto;
}
.watch-single {
  margin-top: 1rem;
  text-align: center;
}

#anime-single .img-fluid {
  max-width: 40%;
}
@media (min-width: 768px) {
  #anime-single .img-fluid {
    max-width: 80%;
  }
  .episode-img{
    max-width: 40%;
  }
}

#anime-single .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
#anime-single .md\\:col-span-1 {
  max-width: 100%;
}
@media (min-width: 768px) {
  #anime-single .grid {
    grid-template-columns: 1fr 3fr;
  }
}

.anime-meta-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 30px;
  padding: 0;
  margin: 20px 0;
  list-style: none;
}
@media (min-width: 768px) {
  .anime-meta-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
.anime-meta-list li {
  display: flex;
  gap: 6px;
  line-height: 1.5;
  font-size: 15px;
}

.synopsis-single {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  transition: background 0.3s;
}
.synopsis-single h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  border-left: 4px solid #00bcd4;
  padding-left: 10px;
  font-weight: 600;
  color: #222;
}

.synopsis-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
  max-height: 220px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.4s ease;
}
.synopsis-content::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #f9f9f9);
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.synopsis-content.expanded {
  max-height: 1000px;
}
.synopsis-content.expanded::after {
  opacity: 0;
}

.synopsis-toggle {
  display: inline-block;
  margin-top: 1rem;
  background: #00bcd4;
  color: white;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s;
}
.synopsis-toggle:hover {
  background: #0097a7;
}

.bookmark-button {
  margin: 12px 0;
  padding: 8px 14px;
  background: #0073aa;
  color: #fff;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
}
.bookmark-button.bookmarked {
  background: #ff9800;
}
.bookmark-button:hover {
  background: #005c88;
}
.bookmark-icon {
  fill: currentColor;
  transition: fill 0.3s;
}
.bookmark-label {
  font-weight: 500;
}

/* ========== Episode single Post ========== */
.episode-wrapper {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.series-header {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}
.series-header img {
  width: 60px;
  height: 60px !important;
  object-fit: cover;
  border-radius: 50% !important;
  margin-right: 1rem;
}
.series-header h3 {
  margin: 0;
  font-size: 1.2rem;
}
.series-header span {
  font-size: 0.95rem;
  color: #6b7280;
}

#episode-search {
  width: 100%;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.episode-list img {
  border-radius: 2px !important;
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
}

.episode-card {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  transition: background 0.3s, transform 0.3s;
  overflow: hidden;
  text-decoration: none;
  color: #111827;
}
.episode-card:hover {
  background: #f3f4f6;
  transform: translateY(-2px);
}
.episode-card.current {
  background-color: #e0f2fe;
  border-left: 4px solid #3b82f6;
}
.episode-card img {
  flex-shrink: 0;
  width: 130px;
  max-width: 30%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 1rem;
}
.episode-card:hover img {
  border-color: #f59e0b !important;
}
.episode-info {
  flex-grow: 1;
}
.episode-info h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.episode-info p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}
.episode-card .play-icon {
  font-size: 1.5rem;
  color: #3b82f6;
  margin-left: auto;
  align-self: center;
}

#episode-list {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 5px;
}
#episode-list::-webkit-scrollbar {
  width: 6px;
}
#episode-list::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}

.episode-thumb {
  position: relative;
  width: 130px;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  margin-right: 1rem;
}
.episode-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.ep-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  pointer-events: none;
}
.ep-overlay .play-icon {
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
  .episode-card {
    flex-direction: row;
    align-items: center;
  }
  .episode-card img {
    width: auto;
    max-width: 25%;
    margin: 0 1rem 0 0;
  }
  .episode-info {
    flex: 1;
  }
  .episode-card .play-icon {
    width: 90%;
  }
}

/* ========== Bookmark Page ========== */
.bookmark-container {
    width: 70%;
}
/* Container */
.bookmark-wrapper {
  max-width: 960px;
  margin: 20px auto;
  padding: 0 15px;
  overflow-x: auto;
}

/* Heading */
.bookmark-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 20px;
}

.bookmark-heading i {
  color: gold;
  margin-right: 5px;
}

.clear-bookmark-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s ease-in-out;
}

.clear-bookmark-btn:hover {
  background: #b02a37;
}

/* Table */
.bookmark-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.bookmark-table thead {
  background: #222;
  color: white;
  text-align: left;
}

.bookmark-table th,
.bookmark-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
  font-size: 14px;
}

.bookmark-table th {
  font-weight: 600;
}

.bookmark-table td {
  background-color: #fff;
}

.bookmark-table tr:last-child td {
  border-bottom: none;
}

/* Anime Title Cell */
.bookmark-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bookmark-title img {
  width: 45px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.bookmark-title a {
  font-weight: bold;
  font-size: 14px;
  color: #0056b3;
  text-decoration: none;
}

.bookmark-title a:hover {
  text-decoration: underline;
}

.bookmark-time {
  font-size: 12px;
  color: #666;
}

/* Status badge */
.badge-status {
  padding: 3px 8px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
  color: white;
  background-color: #28a745; /* green for ongoing */
}

.badge-status.completed {
  background-color: #6c757d;
}

/* Remove button */
.remove-bookmark-btn {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.remove-bookmark-btn:hover {
  background-color: #f1b0b7;
  color: #721c24;
}

.badge-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
  color: white;
  background-color: gray;
}
.badge-status.ongoing {
  background-color: #28a745;
}
.badge-status.completed {
  background-color: #dc3545;
}


/* Responsive */
@media (max-width: 600px) {
  .bookmark-table thead {
    display: none;
  }

  .bookmark-table, .bookmark-table tbody, .bookmark-table tr, .bookmark-table td {
    display: block;
    width: 100%;
  }

  .bookmark-table tr {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
  }

  .bookmark-table td {
    padding: 10px;
    text-align: right;
    position: relative;
  }

  .bookmark-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    font-weight: bold;
    text-align: left;
    color: #555;
  }
}

/* ========== Search Form ========== */
.live-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  width: 100%;
  max-width: 1200px;
  max-height: 400px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  display: none;
}

.live-search-results a {
  display: flex;
  padding: 10px;
  border-bottom: 1px solid #eee;
  color: #333;
  text-decoration: none;
}
.live-search-results a:hover {
  background: #f8f8f8;
}

.live-search-results img {
  width: 60px;
  height: auto;
  margin-right: 10px;
  border-radius: 3px;
}

.live-search-results .info {
  text-align: left;
}
.live-search-results .info h4 {
  font-size: 14px;
  margin: 0 0 5px;
  font-weight: 500;
}
.live-search-results .info small {
  font-size: 12px;
  color: #666;
  display: block;
  margin-top: 5px;
}

.live-search-results .no-results {
  padding: 12px;
  color: #777;
  text-align: center;
  font-style: italic;
}

#search-loading {
  min-height: 40px;
  visibility: hidden;
  padding: 10px;
  color: #777;
  font-style: italic;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#search-loading.active {
  visibility: visible;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .live-search-results {
    left: 50%;
    transform: translateX(-50%);
    width: 98vw;
    max-width: 500px;
  }
}


/* ========== user-profile ========== */
/* ========== Nickname, Badge, Rank ========== */
img.badge-icon {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain;
  border-radius: 0;
}

.nickname-mask-text {
  display: inline-block;
  font-weight: 700;
  font-size: 16px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none;
  line-height: 1.4;
  max-width: 100%;
  font-family: 'Parisienne', cursive;
}

.badge-text {
  font-family: cursive;
  font-weight: bold;
  font-style: italic;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

[class*="rank-"],
[class^="rank-"] {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.rank-commoner        { background-color: #898989; }
.rank-dou-fighter     { background-color: #d8a9d9; }
.rank-dou-master      { background-color: #a9d9cf; }
.rank-dou-grandmaster { background-color: #67ca60; }
.rank-dou-spirit      { background-color: #e0e719; }
.rank-dou-king        { background-color: #2bff03; }
.rank-dou-emperor     { background-color: #ff0303; }

.rank-dou-sect         { background-image: url('/wp-content/themes/generatepress-child/user-system/assets/gif/dou-sect.gif'); }
.rank-dou-venerate     { background-image: url('/wp-content/themes/generatepress-child/user-system/assets/gif/dou-venerate.gif'); }
.rank-dou-saint        { background-image: url('/wp-content/themes/generatepress-child/user-system/assets/gif/dou-saint.gif'); }
.rank-dou-god          { background-image: url('/wp-content/themes/generatepress-child/user-system/assets/gif/dou-god.gif'); }
.rank-heavenly-emperor { background-image: url('/wp-content/themes/generatepress-child/user-system/assets/gif/heavenly-emperor.gif'); }
.rank-admin            { background-image: url('/wp-content/themes/generatepress-child/user-system/assets/gif/admin.gif'); }

/* ========== VIP Offer Highlight ========== */
.vip-offer-highlight {
  display: inline-block;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 10px;
  background-color: #e9f5ff;
  color: #007bff;
  border: 1px solid #80bdff;
  text-decoration: none;
  animation: pulseZoom 1.5s infinite ease-in-out;
  transition: all 0.3s ease;
}
.vip-offer-highlight:hover {
  background-color: rgba(0, 123, 255, 0.1);
  box-shadow: 0 0 12px rgba(0, 123, 255, 0.35);
  transform: scale(1.02);
}
body.dark-mode .vip-offer-highlight {
  background-color: rgba(255, 215, 0, 0.08);
  color: #ffdd33;
  border-color: rgba(255, 215, 0, 0.2);
}

/* ========== Avatar Styles ========== */
.avatar-wrapper {
  width: 48px;
  height: 48px;
  position: relative;
  flex-shrink: 0;
}
.avatar-wrapper img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: none!important;
}
.avatar-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%;
  height: 150%;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 2;
}

.avatar-select {
  width: 17%;
  border: 2px solid #007bff;
  transition: transform 0.2s ease;
}
.avatar-select:hover,
.avatar-selected {
  transform: scale(1.5);
  border: 3px solid;
  border-image: linear-gradient(45deg, #ff00cc, #3333ff) 1;
}
.avatar-selected {
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.avatar-rank {
  position: relative;
  width: 80px;
  height: 80px;
  display: inline-block;
}
.avatar-img {
  width: 100%!important;
  height: 100%!important;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  z-index: 1;
  position: relative;
}
.rank-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ========== VIP Badge / Button ========== */
.vip-label {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: linear-gradient(to bottom, #d2d8db, #a4b1b9);
  color: #fff;
  font-weight: bold;
  box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.1);
}

.upgrade-vip-btn {
  background: linear-gradient(45deg, #fcb045, #fd1d1d);
  border: none;
  border-radius: 10px;
}

/* ========== Comment Styles ========== */
.comment-actions {
  gap: 0.25rem !important;
  color: #555;
  font-size: 14px;
}

.comment-content-box {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 15px;
}
.comment-content-box.user-content {
  background: #eaf4ff;
  border: 1px solid #3498db;
  color: #333;
}
.comment-content-box.admin-content {
  background: #fff1f1;
  border: 1px solid #e74c3c;
  color: #b03b3b;
  font-weight: 500;
}
.comment-content-box p {
  margin-bottom: 0 !important;
}

.comment-admin,
.comment-user {
  border-radius: 8px;
}
.comment-admin {
  background: #fff7f7;
  border-left: 4px solid #e74c3c;
  padding: 12px;
  box-shadow: 0 2px 4px rgba(231, 76, 60, 0.1);
}
.comment-admin .nickname {
  color: #e74c3c;
  font-weight: bold;
}
.comment-user {
  background: #f8f9fa;
  border-left: 4px solid #3498db;
  padding: 5px;
}

.like-btn-wrap.reacted .like-button {
  background-color: #0d6efd;
  color: #fff;
}

.comment-children.mt-2 {
  margin-left: -35px;
}

/* ========== Emoji Reactions ========== */
.emoji-summary,
.emoji-summary-stacked {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  line-height: 1;
}

.emoji-icons {
  font-size: 18px;
  display: inline-block;
}

.emoji-count {
  font-size: 14px;
  color: #555;
  font-weight: bold;
}

.emoji-stack-wrap {
  display: flex;
  align-items: center;
  position: relative;
}
.emoji-icon-stack {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 50%;
  padding: 2px;
  width: 24px;
  height: 24px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-left: -8px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}
.emoji-icon-stack:first-child {
  margin-left: 0;
  z-index: 3;
}
.emoji-icon-stack:nth-child(2) {
  z-index: 2;
}
.emoji-icon-stack:nth-child(3) {
  z-index: 1;
}

/* ========== Animation ========== */
@keyframes pulseZoom {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ========== Frame Injection via PHP ========== */
<?php foreach ($vip_levels as $level): ?>
.frame-<?= $level ?>::after {
  background-image: url('/wp-content/themes/generatepress-child/user-system/assets/frames/<?= rawurlencode($level) ?>.png');
}
<?php endforeach; ?>


/* ========== User tabs ========== */
.nav-tabs-cs {
  width: 100%;
  padding: 0;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  border-bottom: 2px solid #dee2e6;
  overflow: hidden;
}

.nav-tabs .nav-item {
  flex: 1 0 25%;
  text-align: center;
  margin-bottom: -1px;
  border-right: 1px solid #dee2e6;
}
.nav-tabs .nav-item:last-child {
  border-right: none;
}

.nav-tabs .nav-link {
  display: block;
  padding: 12px 0;
  font-size: 1.1rem;
  font-weight: 600;
  background-color: #f8f9fa;
  color: #6c757d;
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
}
.nav-tabs .nav-link:hover {
  background-color: #e9ecef;
  color: #343a40;
}
.nav-tabs .nav-link.active {
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
  font-weight: 700;
}

@media (max-width: 767.98px) {
  .nav-tabs {
    border-bottom: none;
  }
  .nav-tabs .nav-item {
    flex: 1 1 50%;
    margin-bottom: 10px;
    border-right: none !important;
  }
  .nav-tabs .nav-link {
    font-size: 1rem;
    padding: 10px 0;
  }
}
