/* ===================================================
   WALLET X-RAY — Solana Wallet Analyser
   Military / CRT dark theme — #14F195 accent
   =================================================== */

/* --- Container --- */
.wx-container {
    max-width: clamp(900px, 88vw, 1400px);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* --- Input Bar --- */
.wx-input-bar {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    background: rgba(16, 16, 16, 0.9);
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.wx-input-bar input {
    flex: 1;
    min-width: 200px;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid #333;
    color: #d8d8d8;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.65rem 1rem;
    letter-spacing: 0.5px;
    outline: none;
    transition: border-color 0.3s;
}

.wx-input-bar input:focus {
    border-color: #14F195;
    box-shadow: 0 0 8px rgba(20, 241, 149, 0.15);
}

.wx-input-bar input::placeholder {
    color: #555;
    letter-spacing: 1px;
}

.wx-btn {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 0.65rem 1.5rem;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.wx-btn-scan {
    background: rgba(20, 241, 149, 0.1);
    border-color: rgba(20, 241, 149, 0.4);
    color: #14F195;
}

.wx-btn-scan:hover:not(:disabled) {
    background: rgba(20, 241, 149, 0.2);
    border-color: #14F195;
    box-shadow: 0 0 15px rgba(20, 241, 149, 0.2);
}

.wx-btn-scan:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.wx-btn-wallet {
    background: rgba(255, 255, 255, 0.04);
    border-color: #444;
    color: #999;
}

.wx-btn-wallet:hover {
    border-color: #14F195;
    color: #14F195;
}

.wx-btn-wallet.connected {
    border-color: rgba(20, 241, 149, 0.5);
    color: #14F195;
}

.wx-or {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: #555;
    display: flex;
    align-items: center;
    letter-spacing: 2px;
}

/* --- Loading Overlay --- */
.wx-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1.5rem;
}

.wx-loading.active { display: flex; }

.wx-radar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid rgba(20, 241, 149, 0.2);
    position: relative;
    overflow: hidden;
}

.wx-radar::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 50%; height: 50%;
    transform-origin: 0 0;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(20, 241, 149, 0.3) 40deg, transparent 80deg);
    animation: wx-sweep 2s linear infinite;
}

.wx-radar::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 6px; height: 6px;
    background: #14F195;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px #14F195;
}

.wx-radar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(20, 241, 149, 0.1);
}

.wx-radar-ring:nth-child(1) { width: 33%; height: 33%; top: 33.5%; left: 33.5%; }
.wx-radar-ring:nth-child(2) { width: 66%; height: 66%; top: 17%; left: 17%; }

@keyframes wx-sweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.wx-loading-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #14F195;
    letter-spacing: 3px;
    animation: wx-blink 1s step-end infinite;
}

.wx-loading-sub {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: #666;
    letter-spacing: 1px;
}

@keyframes wx-blink {
    50% { opacity: 0.4; }
}

/* --- Results Container --- */
.wx-results {
    display: none;
}

.wx-results.active { display: block; }

/* --- Section Panels --- */
.wx-panel {
    background: rgba(16, 16, 16, 0.85);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.wx-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(20, 241, 149, 0.4), transparent);
}

.wx-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.wx-panel-icon {
    font-size: 0.9rem;
    opacity: 0.7;
}

.wx-panel-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #14F195;
}

.wx-panel-count {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: #666;
    margin-left: auto;
    letter-spacing: 1px;
}

.wx-panel-body {
    padding: 1.25rem;
}

/* --- Overview Grid --- */
.wx-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.wx-stat-card {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid #222;
    padding: 1rem;
    position: relative;
}

.wx-stat-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(20, 241, 149, 0.15), transparent);
}

.wx-stat-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: #666;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.wx-stat-value {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #14F195;
    letter-spacing: 1px;
}

.wx-stat-value.sol { color: #14F195; }
.wx-stat-value.usd { color: #d0d0d0; }

.wx-stat-sub {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: #555;
    margin-top: 0.3rem;
}

.wx-activity-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 0.2rem 0.6rem;
    border: 1px solid;
}

.wx-activity-badge.active {
    color: #14F195;
    border-color: rgba(20, 241, 149, 0.4);
    background: rgba(20, 241, 149, 0.08);
}

.wx-activity-badge.dormant {
    color: #c9a227;
    border-color: rgba(201, 162, 39, 0.4);
    background: rgba(201, 162, 39, 0.08);
}

.wx-activity-badge.new {
    color: #7B61FF;
    border-color: rgba(123, 97, 255, 0.4);
    background: rgba(123, 97, 255, 0.08);
}

.wx-activity-badge.dead {
    color: #ff4444;
    border-color: rgba(255, 68, 68, 0.4);
    background: rgba(255, 68, 68, 0.08);
}

/* --- Token Table --- */
.wx-token-table {
    width: 100%;
    border-collapse: collapse;
}

.wx-token-table thead th {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: #666;
    letter-spacing: 2px;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.wx-token-table tbody tr {
    border-bottom: 1px solid rgba(42, 42, 42, 0.4);
    transition: background 0.2s;
}

.wx-token-table tbody tr:hover {
    background: rgba(20, 241, 149, 0.03);
}

.wx-token-table td {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #ccc;
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
}

.wx-token-row-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.wx-token-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #222;
    border: 1px solid #333;
    object-fit: cover;
    flex-shrink: 0;
}

.wx-token-logo-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: #555;
    flex-shrink: 0;
}

.wx-token-name {
    font-size: 0.7rem;
    color: #ddd;
    font-weight: 500;
}

.wx-token-symbol {
    font-size: 0.55rem;
    color: #666;
    letter-spacing: 1px;
}

.wx-token-value { color: #14F195; }

.wx-change-pos { color: #14F195; }
.wx-change-neg { color: #ff4444; }
.wx-change-zero { color: #555; }

.wx-token-mint {
    font-size: 0.55rem;
    color: #444;
    cursor: pointer;
    transition: color 0.2s;
}

.wx-token-mint:hover { color: #14F195; }

/* --- NFT Grid --- */
.wx-nft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.wx-nft-card {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid #222;
    overflow: hidden;
    transition: all 0.25s;
}

.wx-nft-card:hover {
    border-color: rgba(20, 241, 149, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(20, 241, 149, 0.1);
}

.wx-nft-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #111;
    display: block;
}

.wx-nft-img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 1.5rem;
}

.wx-nft-info {
    padding: 0.6rem;
}

.wx-nft-name {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wx-nft-collection {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: #555;
    letter-spacing: 1px;
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Transaction List --- */
.wx-tx-list {
    display: flex;
    flex-direction: column;
}

.wx-tx-row {
    display: grid;
    grid-template-columns: 120px 1fr 100px 140px;
    gap: 1rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(42, 42, 42, 0.3);
    align-items: center;
    transition: background 0.2s;
}

.wx-tx-row:hover { background: rgba(20, 241, 149, 0.03); }

.wx-tx-sig {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--link-color);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.wx-tx-sig:hover { color: #14F195; }

.wx-tx-type {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 1px;
}

.wx-tx-type.transfer { color: #14F195; }
.wx-tx-type.swap { color: #7B61FF; }
.wx-tx-type.mint { color: #F5A623; }
.wx-tx-type.unknown { color: #666; }

.wx-tx-amount {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #ccc;
    text-align: right;
}

.wx-tx-time {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: #555;
    text-align: right;
}

.wx-tx-header {
    display: grid;
    grid-template-columns: 120px 1fr 100px 140px;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.wx-tx-header span {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: #555;
    letter-spacing: 2px;
}

.wx-tx-header span:nth-child(3),
.wx-tx-header span:nth-child(4) { text-align: right; }

/* --- Wallet Score --- */
.wx-score-container {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: center;
}

.wx-grade-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
}

.wx-grade-circle::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid;
    opacity: 0.2;
}

.wx-grade-letter {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 2px;
}

.wx-grade-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 2px;
    opacity: 0.6;
    margin-top: 0.2rem;
}

.wx-grade-a { color: #14F195; border-color: rgba(20, 241, 149, 0.5); }
.wx-grade-a::before { border-color: #14F195; }
.wx-grade-b { color: #00cc33; border-color: rgba(0, 204, 51, 0.5); }
.wx-grade-b::before { border-color: #00cc33; }
.wx-grade-c { color: #c9a227; border-color: rgba(201, 162, 39, 0.5); }
.wx-grade-c::before { border-color: #c9a227; }
.wx-grade-d { color: #F5A623; border-color: rgba(245, 166, 35, 0.5); }
.wx-grade-d::before { border-color: #F5A623; }
.wx-grade-f { color: #ff4444; border-color: rgba(255, 68, 68, 0.5); }
.wx-grade-f::before { border-color: #ff4444; }

.wx-score-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wx-score-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.wx-score-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.wx-score-item-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: #999;
    letter-spacing: 2px;
}

.wx-score-item-val {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: #14F195;
}

.wx-score-bar-track {
    height: 6px;
    background: #1a1a1a;
    border: 1px solid #222;
    position: relative;
    overflow: hidden;
}

.wx-score-bar-fill {
    height: 100%;
    transition: width 0.8s ease;
    position: relative;
}

.wx-score-bar-fill::after {
    content: '';
    position: absolute;
    right: 0; top: 0;
    width: 2px; height: 100%;
    background: inherit;
    box-shadow: 0 0 8px currentColor;
}

.wx-score-bar-fill.green { background: #14F195; color: #14F195; }
.wx-score-bar-fill.yellow { background: #c9a227; color: #c9a227; }
.wx-score-bar-fill.orange { background: #F5A623; color: #F5A623; }
.wx-score-bar-fill.red { background: #ff4444; color: #ff4444; }

/* --- Empty / Error States --- */
.wx-empty {
    text-align: center;
    padding: 2rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #555;
    letter-spacing: 1px;
}

.wx-error-msg {
    background: rgba(255, 68, 68, 0.05);
    border: 1px solid rgba(255, 68, 68, 0.2);
    color: #ff4444;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: none;
    letter-spacing: 0.5px;
}

.wx-error-msg.active { display: block; }

/* --- Section Loading Spinners --- */
.wx-section-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
}

.wx-mini-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #222;
    border-top-color: #14F195;
    border-radius: 50%;
    animation: wx-spin 0.8s linear infinite;
}

@keyframes wx-spin {
    to { transform: rotate(360deg); }
}

.wx-section-loading span {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: #555;
    letter-spacing: 1px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .wx-input-bar { flex-direction: column; }
    .wx-or { justify-content: center; padding: 0.25rem 0; }

    .wx-overview-grid { grid-template-columns: repeat(2, 1fr); }

    .wx-score-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .wx-tx-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }
    .wx-tx-header { display: none; }
    .wx-tx-amount, .wx-tx-time { text-align: left; }

    .wx-nft-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

    .wx-token-table { font-size: 0.6rem; }
    .wx-token-table .wx-col-change,
    .wx-token-table .wx-col-mint { display: none; }
}

@media (max-width: 480px) {
    .wx-overview-grid { grid-template-columns: 1fr; }
    .wx-stat-value { font-size: 0.9rem; }
    .wx-grade-circle { width: 120px; height: 120px; }
    .wx-grade-letter { font-size: 2rem; }
}
