/* ==========================================
   css/detail.css
   ========================================== 
   Full-screen "manga detail" page shown when any card (search grid,
   Trending Today, Hidden Gems) is tapped. Lives as a fixed overlay so it
   never needs real routing — js/mangaDetail.js just toggles the .open 
   class. Scoped entirely to .detail-* classes so it can't collide with
   the rest of the site's CSS.
*/

body.detail-open {
    overflow: hidden;
}

.detail-view {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg-dark, #0b1622);
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px);
    transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s;
}

.detail-view.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .28s ease, transform .28s ease;
}

.detail-scroll {
    position: relative;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.detail-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 340px;
    background-size: cover;
    background-position: center 25%;
    filter: blur(28px) brightness(0.55) saturate(1.2);
    transform: scale(1.15);
    opacity: .8;
}

.detail-back-btn {
    position: sticky;
    top: 16px;
    left: 16px;
    z-index: 5;
    width: 40px;
    height: 40px;
    margin: 16px 0 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    color: #fff;
    background: rgba(10,14,28,.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--border, rgba(255,255,255,.08));
    border-radius: 100px;
    cursor: pointer;
}

.detail-cover-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 8px 20px 0;
}

.detail-cover {
    width: 168px;
    height: 236px;
    object-fit: cover;
    border-radius: var(--radius, 20px);
    border: 1px solid var(--border, rgba(255,255,255,.08));
    box-shadow: var(--shadow, 0 12px 30px rgba(0,0,0,.28));
}

.detail-body {
    position: relative;
    padding: 20px 20px 48px;
    max-width: 640px;
    margin: 0 auto;
}

.detail-title {
    font-family: "Inter", system-ui, sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.3;
    color: var(--text-title, #eef4ff);
    text-align: center;
    margin: 4px 0 12px;
}

.detail-genre-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}

.detail-genre-chip {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent, #3db4f2);
    background: rgba(61,180,242,.12);
    border: 1px solid rgba(61,180,242,.25);
    padding: 4px 12px;
    border-radius: 100px;
}

.detail-stats-row {
    display: flex;
    justify-content: center;
    gap: 28px;
    padding: 16px 0;
    border-top: 1px solid var(--border, rgba(255,255,255,.08));
    border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
    margin-bottom: 18px;
}

.detail-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.detail-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-title, #eef4ff);
}

.detail-stat-label {
    font-size: 11px;
    color: var(--text-muted, #6f7d8c);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ==========================
   BADGES (rating / reading-time / confidence)
   Moved here from the homepage cards — see js/mangaDetail.js header comment.
========================== */
.detail-badge-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.detail-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 100px;
    border: 1px solid var(--border, rgba(255,255,255,.08));
    color: var(--text-main, #a2afc0);
    background: rgba(255,255,255,.04);
    white-space: nowrap;
}

.detail-badge-rating {
    color: #facc15;
    background: rgba(250, 204, 21, 0.1);
    border-color: rgba(250, 204, 21, 0.3);
}

.detail-badge-readtime {
    color: var(--accent, #3db4f2);
    background: rgba(61, 180, 242, 0.1);
    border-color: rgba(61, 180, 242, 0.3);
}

.detail-badge-confidence {
    color: var(--green, #34d399);
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.3);
}

/* ==========================
   MOOD TAGS
========================== */
.detail-mood-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}

.detail-mood-chip {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main, #a2afc0);
    background: rgba(255,255,255,.04);
    border: 1px dashed var(--border, rgba(255,255,255,.12));
    padding: 4px 12px;
    border-radius: 100px;
}

/* ==========================
   QUICK ACTIONS (Save / Similar Titles / Share)
========================== */
.detail-quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 26px;
}

.detail-bookmark-btn {
    flex: 1.3 1 0;
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: var(--accent, #3db4f2);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition, .3s ease);
}

.detail-bookmark-btn:hover {
    background: var(--accent-hover, #1184be);
}

.detail-bookmark-btn.active {
    background: #ef4444;
}

.detail-action-btn {
    flex: 1 1 0;
    padding: 14px 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-title, #eef4ff);
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border, rgba(255,255,255,.08));
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition, .3s ease);
    white-space: nowrap;
}

.detail-action-btn:hover {
    background: rgba(255,255,255,.08);
    transform: translateY(-1px);
}

@media (max-width: 380px) {
    .detail-quick-actions {
        flex-wrap: wrap;
    }
    .detail-bookmark-btn {
        flex: 1 1 100%;
    }
    .detail-action-btn {
        flex: 1 1 0;
    }
}

/* ==========================
   TOAST (used by Share)
========================== */
.detail-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 12px);
    z-index: 1000;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgba(10,14,28,.92);
    border: 1px solid var(--border, rgba(255,255,255,.1));
    border-radius: 100px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.detail-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.detail-section-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-title, #eef4ff);
    margin: 0 0 10px;
}

/* ==========================
   DETAIL SYNOPSIS
========================== */
.detail-synopsis {
    position: relative;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main, #a2afc0);
    margin: 0 0 26px;
    
    /* Truncate to 4 lines initially */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    cursor: pointer;
}

/* Gradient fade at the bottom to indicate more text */
.detail-synopsis::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1.6rem;
    background: linear-gradient(transparent, var(--bg-dark, #0b1622));
    pointer-events: none;
}

/* Expanded state */
.detail-synopsis.expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* Hide the gradient when fully expanded */
.detail-synopsis.expanded::after {
    display: none;
}


.detail-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-link-btn {
    flex: 1 1 auto;
    min-width: 140px;
    text-align: center;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    transition: var(--transition, .3s ease);
}

.detail-link-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.detail-links-empty {
    font-size: 13px;
    color: var(--text-muted, #6f7d8c);
}

.detail-links-skeleton {
    display: flex;
    gap: 10px;
    width: 100%;
}

.skel-pill {
    flex: 1 1 auto;
    min-width: 140px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(90deg, #1a2140 25%, #232b52 37%, #1a2140 63%);
    background-size: 400% 100%;
    animation: detail-skeleton-shimmer 1.4s ease infinite;
}

@keyframes detail-skeleton-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .detail-view,
    .skel-pill {
        transition: none;
        animation: none;
    }
}

@media (min-width: 520px) {
    .detail-stats-row {
        gap: 40px;
    }
}


/* ==========================
   MATCH BREAKDOWN (DETAIL PAGE)
========================== */
.detail-match-container {
    margin: 0 0 26px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border, rgba(255,255,255,.08));
    border-radius: 12px;
    padding: 16px;
}

.detail-match-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.detail-match-score {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--green);
    background: rgba(52, 211, 153, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.detail-match-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-title, #eef4ff);
}

.detail-match-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-match-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-muted, #6f7d8c);
    line-height: 1.4;
}

.detail-match-item.is-match {
    color: var(--text-main, #a2afc0);
}

.detail-match-icon {
    font-weight: 700;
    flex-shrink: 0;
}

.detail-match-item.is-match .detail-match-icon { 
    color: var(--green); 
}

.detail-match-item:not(.is-match) .detail-match-icon { 
    color: var(--red); 
}
/* ==========================================
   STEP 9 ADDITIONS — append to css/detail.css
   ==========================================
   Styles for js/mangaDetail.js's new "Search Results" section (Brave
   Search results, Step 9 of READLINKS_UPGRADE_PLAN.md). Built on the same
   design tokens (--accent, --border, --text-title, --text-muted,
   --transition) already used throughout the rest of detail.css, so this
   should sit visually consistent with everything above it.

   Reuses existing classes for the loading state -- .detail-links-skeleton
   and .skel-pill are already defined above and need no changes; only the
   6 classes below are new.
*/

/* Small "Unverified" pill next to the section heading -- amber/warning
   tone, distinct from the green "Verified" badges used on MangaDex/Comick
   Read Now buttons, so the trust-level difference reads at a glance. */
.detail-unverified-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 100px;
    vertical-align: middle;
}

/* Small spacing fix so Search Results doesn't crowd the Read Now row
   above it now that a new section follows it. */
.detail-links-row {
    margin-bottom: 26px;
}

.detail-search-results-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 26px;
}

.detail-search-result {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border, rgba(255, 255, 255, .08));
    border-radius: 12px;
    text-decoration: none;
    transition: var(--transition, .3s ease);
}

.detail-search-result:hover {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .16);
    transform: translateY(-1px);
}

.detail-search-result-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--accent, #3db4f2);
    line-height: 1.35;
}

.detail-search-result-snippet {
    font-size: 12.5px;
    color: var(--text-muted, #6f7d8c);
    line-height: 1.5;
    /* Cap snippets to 2 lines so a long meta description can't blow out
       the card height and push everything below it down unpredictably. */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.detail-search-empty {
    font-size: 13px;
    color: var(--text-muted, #6f7d8c);
}



