
.marketplace-section {
    padding: 60px 20px;
    background: transparent;
    position: relative;
}

.marketplace-container {
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 40px;
    position: relative;
}

.page-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--glass-border);
    position: relative;
    display: inline-block;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.page-header:hover .page-title::after {
    width: 200px;
}

.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-input,
.filter-select {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: linear-gradient(180deg, var(--panel), rgba(255,255,255,0.005));
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: all .2s ease;
}

.filter-input::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

.filter-input:focus,
.filter-select:focus {
    border-color: rgba(46,195,150,0.4);
    box-shadow: 0 0 0 3px rgba(96,149,190,0.06), 0 4px 12px rgba(2,6,23,0.12);
    transform: translateY(-1px);
}

.filter-select option {
    background: #0d1117;
    color: var(--text);
}

.companies-table-wrapper {
    background: linear-gradient(180deg, var(--panel), rgba(255,255,255,0.005));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(2,6,23,0.3);
    position: relative;
}

.companies-grid-mobile {
    display: none;
}

.companies-table-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: transparent;
    opacity: 0;
    transition: none;
}

.companies-table-wrapper:hover::before {
    opacity: 0;
}

.companies-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.companies-table thead {
    border-bottom: 1px solid var(--glass-border);
}

.companies-table th {
    padding: 16px 15px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.companies-table th.text-right {
    text-align: right;
}

.companies-table th.text-center {
    text-align: center;
}

.companies-table td.text-right {
    text-align: right;
}

.companies-table td.text-center {
    text-align: center;
}

.companies-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.companies-table tbody tr:last-child {
    border-bottom: none;
}

.companies-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
    filter: brightness(1.15);
    transform: translateX(2px);
}

.companies-table tbody tr:active {
    transform: translateX(4px);
    filter: brightness(1.1);
}

.companies-table td {
    padding: 16px 15px;
    font-size: 15px;
    color: var(--text);
    vertical-align: middle;
    border: none;
}

.companies-table td.text-right {
    text-align: right;
}

.companies-table tbody tr:hover td:first-child {
    padding-left: 18px;
}

/* Company Info Styling */
.company-info-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.company-logo {
    width: 65px;
    height: 65px;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(96,149,190,0.08), rgba(96,149,190,0.06));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.companies-table tbody tr:hover .company-logo {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(2,6,23,0.12);
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.companies-table tbody tr:hover .company-logo img {
    transform: scale(1.1);
}

.company-details-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.company-name-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.company-name {
    font-weight: 600;
    color: var(--text);
    font-size: 15px;
}

.company-ticker {
    font-family: 'Inter', monospace;
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
}

.company-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.company-industry {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    /* neutral gray pill */
    background: linear-gradient(135deg, rgba(168,184,192,0.15), rgba(168,184,192,0.08));
    border: 1px solid rgba(168,184,192,0.25);
    border-radius: 12px;
    color: rgba(168,184,192,0.9);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background .18s ease, border-color .18s ease;
    box-shadow: none;
}

.share-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    /* neutral gray pill */
    background: linear-gradient(135deg, rgba(168,184,192,0.15), rgba(168,184,192,0.08));
    border: 1px solid rgba(168,184,192,0.25);
    border-radius: 12px;
    color: rgba(168,184,192,0.9);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    box-shadow: none;
}

.companies-table tbody tr:hover .company-industry {
    background: linear-gradient(135deg, rgba(168,184,192,0.25), rgba(168,184,192,0.15));
    border-color: rgba(168,184,192,0.35);
    transform: none;
    box-shadow: none;
}

.companies-table tbody tr:hover .share-type-badge {
    background: linear-gradient(135deg, rgba(168,184,192,0.25), rgba(168,184,192,0.15));
    border-color: rgba(168,184,192,0.35);
    transform: none;
    box-shadow: none;
}

.price-cell,
.marketcap-cell {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
}

.currency-cell{
    font-size: 10px;
}

.venue-cell {
    padding-left: 30px;
    padding-right: 30px;
}

.venue-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    /* clear blue venue pill */
    background: linear-gradient(135deg, rgba(96,149,190,0.18), rgba(96,149,190,0.08));
    border: 1px solid rgba(96,149,190,0.28);
    border-radius: 14px;
    color: rgba(96,149,190,1);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: none;
}

.companies-table tbody tr:hover .venue-badge {
    background: linear-gradient(135deg, rgba(96,149,190,0.26), rgba(96,149,190,0.12));
    border-color: rgba(96,149,190,0.36);
    transform: none;
    box-shadow: none;
}

.text-right {
    text-align: right;
}

.no-companies {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 16px;
}

.no-companies p {
    margin: 0;
}

/* Popup */
.popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.popup-content {
    position: relative;
    background: linear-gradient(180deg, var(--panel), rgba(255,255,255,0.01));
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    max-width: 500px;
    margin: 0 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.popup-content p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    cursor: pointer;
    font-size: 24px;
    color: var(--muted);
    transition: color 0.2s;
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-btn:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

/* Private Company Styles */
/* Private Column and Icon */
.private-column {
    width: 0;
    padding: 0;
    overflow: visible;
}

.private-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease;
    cursor: help;
    pointer-events: none;
    z-index: 10;
}

.private-icon.active {
    opacity: 1;
    pointer-events: auto;
}

.private-icon:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(4px);
    align-items: flex-start;
    justify-content: center;
    transition: opacity 0.8s ease;
    z-index: 10000;
    padding-top: 80px;
    overflow-y: auto;
}

.popup-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid rgba(96, 149, 190, 0.3);
    color: var(--text);
    padding: 2.5rem 3rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(96, 149, 190, 0.1) inset,
        0 4px 20px rgba(96, 149, 190, 0.15);
    max-width: 500px;
    width: 100%;
    margin: 0 20px;
}

.popup-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
}

.popup .close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    cursor: pointer;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.6) !important;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup .close-btn:hover {
    color: rgba(255, 255, 255, 0.95) !important;
    background: rgba(96, 149, 190, 0.2);
    transform: scale(1.1);
}

/* Responsive Design */

@media (max-width: 920px) {
    .marketplace-section {
    padding: 40px 16px;
}

    .page-title {
    font-size: 32px;
}

    .filters {
        flex-direction: column;
        gap: 12px;
    }

    .filter-input,
    .filter-select {
    min-width: 100%;
}

    .companies-table-wrapper {
    overflow-x: auto;
}

    .companies-table {
    min-width: 900px;
}

    .companies-table th,
    .companies-table td {
        padding: 12px 14px;
        font-size: 14px;
    }

    .company-logo {
        width: 42px;
        height: 42px;
    }

    .company-name {
    font-size: 14px;
}

    .company-ticker {
    font-size: 13px;
}

    .company-industry {
    font-size: 12px;
}

    .share-type-badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    .venue-badge {
        font-size: 11px;
        padding: 4px 12px;
    }
}
@media (max-width: 768px) {
    .marketplace-section {
    padding: 32px 16px;
}

    .page-title {
    font-size: 28px;
}

    .filters {
    flex-direction: column;
}

    .filter-input,
    .filter-select {
    width: 100%;
}
.companies-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    .companies-table {
    min-width: 800px;
}

.company-logo {
    width: 42px;
    height: 42px;
}

    .company-name {
    font-size: 14px;
}

    .company-ticker {
    font-size: 13px;
}
}
@media (max-width: 920px) {
    .marketplace-section {
    padding: 24px 12px;
}

    .page-title {
    font-size: 24px;
}


    .companies-table-wrapper {
    display: none;
}

    .companies-grid-mobile {
        display: flex !important;
        flex-direction: column;
        gap: 16px;
    }

    .company-card-mobile {
        background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        padding: 16px;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
    }

    .company-card-mobile:hover {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.15);
        filter: brightness(1.15);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .company-card-mobile:active {
        transform: translateY(0);
        filter: brightness(1.1);
    }

    .company-card-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
    }

    .company-card-logo {
        width: 48px;
        height: 48px;
        border-radius: 6px;
        overflow: hidden;
        flex-shrink: 0;
    }

    .company-card-logo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .company-card-info {
        flex: 1;
        min-width: 0;
    }

    .company-card-name {
        font-size: 15px;
        font-weight: 700;
        color: var(--text);
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .company-card-ticker {
        font-size: 13px;
        color: var(--muted);
        font-weight: 500;
        text-align: left;
    }

    .company-card-meta {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        margin-top: 6px;
    }

    .company-card-badge {
        display: inline-flex;
        align-items: center;
        padding: 3px 10px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        transition: all 0.2s ease;
    }

    .company-card-badge.industry-badge {
        background: linear-gradient(135deg, rgba(168,184,192,0.12), rgba(168,184,192,0.08));
        border: 1px solid rgba(168,184,192,0.25);
        color: rgba(168,184,192,0.9);
        box-shadow: 0 2px 4px rgba(168,184,192,0.1);
    }

    .company-card-badge.classification-badge {
        background: linear-gradient(135deg, rgba(168,184,192,0.12), rgba(168,184,192,0.08));
        border: 1px solid rgba(168,184,192,0.25);
        color: rgba(168,184,192,0.9);
        box-shadow: 0 2px 4px rgba(168,184,192,0.1);
    }

    .company-card-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(255,255,255,0.05);
    }

    .company-card-detail {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .company-card-label {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--muted);
        font-weight: 600;
        text-align: center;
    }

    .company-card-value {
        font-size: 14px;
        font-weight: 600;
        color: var(--text);
        font-variant-numeric: tabular-nums;
        text-align: center;
    }

    .company-card-value.highlight {
    color: rgba(46,195,150,0.95);
}

    .company-card-trading {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding-top: 8px;
    }

    .company-card-trading .company-card-label {
    text-align: center;
}

    .company-card-trading .venue-badge {
        display: inline-flex;
        align-items: center;
        padding: 6px 20px;
        background: linear-gradient(135deg, rgba(96,149,190,0.12), rgba(46,195,150,0.08));
        border: 1px solid rgba(96,149,190,0.25);
        border-radius: 14px;
        color: rgba(96,149,190,0.95);
        font-size: 12px;
        font-weight: 600;
        box-shadow: 0 2px 4px rgba(96,149,190,0.1);
    }

    .company-card-private-icon {
        position: absolute;
        top: 16px;
        right: 16px;
        color: var(--accent);
        opacity: 0;
        transition: opacity 0.3s ease;
        font-size: 20px;
    }

    .company-card-mobile:hover .company-card-private-icon {
    opacity: 1;
}
}

/* Professional trading table overrides */
.marketplace-section .companies-table-wrapper {
    /* align with `companies.css` visual language */
    background: linear-gradient(180deg, var(--panel), rgba(255,255,255,0.005));
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(2,6,23,0.15);
    width: 100%;
    max-width: none;
    margin: 0;
}

.marketplace-section .companies-table thead {
    background: var(--header-bg);
    border-bottom: 1px solid var(--th-border);
    backdrop-filter: blur(2px);
}

.marketplace-section .companies-table th {
    padding: 12px 16px;
    color: var(--muted);
    letter-spacing: 0.3px;
    font-weight: 700;
}

.marketplace-section .companies-table td {
    padding: 12px 16px;
    color: var(--text);
}

.marketplace-section .companies-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.02);
    transition: transform .18s ease, background .18s ease;
    position: relative;
}

.marketplace-section .companies-table tbody tr:nth-child(even) {
    background: var(--row-alt);
}

.marketplace-section .companies-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
    transform: translateX(2px);
    box-shadow: none;
}

.marketplace-section .companies-table td.price-cell,
.marketplace-section .companies-table td.marketcap-cell {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.marketplace-section .price-up { color: rgba(46,195,150,0.95); }
.marketplace-section .price-down { color: rgba(255,99,132,0.95); }

@media (max-width: 920px) {
    .marketplace-section .companies-table {
        min-width: 900px;
    }
}

.marketplace-section .companies-table-wrapper {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 10px 40px rgba(2,6,23,0.22);
    backdrop-filter: blur(6px);
    width: 100%;
    max-width: none;
    margin: 0;
}

.marketplace-section .companies-table {
    width: 100%;
    border-collapse: collapse;
}

.marketplace-section .companies-table thead {
    position: sticky;
    top: 0;
    z-index: 6;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    color: var(--muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.9px;
}

.marketplace-section .companies-table th {
    padding: 12px 18px;
    font-weight: 700;
    white-space: nowrap;
}

.marketplace-section .companies-table td {
    padding: 16px 20px;
    color: var(--text);
    vertical-align: middle;
}

.marketplace-section .companies-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.02);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    position: relative;
}

.marketplace-section .companies-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.01);
}

.marketplace-section .companies-table tbody tr:hover {
    background: rgba(255,255,255,0.035);
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(2,6,23,0.08);
}

.marketplace-section .companies-table td:first-child,
.marketplace-section .companies-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 7;
    background: transparent;
}

.marketplace-section .company-logo {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 8px 24px rgba(2,6,23,0.08);
}

.marketplace-section .price-up { color: rgba(46,195,150,0.95); }
.marketplace-section .price-down { color: rgba(255,99,132,0.95); }

.market-badge {
    display: inline-block;
    background: rgba(46,195,150,0.1);
    border: 1px solid rgba(46,195,150,0.3);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(46,195,150,0.9);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.market-badge-mbf {
    background: linear-gradient(135deg, rgba(96,149,190,0.22), rgba(96,149,190,0.12));
    border-color: rgba(96,149,190,0.32);
    color: rgba(96,149,190,1);
}

.market-badge-pisces {
    background: rgba(46,195,150,0.1);
    border-color: rgba(46,195,150,0.3);
    color: rgba(46,195,150,0.9);
}

@media (max-width: 920px) {
    .marketplace-section .companies-table td,
    .marketplace-section .companies-table th { padding: 12px 14px; }
    .marketplace-section .company-logo { width:48px; height:48px; }
}

