/* =============================================================
   COMPONENTS.CSS
   Buttons, Badges, Alerts, Price Cards
   ============================================================= */


/* ── 1. BUTTONS ──────────────────────────────────────────── */

.btn {
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    border: 1.5px solid #0f172a;
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #0f172a;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.btn-primary:active { transform: scale(0.96); }

.btn-block { width: 100%; }


/* ── 2. BADGES & ALERTS ──────────────────────────────────── */

.badge-new {
    background: var(--primary);
    color: #0f172a;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
    display: inline-block;
}

.alert {
    background: var(--primary-subtle);
    border: 1px solid var(--primary);
    color: var(--text-primary);
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.alert:not([hidden]) { display: flex; }

.alert strong { font-weight: 700; }

.alert-info {
    background: var(--primary-subtle);
    border-color: var(--primary);
}


/* ── 3. PRICE CARDS ──────────────────────────────────────── */

.price-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    box-shadow: var(--shadow);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.price-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.price-card:active { transform: scale(0.98); }

/* Left column */
.pc-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0; /* allow text truncation */
}

.pc-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Verified checkmark (green circle) */
.pc-verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--success);
    border-radius: 50%;
    flex-shrink: 0;
}

.pc-verified svg { color: #fff; }

/* Market link */
.pc-market {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.pc-market:hover { color: var(--primary); }

/* Time */
.pc-time {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Right column */
.pc-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

/* Price */
.pc-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* Price change */
.pc-change {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    font-weight: 700;
}

.pc-change.up   { color: var(--danger); }
.pc-change.down { color: var(--success); }
.pc-change.same { color: var(--text-secondary); }

/* Reporter */
.pc-reporter {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--text-secondary);
}

.pc-reporter svg { color: var(--success); }

.nav-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--danger);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
    border: 2px solid var(--bg-elevated);
    /* Hidden by default – JS shows it */
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-badge.visible {
    opacity: 1;
    transform: scale(1);
}