.trending-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 0 !important;
}

.trending-section * {
    visibility: visible !important;
}

/* Make cards visible */
.trending-card,
.trending-card-inner {
    display: block !important;
    visibility: visible !important;
}

.trending-section {
    padding-left:0px;
	padding-right:2px;
    margin-bottom: 3rem;
}
	
/* Tablet */
@media (max-width: 1024px) {
    .trending-section {
        padding-left: 0px;
        padding-right: 10px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .trending-section {
        padding-left: 10px;
        padding-right: 10px;
    }
}
/* ================================
   SECTION HEADER
================================ */
.trending-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.trending-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.trending-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--gradient-from), var(--gradient-to));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

/* Title Gradient Colors */
.from-violet-400 { --gradient-from: #8bfaaa; }
.to-violet-600 { --gradient-to: #1bbc3f; }
.from-purple-400 { --gradient-from: #c084fc; }
.to-purple-600 { --gradient-to: #9333ea; }
.from-green-400 { --gradient-from: #4ade80; }
.to-green-600 { --gradient-to: #16a34a; }
.from-red-400 { --gradient-from: #f87171; }
.to-red-600 { --gradient-to: #dc2626; }
.from-blue-400 { --gradient-from: #60a5fa; }
.to-blue-600 { --gradient-to: #2563eb; }
.from-cyan-400 { --gradient-from: #c9c9c9; }
.to-cyan-600 { --gradient-to: #e6e6e6; }
.from-yellow-400 { --gradient-from: #c9c9c9; }
.to-yellow-600 { --gradient-to: #e6e6e6; }
.from-orange-400 { --gradient-from: #fbdc3c; } /* ← ADD THIS */
.to-orange-600 { --gradient-to: #e5ea0c; }     /* ← ADD THIS */
			  
/* ================================
   NAVIGATION BUTTONS
================================ */
.trending-nav-buttons {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 1280px) {
    .trending-nav-buttons {
        display: flex;
    }
}

.trending-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trending-nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.trending-nav-primary {
    background: #3f85fe;
    color: white;
}

.trending-nav-primary:hover {
    background: #5558e3;
}

/* ================================
   CAROUSEL WRAPPER
================================ */
.trending-carousel-wrapper {
    position: relative;
}

.trending-scroll-container {
    display: flex;
    --card-gap: 8px;
    --cards-per-view: 5.5;
    --gaps-per-view: 4.5;
    gap: var(--card-gap);
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.trending-scroll-container::-webkit-scrollbar {
    display: none;
}

.trending-scroll-container .trending-card {
    width: calc((100% - (var(--gaps-per-view) * var(--card-gap))) / var(--cards-per-view));
    height: auto;
    max-width: none;
    max-height: none;
    aspect-ratio: 202 / 289;
}

@media (max-width: 1024px) {
    .trending-scroll-container {
        --cards-per-view: 4.5;
        --gaps-per-view: 3.5;
    }
}

@media (max-width: 768px) {
    .trending-scroll-container {
        --cards-per-view: 3.5;
        --gaps-per-view: 2.5;
    }
}

/* ================================
   TRENDING CARDS
================================ */
.trending-card {
    flex-shrink: 0;
    scroll-snap-align: start;
    position: relative;
    user-select: none;
    text-decoration: none;
}

.trending-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(26, 26, 26, 0.5);
}

/* ================================
   RANK BADGES
================================ */
.trending-rank {
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: white;
    z-index: 10;
    border-radius: 5px 0 5px 0;
    background: rgba(107, 114, 128, 0.9);
}

.trending-rank.rank-1 { background: rgba(239, 68, 68, 0.9); }
.trending-rank.rank-2 { background: rgba(249, 115, 22, 0.9); }
.trending-rank.rank-3 { background: rgba(234, 179, 8, 0.9); }

/* ================================
   CARD IMAGE
================================ */
/* ================================
   BOOKMARK BADGE
================================ */
.trending-bookmark-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: #22c55e;
}

.trending-bookmark-badge svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.latest-updates-bookmark-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: #22c55e;
}

.latest-updates-bookmark-badge svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}				
.history-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    z-index: 11;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}
.history-remove-btn:hover {
    background: rgba(220, 38, 38, 0.8);
    transform: scale(1.1);
}
.history-remove-btn:active {
    transform: scale(0.95);
}
.trending-card-img {
    width: 100%;
    height: 100%;
    max-height: 600px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.trending-card:hover .trending-card-img {
    transform: scale(1.05);
}

/* ================================
   CARD OVERLAY
================================ */
.trending-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}

.trending-card-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 96px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9),
        rgba(0, 0, 0, 0.6),
        transparent
    );
}

.trending-card-info {
    position: relative;
    z-index: 10;
    padding: 12px;
    width: 100%;
    text-align: left;  /* ✅ Add this */
}

.trending-card-title {
    font-size: 14px;
    font-weight: 700;
    color: white;
    text-align: left;  /* ✅ Change from center to left */
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* ================================
   FADE GRADIENT (RIGHT EDGE)
================================ */
.trending-fade-gradient {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 16px;
    width: 64px;
    pointer-events: none;
}

/* ================================
   RESPONSIVE DESIGN
================================ */
/* ================================
   RATING BADGE
================================ */
.trending-card-rating {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2px 6px;
    gap: 4px;
    margin-bottom: 4px;
}

.trending-card-rating svg {
    width: 16px;
    height: 16px;
    fill: #F4B83C;
    color: #F4B83C;
}

.trending-card-rating span {
    color: white;
    font-weight: 510;
    font-size: 12px;
    line-height: 1.75em;
}

/* ================================
   RESPONSIVE DESIGN
================================ */
@media (max-width: 768px) {
    .trending-rank {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }

    .trending-card-title {
        font-size: 13px;
    }
}
/* ================================
   GRID LAYOUT FOR LATEST UPDATES
/* GRID */
.trending-grid-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .trending-grid-container {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .trending-grid-container {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* CARD WRAPPER */
.trending-grid-container .followed-card-wrapper {
    width: 100%;
}

/* CARD */
.trending-grid-container .followed-card {
    width: 100%;
    aspect-ratio: 3 / 4;   /* 🔥 THIS is the key */
    height: auto;
    position: relative;
    overflow: hidden;
}

/* IMAGE */
.trending-grid-container .followed-card-img {
    width: 100%;
    height: 100%;
    max-height: 600px;
    object-fit: cover;
    display: block;
}

/* ================================
   FOLLOWED COMICS SECTION
================================ */
.followed-card-wrapper {
    flex-shrink: 0;
    position: relative;
}

.followed-card {
    display: block;
    width: 100%;
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    text-decoration: none;
}

.trending-scroll-container .followed-card-wrapper {
    width: calc((100% - (var(--gaps-per-view) * var(--card-gap))) / var(--cards-per-view));
}

.trending-scroll-container .followed-card {
    height: auto;
    aspect-ratio: 179 / 242;
}

.followed-card-img {
    width: 100%;
    height: 100%;
    max-height: 600px;
    object-fit: cover;
    object-position: center;
    transition: filter 0.3s ease;
}
.followed-card-flag {
    position: absolute;
    width: 26.33px;
    height: 20px;
    z-index: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}										 

.followed-card:active .followed-card-img {
    filter: brightness(0.75);
}

.followed-card-info {
    margin-top: 0.005rem;
    padding: 0.005rem;
}

.followed-chapter-link {
    display: block;
    padding: 0.25rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.followed-chapter-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.followed-chapter {
    font-size: 0.875rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.followed-time {
    line-height: 0.8;
	font-size: 0.875rem;
    color: #9ca3af;
}

.followed-title {
    font-size: 0.95rem;
    margin-top: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.followed-continue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    margin-top: 0.75rem;
    padding: 0 0.75rem;
    background: var(--card-bg, #384151);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.followed-continue-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ================================
   LOAD MORE BUTTON
================================ */
.load-more-wrapper {
    padding: 1rem 0;
}

.load-more-btn {
    padding: 12px 32px;
    background: #3f85fe;
    color: white;
    border: none;
    border-radius: 2px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background: #5558e3;
    transform: translateY(-1px);
}

.load-more-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    transform: none;
}

					/* ================================
.followed-continue-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}			
					/* ================================
   FIX BLACK STRIP UNDER LATEST UPDATES
================================ */

/* Remove collapsing margin */
.trending-section.latest-updates-section {
    margin-bottom: 0 !important;
    padding-bottom: 3rem; /* replace margin with padding */
    background-color: transparent;
}

/* Safety: prevent next container bleed */
.trending-section.latest-updates-section + * {
    margin-top: 0 !important;
}
/* Reading History Section - Override display control */
.reading-history-section[style*="display: block"] {
    display: block !important;
}

.mhq-mature-card {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
}

body.mhq-mature-filter-on .trending-card.mhq-mature-card::before,
body:not(.mhq-mature-show) .trending-card.mhq-mature-card::before,
body.mhq-mature-filter-on .trending-card.mhq-mature-card::after,
body:not(.mhq-mature-show) .trending-card.mhq-mature-card::after {
    content: none;
}

body.mhq-mature-filter-on .trending-card.mhq-mature-card .trending-card-inner::before,
body:not(.mhq-mature-show) .trending-card.mhq-mature-card .trending-card-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27white%27%20stroke-width%3D%271.25%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M2%2012s3.5-7%2010-7%2010%207%2010%207-3.5%207-10%207S2%2012%202%2012z%27/%3E%3Cpath%20d%3D%27M12%209a3%203%200%201%200%200%206%203%203%200%200%200%200-6z%27/%3E%3Cline%20x1%3D%273%27%20y1%3D%273%27%20x2%3D%2721%27%20y2%3D%2721%27/%3E%3C/svg%3E") center / 44px 44px no-repeat;
    z-index: 9999;
    pointer-events: none;
}

body.mhq-mature-filter-on .trending-card.mhq-mature-card .trending-card-inner::after,
body:not(.mhq-mature-show) .trending-card.mhq-mature-card .trending-card-inner::after {
    content: "18+";
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 10000;
    pointer-events: none;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: #fff;
    background: rgba(239, 68, 68, 0.95);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

body.mhq-mature-filter-on .mhq-mature-card::before,
body:not(.mhq-mature-show) .mhq-mature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27white%27%20stroke-width%3D%271.25%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M2%2012s3.5-7%2010-7%2010%207%2010%207-3.5%207-10%207S2%2012%202%2012z%27/%3E%3Cpath%20d%3D%27M12%209a3%203%200%201%200%200%206%203%203%200%200%200%200-6z%27/%3E%3Cline%20x1%3D%273%27%20y1%3D%273%27%20x2%3D%2721%27%20y2%3D%2721%27/%3E%3C/svg%3E") center / 44px 44px no-repeat;
    z-index: 9999;
    pointer-events: none;
}

body.mhq-mature-filter-on .mhq-mature-card::after,
body:not(.mhq-mature-show) .mhq-mature-card::after {
    content: "18+";
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 10000;
    pointer-events: none;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: #fff;
    background: rgba(239, 68, 68, 0.95);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

body.mhq-mature-filter-on .mhq-mature-card .trending-card-img,
body.mhq-mature-filter-on .mhq-mature-card .followed-card-img,
body.mhq-mature-filter-on .mhq-mature-card .browse-updates-card-img,
body:not(.mhq-mature-show) .mhq-mature-card .trending-card-img,
body:not(.mhq-mature-show) .mhq-mature-card .followed-card-img,
body:not(.mhq-mature-show) .mhq-mature-card .browse-updates-card-img {
    filter: blur(14px);
    transform: none;
    border-radius: 5px;
}

body.mhq-mature-filter-on .trending-card.mhq-mature-card:hover .trending-card-img,
body:not(.mhq-mature-show) .trending-card.mhq-mature-card:hover .trending-card-img {
    transform: none;
}
