/* ─── RESET & BASE ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1a2744;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --border: #2d2d4a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --font: 'Inter', -apple-system, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

main {
    flex: 1;
}

/* ─── NAVBAR ─── */
.navbar {
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
    box-shadow: 0 1px 20px rgba(0,0,0,0.3);
}

/* Top accent line */
.navbar::before {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899, #6366f1);
    background-size: 200% 100%;
    animation: navbarAccent 4s linear infinite;
}

@keyframes navbarAccent {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 0;
    height: 54px;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Logo ── */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    margin-right: 24px;
}
.nav-logo:hover { color: var(--text-primary); }

.logo-icon { font-size: 1.3rem; }
.logo-accent { color: var(--accent); }

/* ── Center nav links ── */
.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.nav-link {
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.86rem;
    font-weight: 500;
    transition: color 0.18s ease, background 0.18s ease;
    white-space: nowrap;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.nav-link.active {
    color: white;
    background: rgba(99,102,241,0.18);
    font-weight: 600;
}

/* ── Right user section ── */
.nav-user {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

/* Icon buttons: bell + messages */
.nav-icon-btn {
    position: relative;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease;
    color: var(--text-secondary);
}

.nav-icon-btn:hover {
    background: rgba(255,255,255,0.07);
    color: var(--text-primary);
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 0.52rem;
    font-weight: 800;
    border-radius: 50%;
    min-width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    line-height: 1;
    border: 1.5px solid var(--bg-primary);
}

/* Avatar + username */
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    color: white;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Balance pill */
.nav-balance {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--success);
    padding: 3px 8px;
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 20px;
    white-space: nowrap;
}

/* Orders / Logout — small links */
.nav-logout {
    font-size: 0.78rem !important;
    color: var(--text-muted) !important;
    padding: 4px 8px !important;
    border-radius: 5px !important;
}

.nav-logout:hover {
    color: var(--text-secondary) !important;
    background: rgba(255,255,255,0.05) !important;
}

/* Mobile toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 58px;
        left: 0; right: 0;
        background: rgba(15, 15, 26, 0.98);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px;
        gap: 4px;
        z-index: 200;
    }
    .nav-links.open { display: flex; }
    .nav-link { width: 100%; }
    .nav-user { flex-wrap: wrap; }
}

/* ─── NOTIFICATIONS ─── */
.notif-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: var(--transition);
}

.notif-unread {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.06);
}

.notif-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.notif-body {
    flex: 1;
}

.notif-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notif-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ─── MESSAGE INBOX ─── */
.msg-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.msg-item:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.msg-unread {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.06);
}

.msg-body {
    flex: 1;
    overflow: hidden;
}

.msg-badge {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    flex-shrink: 0;
}

/* ─── CHAT / CONVERSATION ─── */
.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
}

.chat-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.chat-msg {
    display: flex;
}

.chat-sent {
    justify-content: flex-end;
}

.chat-received {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.chat-sent .chat-bubble {
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-received .chat-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-time {
    display: block;
    font-size: 0.68rem;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.chat-input-form {
    display: flex;
    gap: 8px;
    align-items: center;
}


.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: var(--font);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ─── HERO ─── */
.hero {
    padding: 100px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--accent-glow) 0%, transparent 50%);
    animation: glow-pulse 6s ease-in-out infinite;
}

@keyframes glow-pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, #ec4899 50%, var(--warning) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Market Button — Flashy Animated */
.btn-market {
    background: linear-gradient(135deg, #6366f1, #ec4899, #f59e0b, #6366f1);
    background-size: 300% 300%;
    animation: marketGlow 3s ease infinite;
    color: white !important;
    border: none;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4), 0 0 40px rgba(236, 72, 153, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-market::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
    animation: marketShine 2s ease-in-out infinite;
}

.btn-market:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6), 0 0 60px rgba(236, 72, 153, 0.3);
    color: white !important;
}

@keyframes marketGlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes marketShine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* Hero Tagline — Compact & Shimmery */
.hero-tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 auto;
    max-width: 500px;
    background: linear-gradient(90deg, var(--text-muted), var(--accent), #ec4899, var(--text-muted));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: taglineShimmer 4s linear infinite;
    font-weight: 500;
    letter-spacing: 0.5px;
}

@keyframes taglineShimmer {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* ─── STATS BAR ─── */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding: 40px 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── SECTION ─── */
.section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
}

.section-title .emoji {
    margin-right: 8px;
}

/* ─── CARDS GRID ─── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* ─── MARKET GRID (4 columns, compact) ─── */
.market-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.market-section {
    padding: 24px 0 40px;
}

.market-section .section-header {
    margin-bottom: 16px;
}

.market-section .category-filter {
    margin-bottom: 16px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #ec4899, var(--warning));
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover::after {
    opacity: 1;
}

.product-card .p-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    width: fit-content;
}

.product-card .p-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .p-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.product-card .p-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.product-card .p-price {
    font-size: 1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--success), #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-card .p-stock {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.product-card .p-stock.in-stock {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.product-card .p-stock.out-stock {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
}

.product-card .p-seller {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.product-card .p-seller .mini-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    font-weight: 700;
    color: white;
}

@media (max-width: 1100px) {
    .market-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .market-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .market-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── MARKET HEADER ─── */
.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 24px;
    margin-bottom: 16px;
}

.market-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.market-icon {
    font-size: 2rem;
    background: var(--accent);
    padding: 8px;
    border-radius: 10px;
}

.market-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.market-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.market-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mkt-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font);
}

.mkt-btn-primary {
    background: var(--accent);
    color: white;
}

.mkt-btn-primary:hover {
    background: var(--accent-hover);
    color: white;
}

.mkt-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.mkt-btn-secondary:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.mkt-balance {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
}

/* ─── MARKET LAYOUT (grid + sidebar) ─── */
.market-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
}

@media (max-width: 900px) {
    .market-layout {
        grid-template-columns: 1fr;
    }
}

/* ─── BUY CARDS GRID ─── */
.market-grid-buy {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 1100px) {
    .market-grid-buy {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .market-grid-buy {
        grid-template-columns: 1fr;
    }
}

/* ─── BUY CARD ─── */
.buy-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.buy-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.buy-card-top {
    padding: 14px 14px 10px;
}

.buy-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    text-decoration: none;
}

.buy-card-title:hover {
    color: var(--accent);
}

.buy-card-badges {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.badge-stock {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--success);
}

.buy-card-price-section {
    padding: 10px 14px;
    margin: 0 14px;
    border-radius: 6px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.buy-card-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.buy-card-price-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.buy-card-form {
    padding: 10px 14px 14px;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.buy-card-qty-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qty-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.buy-card-qty {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.82rem;
    cursor: pointer;
    font-family: var(--font);
}

.buy-card-seller {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.buy-card-seller .mini-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: white;
}

.buy-card-btn {
    width: 100%;
    padding: 9px;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    display: block;
    font-family: var(--font);
}

.buy-card-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: white;
}

.buy-card-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ─── SIDEBAR ─── */
.market-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}

.sidebar-card-header {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-cat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
}

.sidebar-cat-item:hover,
.sidebar-cat-item.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.sidebar-cat-count {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.sidebar-seller-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
}

.sidebar-seller-item:last-child {
    border-bottom: none;
}

.seller-rank {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.seller-name {
    flex: 1;
    color: var(--text-secondary);
    font-weight: 500;
}

.seller-sales {
    font-weight: 700;
    color: var(--success);
    font-size: 0.78rem;
}

.sidebar-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.sidebar-stat-row:last-child {
    border-bottom: none;
}

/* ─── POST CARD ─── */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.post-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #ec4899);
    opacity: 0;
    transition: var(--transition);
}

.post-card:hover::before {
    opacity: 1;
}

.post-card a {
    color: inherit;
}

.post-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-keys-count {
    color: var(--success);
    font-weight: 600;
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 10px 0;
    line-height: 1.5;
}

/* ─── KEY DETAIL PAGE ─── */
.key-detail {
    padding: 40px 0;
}

.key-detail-header {
    margin-bottom: 32px;
}

.key-detail-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.key-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 24px 0;
}

.key-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.key-item:hover {
    border-color: var(--accent);
}

.key-text {
    user-select: all;
    word-break: break-all;
}

.copy-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--accent-hover);
}

.copy-btn.copied {
    background: var(--success);
}

/* ─── COMMENTS ─── */
.comments-section {
    margin-top: 40px;
}

.comment {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.comment-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.comment-form {
    margin-top: 24px;
}

.comment-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    resize: vertical;
    transition: var(--transition);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.comment-form .btn {
    margin-top: 10px;
}

/* ─── CID TOOL ─── */
.cid-hero {
    padding: 60px 0;
    text-align: center;
}

.cid-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.cid-tool-box {
    max-width: 700px;
    margin: 32px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.cid-input {
    width: 100%;
    padding: 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    transition: var(--transition);
}

.cid-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.cid-result {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.cid-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.cid-step {
    text-align: center;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.cid-step-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
    margin-bottom: 8px;
}

/* ─── FORMS (AUTH) ─── */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 40px 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
}

.auth-card h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

select.form-input {
    cursor: pointer;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── ADMIN ─── */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.admin-card h3 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

/* ─── CATEGORY FILTER ─── */
.category-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.category-pill {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.category-pill:hover,
.category-pill.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ─── FLASH MESSAGES ─── */
.flash-container {
    margin-top: 16px;
}

.flash {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.flash-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.flash-close {
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 4px;
}

/* ─── ERROR PAGE ─── */
.error-page {
    text-align: center;
    padding: 100px 20px;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--accent);
}

.error-message {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin: 12px 0 24px;
}

/* ─── FOOTER ─── */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 60px 0 24px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-col p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-col a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ─── PAGINATION ─── */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
}

.page-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    transition: var(--transition);
}

.page-link:hover,
.page-link.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ─── FEATURES GRID ─── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .nav-user {
        margin: 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}