/* ==========================================================================
   Sujon Software Hub — shell styles
   --------------------------------------------------------------------------
   Loads AFTER pva-theme.css and only adds what this product's chrome needs:
   the top navigation, the wallet chip and the round icon buttons. Everything
   else (Bootstrap re-skin, cards, forms, tables, notification drawer, language
   selector, footer) already comes from the shared theme, so this file stays
   deliberately small and uses the same tokens.
   ========================================================================== */

/* ── Primary navigation ─────────────────────────────────────────────────── */
.hub-nav { gap: 4px; }

.hub-nav-link {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .5rem .85rem;
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    font-size: .875rem; font-weight: 600;
    white-space: nowrap;
    transition: background-color var(--t-fast), color var(--t-fast);
}
.hub-nav-link i { font-size: .9rem; opacity: .9; }
.hub-nav-link:hover { background: var(--surface-2); color: var(--pva-primary); }
.hub-nav-link.active {
    background: var(--pva-primary-soft);
    color: var(--pva-primary-strong);
}
body[data-theme="dark"] .hub-nav-link.active {
    background: rgba(59, 130, 246, .16);
    color: #93c5fd;
}

/* ── Wallet balance chip ────────────────────────────────────────────────── */
.balance-chip {
    display: inline-flex; align-items: center; gap: .45rem;
    height: 38px; padding: 0 .85rem;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    background: var(--surface-2);
    color: var(--text-primary);
    font-weight: 700; font-size: .85rem;
    white-space: nowrap;
    transition: var(--transition);
}
.balance-chip i { color: var(--pva-success); }
.balance-chip:hover {
    border-color: var(--pva-success);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ── Round icon buttons (bell, profile, admin, theme, sign out) ─────────── */
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}
.icon-btn:hover {
    background: var(--surface-2);
    border-color: var(--pva-primary);
    color: var(--pva-primary);
}

/* ── Home page ──────────────────────────────────────────────────────────── */
.hub-hero {
    background: var(--hero-bg);
    color: #fff;
    border-radius: var(--r-xl);
    padding: clamp(1.8rem, 1.2rem + 3.5vw, 3.5rem);
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.hub-hero::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 82% 15%, rgba(255,255,255,.16), transparent 55%);
    pointer-events: none;
}
.hub-hero > * { position: relative; z-index: 1; }
.hub-hero h1 {
    color: #fff; font-weight: 800; letter-spacing: -.03em;
    font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.9rem);
    margin-bottom: .7rem;
}
.hub-hero p { color: rgba(255,255,255,.9); max-width: 620px; margin-bottom: 1.4rem; }

.hero-eyebrow {
    display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(255,255,255,.16);
    border-radius: var(--r-full);
    padding: .28rem .8rem;
    font-size: .7rem; font-weight: 800;
    letter-spacing: .09em; text-transform: uppercase;
    margin-bottom: 1rem;
}

/* Big service cards */
.service-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
    color: var(--text-primary);
}
.service-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--pva-primary);
    color: var(--text-primary);
}
.service-icon {
    width: 52px; height: 52px;
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; color: #fff;
    margin-bottom: .9rem;
}
.service-icon.soft { background: linear-gradient(135deg, var(--pva-primary), var(--pva-accent)); }
.service-icon.code { background: linear-gradient(135deg, var(--pva-accent-strong), var(--pva-success)); }
.service-card h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: .35rem; }
.service-card p  { font-size: .88rem; color: var(--text-secondary); margin-bottom: .9rem; }
.service-meta {
    display: flex; flex-wrap: wrap; gap: .4rem;
    font-size: .74rem; font-weight: 600;
}
.service-meta span {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: .2rem .6rem;
    color: var(--text-secondary);
}

/* ── Top-service tiles (homepage: popular SMM services / OTP numbers) ───── */
.top-item {
    display: flex; flex-direction: column;
    gap: .55rem;
    height: 100%;
    padding: .9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    color: var(--text-primary);
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.top-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--pva-primary);
    color: var(--text-primary);
}

.top-item-head { display: flex; align-items: center; gap: .5rem; }
.top-item-icon {
    flex: 0 0 30px; width: 30px; height: 30px;
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .85rem;
}
.top-item-platform {
    font-weight: 700; font-size: .86rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-item-tag {
    margin-left: auto;
    background: rgba(16, 185, 129, .14);
    color: #047857;
    border-radius: var(--r-full);
    padding: .1rem .45rem;
    font-size: .66rem; font-weight: 700;
    white-space: nowrap;
}
body[data-theme="dark"] .top-item-tag { color: #6ee7b7; }

/* two-line clamp keeps every tile the same height regardless of title length */
.top-item-name {
    font-size: .78rem; line-height: 1.4;
    color: var(--text-secondary);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    line-clamp: 2; overflow: hidden;
    min-height: 2.2em;
}
.top-item-foot {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: .5rem; margin-top: auto;
}
.top-item-price {
    font-weight: 800; font-size: .95rem;
    color: var(--pva-success);
    white-space: nowrap;
}
.top-item-price small { font-weight: 600; font-size: .7rem; opacity: .8; }
.top-item-min {
    font-size: .7rem; font-weight: 600;
    color: var(--text-muted); white-space: nowrap;
}

/* ── Category tiles (home page) ─────────────────────────────────────────
   Each one deep-links into the catalogue's own filter, /tools?type=<slug>.
   Auto-fit rather than a fixed column count so adding a category to
   CUSTOM_TOOL_TYPES needs no layout change here. */
.hub-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .7rem;
}
.hub-cat {
    display: flex; flex-direction: column; align-items: center; gap: .45rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.15rem .7rem;
    color: var(--text-secondary);
    font-size: .82rem; font-weight: 700; text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-base), box-shadow var(--t-base),
                border-color var(--t-base), color var(--t-base);
}
.hub-cat i { font-size: 1.45rem; color: var(--pva-primary); transition: transform var(--t-base); }
.hub-cat em {
    font-style: normal; font-size: .68rem; font-weight: 800;
    color: var(--text-muted);
    background: var(--surface-2); border-radius: var(--r-full);
    padding: .1rem .5rem;
}
.hub-cat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--pva-primary);
    color: var(--pva-primary-strong);
}
.hub-cat:hover i { transform: scale(1.12); }
body[data-theme="dark"] .hub-cat:hover { color: #93c5fd; }

@media (max-width: 575.98px) {
    .hub-cats { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: .5rem; }
    .hub-cat  { padding: .85rem .5rem; font-size: .74rem; }
    .hub-cat i { font-size: 1.2rem; }
}

/* Step / feature tiles */
.step-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.1rem;
    height: 100%;
}
.step-num {
    width: 30px; height: 30px;
    border-radius: var(--r-full);
    background: var(--pva-primary-soft);
    color: var(--pva-primary-strong);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .85rem;
    margin-bottom: .6rem;
}
.step-tile h4 { font-size: .95rem; font-weight: 700; margin-bottom: .3rem; }
.step-tile p  { font-size: .84rem; color: var(--text-secondary); margin: 0; }

@media (max-width: 991.98px) {
    .main-navbar .container { flex-wrap: wrap; }
}
@media (max-width: 575.98px) {
    .balance-chip { padding: 0 .6rem; font-size: .8rem; }
    .hub-nav-link { padding: .45rem .65rem; font-size: .82rem; }
}

/* ==========================================================================
   Product cards (software / apps / templates)
   ========================================================================== */
.product-tile {
    display: flex; flex-direction: column;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
    color: var(--text-primary);
}
.product-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--pva-primary);
    color: var(--text-primary);
}
.product-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--surface-2) center/cover no-repeat;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 1.6rem;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-badge {
    position: absolute; top: 10px; left: 10px;
    background: rgba(2, 6, 23, .72);
    backdrop-filter: blur(4px);
    color: #fff; font-size: .68rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
    padding: .2rem .55rem; border-radius: var(--r-full);
}
.product-body { padding: .95rem 1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.product-title {
    font-weight: 700; font-size: .96rem; line-height: 1.35;
    margin-bottom: .35rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    line-clamp: 2; overflow: hidden;
}
.product-desc {
    font-size: .82rem; line-height: 1.55; color: var(--text-secondary);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    line-clamp: 2; overflow: hidden; margin-bottom: .8rem;
}
.product-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: .6rem; margin-top: auto;
}
.product-price { font-weight: 800; font-size: 1.05rem; color: var(--pva-success); white-space: nowrap; }
.product-sales { font-size: .72rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.owned-flag {
    background: rgba(16,185,129,.14); color: #047857;
    border-radius: var(--r-full); padding: .16rem .55rem;
    font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
body[data-theme="dark"] .owned-flag { color: #6ee7b7; }

/* custom-build call to action */
.custom-cta {
    background: var(--hero-bg);
    color: #fff;
    border-radius: var(--r-xl);
    padding: clamp(1.5rem, 1rem + 3vw, 2.75rem);
    position: relative; overflow: hidden;
}
.custom-cta::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.15), transparent 55%);
    pointer-events: none;
}
.custom-cta > * { position: relative; z-index: 1; }
.custom-cta h2 { color: #fff; font-weight: 800; letter-spacing: -.025em; margin-bottom: .5rem; }
.custom-cta p  { color: rgba(255,255,255,.9); max-width: 620px; margin-bottom: 1.1rem; }

/* ==========================================================================
   Floating chrome vs. the sticky header
   pva-theme.css and support_popup.html pin their buttons to the TOP-LEFT of
   the viewport, which suited the parent's header-less shell. This site has a
   sticky two-row nav (94px desktop / 137px mobile), so anything fixed at the
   top lands on it. The translate control now lives inline in the nav; the two
   things left over are the language menu it opens and the chat launcher.
   support_popup.html carries its own <style> further down the document, so
   .chat-toggle needs !important to be moved.
   ========================================================================== */

/* Language menu — drops from the translate icon at the right of the nav. */
.language-selector {
    top: 100px;
    right: 14px;
    left: auto;
}

/* Chat launcher — bottom-right, the conventional place for one and clear of
   the header at every width. */
.chat-toggle {
    top: auto !important;
    left: auto !important;
    bottom: 22px !important;
    right: 18px !important;
    width: 52px !important;
    height: 52px !important;
    font-size: 1.25rem !important;
}
.emergency-support-toggle {
    top: auto !important;
    left: auto !important;
    bottom: 84px !important;
    right: 18px !important;
}

/* The panel was anchored to the launcher's old top-left home, so it opened on
   the opposite side of the screen from the button once that moved. */
.chat-popup {
    left: auto !important;
    right: 18px !important;
    bottom: 86px !important;
    max-height: calc(100vh - 120px);
}

@media (max-width: 767.98px) {
    .language-selector {
        top: 146px;
        right: 10px;
        width: calc(100vw - 20px);
        max-width: 260px;
    }
    .chat-toggle {
        bottom: 16px !important;
        right: 14px !important;
        width: 48px !important;
        height: 48px !important;
    }
    .emergency-support-toggle { bottom: 74px !important; right: 14px !important; }
    .chat-popup {
        right: 14px !important;
        left: auto !important;
        bottom: 74px !important;
        width: calc(100vw - 28px) !important;
        max-height: calc(100vh - 110px);
    }
}
