/*
 * shared.css — Unified app chrome for CodeStats.gg
 * Includes: global tab nav, module breadcrumb, shared footer, utilities.
 * Imported alongside style.css on all public pages.
 */

:root {
    --cs-primary: #00e701;
    --cs-primary-hover: #00c201;
    --cs-bg-dark: #0f1115;
    --cs-bg-card: #1a1d24;
    --cs-text-main: #ffffff;
    --cs-text-muted: #8b9bb4;
    --cs-border: #2a2e38;
    --cs-accent-purple: #9945ff;
    --cs-accent-cyan: #00b4ff;
    --cs-accent-orange: #ffa500;
}

/* Global chrome resets */
.cs-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Don't stretch main to pin the footer to the viewport bottom — on short
   pages that leaves a large empty gap above the footer. */
.cs-main {
    flex: 0 1 auto;
}

/* ── Unified header ── */
.cs-header {
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 0;
    padding: 0;
    background: rgba(15, 17, 21, 0.96);
    border-bottom: 1px solid var(--cs-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cs-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 6px 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.cs-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    justify-self: start;
}

.cs-logo img {
    height: 56px;
    width: auto;
    display: block;
}

.cs-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--cs-text-main);
    letter-spacing: -0.5px;
    line-height: 1;
}

.cs-logo-text span {
    color: var(--cs-primary);
}

/* ── Tab navigation ── */
.cs-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.cs-nav a,
.cs-nav button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--cs-text-muted);
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
}

.cs-nav a:hover,
.cs-nav button:hover {
    color: var(--cs-text-main);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--cs-border);
}

.cs-nav a.active,
.cs-nav button.active {
    color: var(--cs-primary);
    background: rgba(0, 231, 1, 0.1);
    border-color: rgba(0, 231, 1, 0.25);
}

/* Product accent states */
.cs-nav a.accent-cloud.active {
    color: var(--cs-primary);
    background: rgba(0, 231, 1, 0.1);
    border-color: rgba(0, 231, 1, 0.25);
}

.cs-nav a.accent-shuffle.active {
    color: #a07cff;
    background: rgba(113, 22, 243, 0.12);
    border-color: rgba(113, 22, 243, 0.3);
}

.cs-nav a.accent-fattips.active {
    color: #c084fc;
    background: rgba(153, 69, 255, 0.1);
    border-color: rgba(153, 69, 255, 0.25);
}

.cs-nav a.accent-wenbj.active {
    color: var(--cs-accent-orange);
    background: rgba(255, 165, 0, 0.1);
    border-color: rgba(255, 165, 0, 0.25);
}

.cs-nav a.accent-partners.active {
    color: var(--cs-text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ── Auto-Claimers dropdown ── */
.cs-more {
    position: relative;
}

.cs-more > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cs-more-caret {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -3px;
    opacity: 0.7;
    transition: transform 0.18s ease, margin 0.18s ease;
}

.cs-more:hover .cs-more-caret,
.cs-more:focus-within .cs-more-caret {
    transform: rotate(225deg);
    margin-top: 2px;
}

.cs-more-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-top: 10px;
    display: none;
    z-index: 200;
}

.cs-more:hover .cs-more-menu,
.cs-more:focus-within .cs-more-menu {
    display: block;
}

.cs-more-menu-inner {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 210px;
    padding: 6px;
    background: var(--cs-bg-card);
    border: 1px solid var(--cs-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.cs-more-menu-inner a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cs-text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
}

.cs-more-menu-inner a:hover {
    color: var(--cs-text-main);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--cs-border);
}

.cs-more-menu-inner a.active {
    color: var(--cs-primary);
    background: rgba(0, 231, 1, 0.1);
    border-color: rgba(0, 231, 1, 0.25);
}

.cs-more-menu-inner a img {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

.cs-more-emoji {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Header right actions ── */
.cs-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.cs-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--cs-text-muted);
    border: 1px solid var(--cs-border);
    text-decoration: none;
    transition: all 0.2s ease;
}

.cs-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--cs-text-main);
    border-color: var(--cs-primary);
}

/* Text variant of the header action button (e.g. Sign In / Logout) */
.cs-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    color: #000;
    background: var(--cs-primary);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cs-header-btn:hover {
    background: var(--cs-primary-hover);
}

/* ── Mobile hamburger ── */
.cs-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    gap: 5px;
    background: transparent;
    border: 1px solid var(--cs-border);
    border-radius: 8px;
    cursor: pointer;
}

.cs-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--cs-text-main);
    border-radius: 2px;
    transition: all 0.2s ease;
}

/* ── Module breadcrumb / page title bar ── */
.cs-module-bar {
    border-bottom: 1px solid var(--cs-border);
    background: rgba(15, 17, 21, 0.6);
}

.cs-module-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--cs-text-muted);
}

.cs-breadcrumb a {
    color: var(--cs-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.cs-breadcrumb a:hover {
    color: var(--cs-text-main);
}

.cs-breadcrumb .sep {
    color: var(--cs-border);
}

.cs-breadcrumb .current {
    color: var(--cs-text-main);
    font-weight: 600;
}

/* ── Shared footer ── */
.cs-footer {
    /* Neutralise the legacy `footer { margin-top: 60px }` from style.css */
    margin-top: 0;
    border-top: 1px solid var(--cs-border);
    background: rgba(15, 17, 21, 0.8);
    padding: 14px 20px;
    text-align: center;
    color: var(--cs-text-muted);
    font-size: 0.85rem;
}

.cs-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.cs-footer-left {
    text-align: left;
}

.cs-footer-logo {
    display: block;
    font-size: 1.1rem;
    line-height: 1.2;
    font-weight: 800;
    color: var(--cs-text-main);
    text-decoration: none;
    margin-bottom: 2px;
}

.cs-footer-left p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--cs-text-muted);
}

.cs-footer-right {
    text-align: right;
}

.cs-footer-right p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .cs-footer-inner {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        text-align: center;
    }
    .cs-footer-left,
    .cs-footer-right {
        text-align: center;
    }
    .cs-footer-left p,
    .cs-footer-right p {
        line-height: 1.4;
    }
}

/* ── Utilities ── */
.cs-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.cs-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Product chooser cards (used on home/claimers) ── */
.cs-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.cs-product-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--cs-bg-card);
    border: 1px solid var(--cs-border);
    border-radius: 14px;
    padding: 22px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.cs-product-card:hover {
    transform: translateY(-3px);
    border-color: var(--cs-primary);
    box-shadow: 0 12px 32px rgba(0, 231, 1, 0.08);
}

.cs-product-card .icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.cs-product-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--cs-text-main);
    margin: 0;
}

.cs-product-card p {
    font-size: 0.88rem;
    color: var(--cs-text-muted);
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

.cs-product-card .cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    color: #000;
    background: var(--cs-primary);
    margin-top: 4px;
}

.cs-product-card:hover .cta {
    background: var(--cs-primary-hover);
}

.cs-product-card.accent-shuffle:hover {
    border-color: #7116f3;
    box-shadow: 0 12px 32px rgba(113, 22, 243, 0.12);
}

.cs-product-card.accent-shuffle .cta {
    background: #7116f3;
    color: #fff;
}

.cs-product-card.accent-shuffle:hover .cta {
    background: #5a0ec7;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .cs-menu-toggle {
        display: flex;
    }

    .cs-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        background: rgba(15, 17, 21, 0.98);
        border-bottom: 1px solid var(--cs-border);
        padding: 10px 20px 18px;
        gap: 2px;
    }

    .cs-nav.open {
        display: flex;
    }

    .cs-nav a,
    .cs-nav button {
        justify-content: flex-start;
        padding: 12px 14px;
        border-radius: 8px;
    }

    .cs-more {
        width: 100%;
    }

    .cs-more > a {
        width: 100%;
    }

    .cs-more-caret {
        margin-left: auto;
        transform: rotate(45deg);
    }

    .cs-more-menu {
        position: static;
        transform: none;
        padding-top: 0;
        display: block;
    }

    .cs-more-menu-inner {
        min-width: 0;
        padding: 0 0 4px 14px;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    .cs-more-menu-inner a {
        padding: 10px 12px;
    }

    .cs-header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .cs-module-bar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .cs-logo img {
        height: 46px;
    }

    .cs-header-inner {
        padding: 6px 15px;
    }
}
