/* ============================================
   Token Shop — page styles
   Layered on top of style.css + referral.css.
   Same gold-on-black palette / Exo 2 typography.
   ============================================ */

/* -------- Top balance bar -------- */

.token-bar {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    background:
        linear-gradient(135deg, rgba(218, 165, 32, 0.12) 0%, rgba(184, 137, 26, 0.04) 100%),
        rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(218, 165, 32, 0.35);
    border-radius: 18px;
    box-shadow: var(--shadow-gold);
    position: relative;
    overflow: hidden;
}

.token-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 0% 50%, rgba(218, 165, 32, 0.18) 0%, transparent 40%),
        radial-gradient(circle at 100% 50%, rgba(218, 165, 32, 0.12) 0%, transparent 40%);
}

.token-bar-balance,
.token-bar-actions {
    position: relative;
    z-index: 1;
}

.token-bar-label {
    color: var(--text-gray);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.token-bar-value {
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.token-bar-value i {
    -webkit-text-fill-color: initial;
    color: var(--primary-gold);
    margin-right: 0.5rem;
}

.token-bar-unit {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-gray);
    -webkit-text-fill-color: var(--text-gray);
    margin-left: 0.5rem;
}

.token-bar-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.token-bar-anon {
    text-align: left;
}
.token-bar-anon strong {
    color: var(--text-white);
    font-weight: 700;
}

/* -------- Token balance card on dashboard -------- */

.stat-card-tokens {
    border-color: rgba(218, 165, 32, 0.45);
    background:
        linear-gradient(135deg, rgba(218, 165, 32, 0.08) 0%, rgba(10, 10, 10, 0.8) 60%);
    position: relative;
    overflow: hidden;
}

.stat-card-tokens::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -40%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(218, 165, 32, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card-tokens .stat-card-label i {
    margin-right: 0.4rem;
    color: var(--primary-gold);
}

.stat-card-link {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}
.stat-card-link:hover { color: var(--text-white); }

/* -------- Category filters -------- */

.category-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-pill {
    background: transparent;
    border: 1px solid rgba(218, 165, 32, 0.3);
    color: var(--text-gray);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    border-color: var(--primary-gold);
    color: var(--text-white);
}

.filter-pill.active {
    background: var(--gradient-gold);
    border-color: var(--primary-gold);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.35);
}

/* -------- Catalog grid -------- */

.token-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.5rem;
}

.catalog-card {
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(218, 165, 32, 0.18);
    border-radius: 14px;
    padding: 1.5rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.catalog-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 80% 0%, rgba(218, 165, 32, 0.12) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.catalog-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-gold);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(218, 165, 32, 0.4);
}
.catalog-card:hover::before { opacity: 1; }

.catalog-card.is-out {
    opacity: 0.55;
    filter: grayscale(0.4);
}

.catalog-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.25) 0%, rgba(218, 165, 32, 0.05) 100%);
    border: 1px solid rgba(218, 165, 32, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--primary-gold);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.catalog-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    position: relative;
    z-index: 1;
}

.catalog-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.category-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary-gold);
    border: 1px solid rgba(218, 165, 32, 0.4);
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    font-weight: 700;
    background: rgba(218, 165, 32, 0.06);
}

.server-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-gray);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    font-weight: 600;
}
.server-badge i { margin-right: 0.3rem; }

.stock-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-gray);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    font-weight: 600;
}
.stock-badge.stock-low {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.08);
}
.stock-badge.stock-out {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.08);
}

.catalog-card h3 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-white);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.catalog-card p {
    margin: 0;
    color: var(--text-gray);
    font-size: 0.92rem;
    line-height: 1.5;
}

.catalog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(218, 165, 32, 0.15);
    position: relative;
    z-index: 1;
}

.catalog-card-cost {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-white);
}
.catalog-card-cost i {
    color: var(--primary-gold);
    font-size: 1.1rem;
}

/* -------- Modal -------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: modalFade 0.2s ease;
}

@keyframes modalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(180deg, rgba(26, 20, 0, 0.9) 0%, rgba(10, 10, 10, 0.98) 100%);
    border: 1px solid rgba(218, 165, 32, 0.4);
    border-radius: 18px;
    padding: 2rem 2rem 1.75rem;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(218, 165, 32, 0.15);
    animation: modalRise 0.25s ease;
}

@keyframes modalRise {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover {
    border-color: var(--primary-gold);
    color: var(--text-white);
}

.modal-header h2 {
    color: var(--text-white);
    font-weight: 800;
    letter-spacing: 0.3px;
}

.cost-summary {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(218, 165, 32, 0.18);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 1.25rem;
}

.cost-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0;
    color: var(--text-gray);
    font-size: 0.95rem;
}
.cost-row span:last-child {
    color: var(--text-white);
    font-weight: 600;
}
.cost-row-total {
    border-top: 1px solid rgba(218, 165, 32, 0.2);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    font-size: 1.05rem;
    font-weight: 700;
}
.cost-row-total span:first-child {
    color: var(--text-white);
}

.success-burst {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.25), rgba(74, 222, 128, 0.05));
    border: 2px solid rgba(74, 222, 128, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #4ade80;
    animation: pulse 1.4s ease infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
    50%      { box-shadow: 0 0 0 14px rgba(74, 222, 128, 0); }
}

/* -------- Mobile -------- */

@media (max-width: 768px) {
    .token-bar {
        padding: 1.25rem;
        flex-direction: column;
        align-items: flex-start;
    }
    .token-bar-value { font-size: 2rem; }
    .token-bar-actions { width: 100%; }
    .token-bar-actions .btn { flex: 1; justify-content: center; }
    .token-catalog { grid-template-columns: 1fr; }
    .modal-content { padding: 1.5rem 1.25rem; }
}
