/*
 * os-modern.css
 * Modern card/grid enhancements — layered on top of existing os-dark.css
 * Adds: hover scale, shadows, smooth transitions, better image handling
 */

/* ── Card image boxes: smoother corners + aspect ratio ── */
.os-img-box .img-box {
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.os-img-box .img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

/* ── Hover: lift + scale image ── */
.os-img-box:hover .img-box {
    box-shadow: 0 8px 25px rgba(0,0,0,0.35);
    transform: translateY(-4px);
}
.os-img-box:hover .img-box img {
    transform: scale(1.05);
}

/* ── Title text: smoother transition ── */
.os-img-box .title {
    transition: color 0.2s ease;
}

/* ── Carousel items: consistent spacing ── */
.owl-carousel .os-img-box {
    padding-bottom: 4px; /* room for shadow */
}

/* ── Recent updates large cards ── */
.os-img-box .img-box.img-box-lg {
    border-radius: 12px;
}

/* Force uniform card height in the Recent Updates carousel.
   Without this, screenshots with different native sizes render at different
   heights, making the grid look uneven. object-fit: cover (set on img below)
   handles the cropping so nothing stretches. */
.os-img-box-cont-lg .os-img-box .img-box.img-box-lg {
    height: 268px;
    overflow: hidden;
}
.os-img-box-cont-lg .os-img-box .img-box.img-box-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* ── Hover state overlay: smoother ── */
.os-img-box .hover-state {
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

/* ── Play button: pulse on hover ── */
.os-img-box:hover .play-btn-dark {
    animation: os-pulse 1.5s infinite;
}
@keyframes os-pulse {
    0% { box-shadow: 0 0 0 0 rgba(230, 0, 0, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(230, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 0, 0, 0); }
}

/* ── Section titles: subtle underline accent ── */
section > .d-flex > .title-box .title {
    position: relative;
}

/* ── Review cards ── */
.osrevhome .img-box {
    border-radius: 8px;
}

/* ── Inline spoiler tags ──
   Used by parse::renderReviewBody() to obscure [spoiler]...[/spoiler] sections
   of a review. text-shadow gives an inline-friendly blur that wraps with the
   surrounding text (filter: blur() requires inline-block and breaks wrapping). */
.inline-spoiler {
    background: rgba(0,0,0,0.85);
    color: transparent !important;
    text-shadow: 0 0 6px rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 0 4px;
    border-radius: 3px;
    user-select: none;
    transition: color 0.2s, text-shadow 0.2s, background 0.2s;
}
.inline-spoiler::after {
    content: ' (spoiler — click)';
    font-size: 0.78em;
    color: #f39c12 !important;
    text-shadow: none;
    font-style: italic;
    margin-left: 2px;
}
.inline-spoiler.revealed {
    background: rgba(243,156,18,0.12);
    color: inherit !important;
    text-shadow: none;
    user-select: text;
    cursor: text;
}
.inline-spoiler.revealed::after { content: ''; }
.os-light-mode .inline-spoiler {
    background: rgba(0,0,0,0.78);
    text-shadow: 0 0 6px rgba(255,255,255,0.5);
}

/* ── Discussion cards ── */
.img-box-text-over {
    border-radius: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.img-box-text-over:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* ── Skeleton loading animation (reusable utility) ── */
.os-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: os-shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes os-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Skeleton templates ── */
.os-skeleton-post {
    padding: 20px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}
.os-skeleton-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.os-skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.os-skeleton-line {
    height: 12px;
    border-radius: 6px;
}
.os-skeleton-line-sm { width: 80px; }
.os-skeleton-line-md { width: 150px; }
.os-skeleton-line-lg { width: 100%; max-width: 300px; }
.os-skeleton-line-xl { width: 100%; }
.os-skeleton-body { margin-bottom: 12px; }
.os-skeleton-body .os-skeleton-line { margin-bottom: 8px; }
.os-skeleton-card {
    border-radius: 8px;
    overflow: hidden;
}
.os-skeleton-card-img {
    width: 100%;
    height: 180px;
    margin-bottom: 10px;
}
.os-skeleton-card-title {
    height: 14px;
    width: 80%;
    margin-bottom: 6px;
}
.os-skeleton-card-sub {
    height: 10px;
    width: 60%;
}
.os-skeleton-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
}
.os-skeleton-search-img {
    width: 40px;
    height: 55px;
    border-radius: 4px;
    flex-shrink: 0;
}
.os-skeleton-search-lines {
    flex: 1;
}
.os-skeleton-search-lines .os-skeleton-line {
    margin-bottom: 6px;
}

/* ── Better scrollbar styling ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* ── Buttons: subtle hover lift ── */
.btn-primary,
.btn-info {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary:hover,
.btn-info:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ── Following feed: hover highlight ── */
.follower-box {
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.follower-box:hover {
    background: rgba(255,255,255,0.04);
}

/* ── Badge/tag refinements ── */
.badge {
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ── Light mode adjustments ── */
.os-light-mode .os-img-box .img-box {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.os-light-mode .os-img-box:hover .img-box {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.os-light-mode .search-autocomplete {
    background: #fff;
    border-color: rgba(0,0,0,0.1);
}
.os-light-mode .ac-item:hover,
.os-light-mode .ac-item.ac-active {
    background: rgba(0,0,0,0.04);
}
.os-light-mode .ac-item-title { color: #222; }
.os-light-mode .ac-item-sub { color: #888; }
.os-light-mode .ac-section-label { color: #999; }
.os-light-mode .ac-hint { color: #bbb; border-top-color: rgba(0,0,0,0.06); }

/* ── Reaction picker on feed posts ── */
.os-reaction-wrap {
    position: relative;
}
.os-reaction-picker {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e38;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 6px 8px;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    z-index: 100;
    margin-bottom: 8px;
}
.os-reaction-wrap:hover .os-reaction-picker,
.os-reaction-picker.os-picker-show {
    display: flex;
    gap: 2px;
    align-items: center;
    animation: os-picker-pop 0.2s ease;
}
@keyframes os-picker-pop {
    from { transform: translateX(-50%) scale(0.8); opacity: 0; }
    to { transform: translateX(-50%) scale(1); opacity: 1; }
}
.os-react-emoji {
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 50%;
    transition: transform 0.15s ease, background 0.15s ease;
    line-height: 1;
}
.os-react-emoji:hover {
    transform: scale(1.35);
    background: rgba(255,255,255,0.1);
}
.os-light-mode .os-reaction-picker {
    background: #fff;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.os-light-mode .os-react-emoji:hover {
    background: rgba(0,0,0,0.06);
}

/* ── Smooth page-level transitions ── */
#site-content {
    animation: os-fadeIn 0.3s ease;
}
@keyframes os-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ──────────────────────────────────────────────────────────────────────
   Perf: stop CPU churn from always-on infinite CSS animations.
   1) When the tab is backgrounded/inactive, freeze every animation
      (added by the visibility handler in footer.php). This kills the
      "site eats CPU while a tab is open in the background" complaint.
   2) Honour the OS "reduce motion" setting for decorative loops.
   Reversible: delete this block + the footer.php visibility handler.
   ────────────────────────────────────────────────────────────────────── */
html.os-anim-paused *,
html.os-anim-paused *::before,
html.os-anim-paused *::after {
    animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ───────────────────────────────────────────────────────────────────────
   Home tabs — Anime Hub / For You (added with the tab restructure).
   ─────────────────────────────────────────────────────────────────────── */

/* Anime Hub: a touch more breathing room on the compact genre cloud. */
.os-genre-cloud--hub { gap: 8px; }
.os-genre-cloud--hub .os-genre-tag { font-size: .82rem; padding: 7px 14px; }

/* For You: watchlist status badge pinned over the cover. */
.os-wl-badge {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
    padding: 2px 8px; border-radius: 12px; color: #1a1a1a;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.os-wl-badge.is-watching  { background: #ff9b3d; }
.os-wl-badge.is-completed { background: #42d885; }
.os-wl-badge.is-hold      { background: #b8babc; }
.os-wl-badge.is-dropped   { background: #e06a6a; color: #fff; }
.os-wl-badge.is-plan      { background: #cfd1d3; }

/* For You: "My Activity" unified feed. */
.os-act-feed {
    background: #1b1b1d; border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px; padding: 4px 6px; margin-top: 4px;
}
.os-act-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 12px; border-radius: 9px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: background .15s ease;
}
.os-act-item:last-child { border-bottom: none; }
.os-act-item:hover { background: rgba(255,255,255,.04); }
.os-act-ic {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.os-act-ic.ic-comment { background: rgba(64,140,255,.15);  color: #5b9bff; }
.os-act-ic.ic-reply   { background: rgba(180,120,255,.15); color: #b485ff; }
.os-act-ic.ic-wall    { background: rgba(255,180,0,.15);   color: #ffb400; }
.os-act-ic.ic-feed    { background: rgba(46,204,113,.15);  color: #42d885; }
.os-act-ic.ic-review  { background: rgba(230,0,0,.15);     color: #ff5a5a; }
.os-act-bd { min-width: 0; }
.os-act-tx { display: block; font-size: .84rem; color: #cfd1d3; line-height: 1.45; }
.os-act-tx b { color: #e7e8ea; font-weight: 600; }
.os-act-tm { display: block; font-size: .7rem; color: #7e8186; margin-top: 3px; }
