:root {
    --bg-color: #000000;
    /* Pure Void */
    --surface-color: #000000;
    --border-color: #111;
    --text-primary: #e0e0e0;
    --text-secondary: #555;

    /* Neon Phosphor Colors */
    --accent-buy: #0f0;
    /* Matrix Green */
    --accent-sell: #f05;
    /* Hot Pink/Red */

    --font-main: 'JetBrains Mono', monospace;
    /* Mono everywhere */
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
    /* Force Mono */
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: none;
    /* Crisper text for retro feel */
}

/* Full Width Container - Visual Feast Background */
.app-container {
    max-width: 100%;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: radial-gradient(circle at 50% -20%, #1a1a2e 0%, #000000 60%);
    /* Deep spaced-out glow */
}

/* Header - Glassmorphism */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    /* Slightly more breathing room */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    /* Glass effect */
    height: 48px;
    /* Taller header */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    position: relative;
}

.logo-icon {
    width: 14px;
    height: 14px;
    color: #444;
}

h1 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #444;
    letter-spacing: 0.5px;
}

/* Feed Grid - The Core */
.feed-list {
    display: grid;
    /* Fixed 6 columns, or auto-fit with very small min-width */
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: max-content;
    gap: 0;
    padding: 0;
    overflow: hidden;
    /* Hide scrollbars completely, let it flow */
    border: none;
    background: #000;
    height: calc(100vh - 30px);
}

/* Responsive: drop columns on smaller screens if needed */
/* Responsive Optimization */
@media (max-width: 1400px) {
    .feed-list {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1200px) {
    .feed-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .feed-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .feed-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .feed-list {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Trade Row (Two-Line Data) - Polished */
.trade-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3px 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    /* Softer borders */
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    line-height: 1.25;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    height: 44px;
    /* Slightly taller for desktop too */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.3s ease-out forwards;
    /* Entrance! */

    /* The "Colored Line" */
    border-left: 3px solid #333;
    padding-left: 10px;
    /* More padding */
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
        background: rgba(255, 255, 255, 0.05);
        /* Flash on entry */
    }

    to {
        opacity: 1;
        transform: translateY(0);
        background: transparent;
    }
}

.trade-row:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

/* Two-Line Structure */
.row-top,
.row-bottom {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.row-side {
    font-weight: 700;
    font-size: 11px;
}

.row-value {
    font-weight: 600;
    color: #eee;
    font-size: 11px;
}

.row-wallet {
    font-size: 9px;
    opacity: 0.7;
}

.row-shares {
    font-size: 9px;
    opacity: 0.5;
    text-align: right;
}

.row-wallet a {
    color: inherit;
    text-decoration: none;
}

.row-wallet a:hover {
    color: #fff;
    text-decoration: underline;
}

.trade-row:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* Side Line Colors */
.trade-row.row-buy {
    border-left-color: var(--accent-buy);
}

.trade-row.row-sell {
    border-left-color: var(--accent-sell);
}

.trade-row.row-other {
    border-left-color: var(--text-secondary);
}

/* Row Columns */
.row-side {
    width: 20px;
    font-weight: 700;
    text-align: center;
    margin-right: 4px;
}

.row-value {
    color: #eee;
    font-weight: 500;
    margin-right: 8px;
    min-width: 40px;
    text-align: right;
}

.row-wallet {
    flex: 1;
    color: rgba(255, 255, 255, 0.3);
    font-size: 10px;
}

.row-wallet a {
    color: inherit;
    text-decoration: none;
}

.row-wallet a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Colors (Neon) */
.text-buy {
    color: #00ff88;
}

.text-sell {
    color: #ff0055;
}

.text-other {
    color: #00d4ff;
}

/* Tiers - Just Text Color/Glow */
/* Tiers - Just Text Color/Glow */
.tier-purple .row-value {
    color: #d0f;
    font-size: 13px;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(200, 0, 255, 0.5);
}

.tier-gold .row-value {
    color: #fd0;
    font-size: 15px;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.highlight {
    color: var(--text-secondary);
    font-weight: 400;
}

/* Social Badge (Premium) */
.social-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-right: 20px;
    /* Space from stats */
    backdrop-filter: blur(10px);
    height: 32px;
    box-sizing: border-box;
    cursor: pointer;
}

/* Force text color to white to prevent visited link purple */
.social-badge,
.social-badge:visited,
.social-badge:active,
.social-badge:hover {
    color: #e0e0e0 !important;
}

.social-badge span {
    color: #a0a0a0;
    font-size: 13px;
    font-weight: 500;
    line-height: normal;
    margin-top: 2px;
    /* Visual alignment */
}

.social-badge strong {
    color: #fff;
    font-weight: 700;
}

.social-icon {
    display: block;
    width: 14px;
    height: 14px;
    color: #fff;
    opacity: 0.9;
    flex-shrink: 0;
}

.social-badge:hover {
    background: rgba(29, 161, 242, 0.2);
    border-color: rgba(29, 161, 242, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.3);
}

.social-badge:hover .social-icon {
    color: #1da1f2;
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.social-badge:hover strong {
    color: #1da1f2;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Stats */
.stats-container {
    display: flex;
    gap: 20px;
    margin-right: 20px;
    padding-right: 20px;
    border-right: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Search */
.search-container {
    display: flex;
    align-items: center;
}

.search-icon {
    display: none;
    /* Hide search icon as requested */
}

#market-filter {
    background: #0f0f0f;
    border: 1px solid #222;
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 13px;
    width: 240px;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#market-filter:focus {
    outline: none;
    border-color: #555;
    background: #161616;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

#market-filter::placeholder {
    color: #444;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--surface-color);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #444;
    transition: background-color 0.3s ease;
}

.status-dot.connected {
    background-color: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

.status-dot.disconnected {
    background-color: #ff3333;
}

/* Feed Grid */
.feed-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
    /* Remove container bg to let cards float */
    border: none;
    padding: 0 10px;
    /* Side padding */
}

/* Hide old header */
.feed-header {
    display: none;
}

.feed-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: max-content;
    gap: 12px;
    /* Space between cards */
    padding: 20px 0;
    overflow-y: auto;
    align-content: start;
    content-visibility: auto;
    /* Skip rendering off-screen content */
    contain-intrinsic-size: 100px 300px;
    /* Estimate size */
}

/* Scrollbar */
/* Scrollbar - Sleek */
.feed-list::-webkit-scrollbar {
    width: 4px;
    /* Ultra thin */
}

.feed-list::-webkit-scrollbar-track {
    background: transparent;
}

.feed-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.feed-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Trade Card */
.trade-card {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.trade-card:hover {
    transform: translateY(-4px);
    border-color: #333;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* Flash Animations */
.trade-card.flash-buy {
    background-color: rgba(0, 242, 234, 0.1);
    border-color: rgba(0, 242, 234, 0.3);
}

.trade-card.flash-sell {
    background-color: rgba(255, 0, 85, 0.1);
    border-color: rgba(255, 0, 85, 0.3);
}

/* Card Layout */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-side-buy {
    color: var(--accent-buy);
}

.card-side-sell {
    color: var(--accent-sell);
}

.card-side-other {
    color: #aaaaaa;
}

.card-value {
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.card-market {
    font-size: 14px;
    line-height: 1.4;
    color: #ccc;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Fix lint: standard property needs vendor prefix for broad support */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
    /* Fixed height for 2 lines */
}

/* Color Tiers - Size & Glow (No Lines) */
.tier-purple .row-value {
    color: #d0f;
    font-size: 14px;
    /* Larger */
    font-weight: 700;
    text-shadow: 0 0 10px rgba(200, 0, 255, 0.6);
}

.tier-gold .row-value {
    color: #fd0;
    font-size: 18px;
    /* Massive */
    font-weight: 800;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

/* Remove old card styles just in case, though we use row structure now */
.tier-purple,
.tier-gold {
    border: none;
    box-shadow: none;
    background: transparent;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #222;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.card-price {
    font-weight: 500;
}

.card-size {
    opacity: 0.7;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    /* Mobile Optimizations */
    @media (max-width: 480px) {
        .header {
            flex-direction: column;
            height: auto;
            padding: 12px;
            gap: 12px;
            align-items: flex-start;
        }

        .header-controls {
            width: 100%;
            justify-content: space-between;
            gap: 0;
        }

        .stats-container {
            border-right: none;
            margin-right: 0;
            gap: 15px;
            padding-right: 0;
        }

        /* Better Touch Targets */
        .trade-row {
            height: auto;
            /* Allow flexible height */
            min-height: 44px;
            /* Touch friendly */
            padding: 6px 12px;
        }

        /* Readable Fonts */
        .trade-row {
            font-size: 11px;
            /* Slight bump */
        }

        .row-wallet,
        .row-shares {
            font-size: 10px;
            opacity: 0.8;
        }

        .row-side {
            font-size: 12px;
        }

        .row-value {
            font-size: 12px;
        }

        /* Adjust Feed Height for taller header */
        .feed-list {
            height: calc(100vh - 80px);
        }
    }