/**
 * Wallvixo v1.0 - Upgrade Stylesheet (Glassmorphism + Modern UI)
 * Loaded AFTER style.css to override / extend non-destructively.
 */

/* ============ GLASSMORPHISM CARDS ============ */
:root {
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.35);
    --glass-blur: 14px;
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-light));
    --gradient-soft: linear-gradient(135deg, rgba(142, 70, 232, 0.12), rgba(160, 92, 240, 0.06));
}
[data-theme="dark"] {
    --glass-bg: rgba(22, 30, 54, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ============ GLASS UI - sticky header / sidebar / drawer ============ */
.app-header {
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    position: sticky; top: 0; z-index: 50;
    transition: box-shadow .25s ease, background .3s ease;
}
.app-header.scrolled {
    box-shadow: 0 6px 24px rgba(0,0,0,.06);
}
[data-theme="dark"] .app-header.scrolled {
    box-shadow: 0 6px 24px rgba(0,0,0,.45);
}

/* Refined content cards */
.content-card {
    transition: transform .35s cubic-bezier(.2,.9,.3,1.4),
                box-shadow .25s ease, border-color .25s ease;
    will-change: transform;
}
.content-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 18px 40px rgba(142, 70, 232, .18);
}
.content-card .img-wrap img {
    transition: transform .55s ease, filter .35s ease;
}
.content-card:hover .img-wrap img {
    transform: scale(1.08);
    filter: saturate(1.1);
}
.content-card .overlay {
    transition: opacity .25s ease, transform .25s ease;
}

/* Soft gradient overlay reveal on hover */
.content-card::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.55) 100%);
    opacity: 0; transition: opacity .3s ease; pointer-events: none;
    border-radius: inherit;
}
.content-card:hover::after { opacity: 1; }

/* Featured ribbon shimmer */
.ribbon-featured {
    background: linear-gradient(90deg, #ffd166, #ffba49, #ffd166);
    background-size: 200% 100%;
    animation: hn-shimmer 2.5s linear infinite;
    color: #5b3a00 !important;
    font-weight: 700;
}
@keyframes hn-shimmer {
    0% { background-position: 0% 0; }
    100% { background-position: -200% 0; }
}

/* ============ SKELETON LOADERS ============ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-mute) 0%, var(--bg-soft) 50%, var(--bg-mute) 100%);
    background-size: 200% 100%;
    animation: hn-skeleton 1.4s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes hn-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============ ENHANCED HERO ============ */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}
.hero::before {
    content: ''; position: absolute; inset: -20%;
    background: radial-gradient(circle at 25% 30%, rgba(142,70,232,.30), transparent 55%),
                radial-gradient(circle at 80% 70%, rgba(255,121,198,.18), transparent 55%);
    animation: hn-float 16s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes hn-float {
    0%   { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-2%, 3%) rotate(8deg); }
}

/* ============ ADVANCED CHIP / FILTER ROW ============ */
.chip-row .chip {
    transition: transform .15s ease, box-shadow .25s ease;
}
.chip-row .chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(142,70,232,.12);
}

/* ============ FILTER PANEL ============ */
.filter-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}
.filter-panel select,
.filter-panel input[type="search"] {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    color: var(--text);
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 13px;
    outline: none;
    min-width: 140px;
}
.filter-panel select:focus,
.filter-panel input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(142,70,232,.15);
}
.filter-panel .filter-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    margin-right: 4px;
    font-weight: 700;
}

/* ============ PRO LEVEL LIKE / DISLIKE BAR ============ */
.reaction-bar-pro {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 18px 0;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--bg-soft) 0%, var(--bg-mute, var(--bg-soft)) 100%);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}
.reaction-bar-pro::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #10b981 0%, var(--primary) 50%, #ef4444 100%);
    opacity: .8;
}
.reaction-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.reaction-bar-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .2px;
}
.reaction-bar-title svg { color: var(--primary); }
.reaction-bar-stat {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}
.reaction-bar {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin: 0;
}
.reaction-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--card, var(--bg-soft));
    border: 2px solid var(--border-soft);
    color: var(--text);
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s cubic-bezier(.34,1.56,.64,1);
    position: relative;
    overflow: hidden;
    min-height: 52px;
}
.reaction-btn .reaction-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,.04);
    transition: all .25s ease;
}
[data-theme="dark"] .reaction-btn .reaction-icon { background: rgba(255,255,255,.06); }
.reaction-btn .reaction-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
}
.reaction-btn .reaction-count {
    font-size: 13px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,.06);
    min-width: 32px;
    text-align: center;
    transition: all .25s ease;
}
[data-theme="dark"] .reaction-btn .reaction-count { background: rgba(255,255,255,.08); }
.reaction-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
    border-color: var(--primary);
}
.reaction-btn:hover .reaction-icon { transform: scale(1.1) rotate(-5deg); }
.reaction-btn:active { transform: translateY(0); }

.reaction-btn.like:hover {
    border-color: #10b981;
    background: rgba(16,185,129,.06);
}
.reaction-btn.like:hover .reaction-icon {
    background: rgba(16,185,129,.15);
    color: #10b981;
}
.reaction-btn.dislike:hover {
    border-color: #ef4444;
    background: rgba(239,68,68,.06);
}
.reaction-btn.dislike:hover .reaction-icon {
    background: rgba(239,68,68,.15);
    color: #ef4444;
}

.reaction-btn.active.like {
    background: linear-gradient(135deg, rgba(16,185,129,.18), rgba(16,185,129,.08));
    color: #10b981;
    border-color: #10b981;
    box-shadow: 0 6px 16px rgba(16,185,129,.25);
}
.reaction-btn.active.like .reaction-icon {
    background: #10b981;
    color: #fff;
    box-shadow: 0 4px 12px rgba(16,185,129,.4);
}
.reaction-btn.active.like .reaction-count {
    background: rgba(16,185,129,.2);
    color: #10b981;
}
.reaction-btn.active.dislike {
    background: linear-gradient(135deg, rgba(239,68,68,.16), rgba(239,68,68,.06));
    color: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 6px 16px rgba(239,68,68,.25);
}
.reaction-btn.active.dislike .reaction-icon {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 4px 12px rgba(239,68,68,.4);
}
.reaction-btn.active.dislike .reaction-count {
    background: rgba(239,68,68,.2);
    color: #ef4444;
}

/* Pop animation when clicked */
@keyframes reaction-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.reaction-btn.pop .reaction-icon { animation: reaction-pop .4s cubic-bezier(.34,1.56,.64,1); }

/* Mobile responsive */
@media (max-width: 480px) {
    .reaction-bar-pro { padding: 14px 12px; }
    .reaction-btn {
        padding: 10px 12px;
        gap: 8px;
        font-size: 13px;
        min-height: 48px;
    }
    .reaction-btn .reaction-icon { width: 28px; height: 28px; }
    .reaction-btn .reaction-label { font-size: 13px; }
    .reaction-bar-stat { font-size: 11px; }
}

/* ============ TRENDING STRIP (vertical mobile style) ============ */
.trending-strip {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 2px 18px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.trending-strip::-webkit-scrollbar { height: 6px; }
.trending-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.trending-card {
    flex: 0 0 180px;
    scroll-snap-align: start;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: #1a1a2e;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease;
    aspect-ratio: 9/16;
    display: block;
    color: #fff;
}
.trending-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.trending-card .t-img {
    position: absolute; inset: 0;
    background: #0f0f1a;
    overflow: hidden;
}
.trending-card .t-img img {
    width:100%; height:100%; object-fit:cover;
    transition: transform .6s ease;
}
.trending-card:hover .t-img img { transform: scale(1.06); }
.trending-card .t-rank {
    position: absolute; top: 10px; left: 10px;
    background: var(--gradient-primary, linear-gradient(135deg,#8e46e8,#a05cf0)); color: #fff;
    width: 28px; height: 28px; border-radius: 8px;
    display: grid; place-items: center;
    font-weight: 800; font-size: 12px;
    box-shadow: 0 4px 12px rgba(142,70,232,.45);
    z-index: 3;
}
.trending-card .t-body {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 36px 12px 12px;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.85) 100%);
    z-index: 2;
    color: #fff;
}
.trending-card .t-body h4 {
    font-size: 13px; font-weight: 700; margin: 0;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,.6);
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.trending-card .t-body p {
    font-size: 11px; color: rgba(255,255,255,.85); margin-top: 4px;
    display: flex; align-items: center; gap: 6px;
}

/* ============ FADE-IN ANIM (page entry) ============ */
.app-body.fade-in { animation: hn-fadeup .45s cubic-bezier(.2,.9,.3,1.1); }
@keyframes hn-fadeup {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ============ LANGUAGE SWITCHER ============ */
.lang-switch {
    display: inline-flex;
    background: var(--bg-soft);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--border-soft);
}
.lang-switch a {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    transition: all .2s ease;
}
.lang-switch a.active {
    background: var(--gradient-primary);
    color: #fff;
}

/* RTL support for Urdu */
html[lang="ur"] body, html[dir="rtl"] body {
    font-family: 'Noto Nastaliq Urdu', 'Segoe UI', sans-serif;
}
html[dir="rtl"] .app-shell { direction: rtl; }
html[dir="rtl"] .side-link .lbl { text-align: right; }

/* ============ SCROLL-TO-TOP BUTTON ============ */
.scroll-top {
    position: fixed; right: 16px; bottom: 88px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff; border: none;
    display: grid; place-items: center;
    box-shadow: var(--shadow-purple);
    cursor: pointer;
    opacity: 0; pointer-events: none;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease;
    z-index: 40;
}
.scroll-top.show { opacity: 1; pointer-events: auto; transform: none; }
@media (min-width: 992px) {
    .scroll-top { bottom: 24px; right: 24px; }
}

/* ============ TOAST UPGRADE ============ */
.toast {
    backdrop-filter: blur(10px);
    background: rgba(15,18,38,.92) !important;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 14px 40px rgba(0,0,0,.35);
}
[data-theme="dark"] .toast {
    background: rgba(255,255,255,.10) !important;
    color: #fff;
}

/* ============ CONTENT CARD FOCUS RING ============ */
.content-card:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

/* ============ IMAGE LAZY-LOAD FADE ============ */
img.lazy-blur {
    filter: blur(8px);
    transition: filter .35s ease, opacity .35s ease;
}
img.lazy-blur.loaded {
    filter: blur(0);
}

/* ============ MOBILE BOTTOM NAV REFINE ============ */
.bottom-nav {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
}

/* ============ CARD GRID DENSER ON LARGE SCREENS ============ */
@media (min-width: 1280px) {
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 18px;
    }
}

/* ============ SHARE BAR REFINE ============ */
.share-row .share-btn {
    transition: transform .2s ease, box-shadow .25s ease, background .2s ease;
}
.share-row .share-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 14px rgba(0,0,0,.12);
}

/* ============ ADMIN UI POLISH (only adds, doesn't override) ============ */
.admin-stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.admin-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.admin-stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--gradient-soft);
    display: grid; place-items: center;
    color: var(--primary);
    margin-bottom: 12px;
}
.admin-stat-card .stat-num {
    font-family: 'Poppins', sans-serif;
    font-size: 28px; font-weight: 800;
    margin: 4px 0 2px;
}
.admin-stat-card .stat-label {
    font-size: 12px; color: var(--muted);
    text-transform: uppercase; letter-spacing: .5px;
}

/* Print friendliness */
@media print {
    .app-side, .bottom-nav, .app-header, .scroll-top, .app-footer { display:none !important; }
    .app-body { padding: 0 !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
