/* =====================================
   LISTED PAGE
===================================== */

.listed-page {
    min-height: calc(100vh - 78px);
    padding-top: 18px;
}

.listed-page .company-section {
    width: min(1450px, calc(100% - 70px));
    margin: auto;
    padding: 20px 0 70px;
}

.listed-company-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
}

.listed-company-card {
    min-height: 455px;
    padding: 0 24px 22px;

    display: flex;
    flex-direction: column;
    align-items: center;

    position: relative;
    overflow: hidden;

    background: #ffffff;
    border: 1px solid #dbe5ee;
    border-radius: 22px;

    box-shadow: 0 16px 40px rgba(18, 47, 76, 0.10);

    transition:
        transform 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease,
        background-color 0.28s ease;
}

.listed-company-card:hover {
    transform: translateY(-6px);
    border-color: #6876f5;

    box-shadow:
        0 22px 48px rgba(18, 47, 76, 0.16),
        0 0 0 1px rgba(104, 118, 245, 0.08);
}

.listed-company-card.search-hidden {
    display: none !important;
}

/* Listed badge */

.listed-badge {
    align-self: flex-end;
    margin-right: -24px;
    padding: 17px 25px;

    background: linear-gradient(135deg, #3f465f, #555c75);
    color: #ffffff;

    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0 0 0 20px;

    font-size: 15px;
    font-weight: 700;

    box-shadow: 0 8px 20px rgba(48, 56, 88, 0.12);
}

/* Logo */

.listed-logo {
    width: 190px;
    height: 190px;
    margin: 24px 0 16px;
    padding: 10px;

    display: grid;
    place-items: center;

    overflow: hidden;
    border-radius: 18px;
}

.listed-logo img {
    width: 100%;
    height: 100%;

    display: block;
    object-fit: contain;
    object-position: center;
}
.listed-company-card.logo-dark-bg .listed-logo {
    width: 230px;
    height: 190px;
    padding: 24px;
    background: #202533;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.listed-company-card.logo-white-circle .listed-logo {
    width: 190px;
    height: 190px;
    padding: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 25px rgba(13, 41, 74, 0.08);
}

.listed-company-card.logo-wide .listed-logo {
    width: 235px;
}

.listed-company-card.logo-small .listed-logo img {
    width: 78%;
    height: 78%;
}

/* Company name */

.listed-company-card h2 {
    width: 100%;
    min-height: 66px;
    margin: 0 0 18px;

    color: #082a50;

    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
}

/* Sector */

.listed-sector-label {
    width: 100%;
    margin-top: auto;

    color: #8290a7;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.listed-sector-name {
    width: 100%;
    margin-top: 7px;

    color: #082a50;

    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

/* =====================================
   LIST VIEW
===================================== */

.company-list-header {
    width: 100%;
    min-height: 72px;
    padding: 0 20px;

    display: none;
    grid-template-columns:
        minmax(0, 1.7fr)
        minmax(180px, 1fr)
        180px;
    align-items: center;
    gap: 30px;

    color: #74839d;
    border-bottom: 1px solid #dfe6ef;

    font-size: 15px;
    font-weight: 500;
}

.company-list-header.show {
    display: grid;
}

.listed-company-grid.list-view {
    display: flex !important;
    flex-direction: column;
    gap: 0;
}

.listed-company-grid.list-view .listed-company-card {
    width: 100%;
    min-height: 95px;
    padding: 14px 20px;

    display: grid;
    grid-template-columns:
        minmax(0, 1.7fr)
        minmax(180px, 1fr)
        180px;
    align-items: center;
    gap: 30px;

    overflow: visible;

    border: 0;
    border-bottom: 1px solid #dfe6ef;
    border-radius: 0;

    background: transparent;
    box-shadow: none;
}

.listed-company-grid.list-view .listed-company-card:hover {
    transform: none;
    border-color: #dfe6ef;
    background: rgba(104, 118, 245, 0.04);
    box-shadow: none;
}

.listed-company-grid.list-view .listed-badge,
.listed-company-grid.list-view .listed-sector-label,
.listed-company-grid.list-view .listed-sector-name {
    display: none;
}

.listed-company-grid.list-view .listed-logo {
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 5px;

    grid-column: 1;
    grid-row: 1;
    justify-self: start;

    border: 1px solid #dfe6ef;
    border-radius: 9px;
    background: #ffffff;
}

.listed-company-grid.list-view .listed-company-card h2 {
    width: auto;
    min-height: auto;
    margin: 0;
    padding-left: 64px;

    grid-column: 1;
    grid-row: 1;

    overflow: hidden;

    color: #082a50;

    font-size: 17px;
    line-height: 1.4;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.listed-company-grid.list-view .listed-company-card::after {
    content: attr(data-sector);

    grid-column: 2;
    grid-row: 1;

    overflow: hidden;

    color: #687792;

    font-size: 15px;
    line-height: 1.4;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.listed-company-grid.list-view .listed-company-card::before {
    content: "Listed";

    width: 112px;
    min-height: 42px;

    grid-column: 3;
    grid-row: 1;
    justify-self: end;

    display: grid;
    place-items: center;

    border: 1px solid #6876f5;
    border-radius: 12px;

    color: #6876f5;
    background: rgba(104, 118, 245, 0.08);

    font-size: 14px;
    font-weight: 700;
}

/* =====================================
   DARK MODE
===================================== */

[data-theme="dark"] .listed-page {
    background: #111523;
}

[data-theme="dark"] .listed-company-card {
    background: #232634;
    border-color: #303547;
    box-shadow: none;
}

[data-theme="dark"] .listed-company-card:hover {
    border-color: rgba(122, 132, 255, 0.60);

    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.24),
        0 0 0 1px rgba(122, 132, 255, 0.07);
}

[data-theme="dark"] .listed-company-card h2,
[data-theme="dark"] .listed-sector-name {
    color: #f7f8fc;
}

[data-theme="dark"] .listed-sector-label {
    color: #9aa5b9;
}

[data-theme="dark"] .listed-badge {
    background: linear-gradient(135deg, #3b3e4e, #4b4f61);
    color: #ffffff;
}

[data-theme="dark"] .company-list-header {
    color: #a9b1c4;
    border-bottom-color: #292e3e;
}

[data-theme="dark"] .listed-company-grid.list-view .listed-company-card {
    border-bottom-color: #292e3e;
    background: transparent;
}

[data-theme="dark"] .listed-company-grid.list-view .listed-company-card:hover {
    background: rgba(255, 255, 255, 0.025);
}

[data-theme="dark"] .listed-company-grid.list-view .listed-company-card h2 {
    color: #f4f6fc;
}

[data-theme="dark"] .listed-company-grid.list-view .listed-company-card::after {
    color: #aeb5c8;
}

[data-theme="dark"] .listed-company-grid.list-view .listed-logo {
    border-color: #3a4052;
}

[data-theme="dark"] .listed-company-grid.list-view .listed-company-card::before {
    color: #8e96ff;
    border-color: #747cff;
    background: rgba(116, 124, 255, 0.10);
}

/* =====================================
   RESPONSIVE
===================================== */

@media (max-width: 1200px) {
    .listed-company-grid:not(.list-view) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .listed-company-grid:not(.list-view) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .listed-page .company-section {
        width: min(100% - 32px, 1450px);
    }

    .company-list-header {
        grid-template-columns: minmax(0, 1fr) 130px;
    }

    .company-list-header span:nth-child(2) {
        display: none;
    }

    .listed-company-grid.list-view .listed-company-card {
        grid-template-columns: minmax(0, 1fr) 130px;
    }

    .listed-company-grid.list-view .listed-company-card::after {
        display: none;
    }

    .listed-company-grid.list-view .listed-company-card::before {
        grid-column: 2;
    }
}

@media (max-width: 600px) {
    .listed-company-grid:not(.list-view) {
        grid-template-columns: 1fr;
    }

    .listed-company-card {
        min-height: 420px;
    }

    .listed-logo {
        width: 165px;
        height: 165px;
    }

    .listed-badge {
        padding: 14px 20px;
        font-size: 14px;
    }

    .listed-company-card h2 {
        font-size: 20px;
    }

    .company-list-header {
        display: none !important;
    }

    .listed-company-grid.list-view .listed-company-card {
        min-height: 88px;
        padding: 12px;

        grid-template-columns: minmax(0, 1fr) 100px;
        gap: 10px;
    }

    .listed-company-grid.list-view .listed-logo {
        width: 42px;
        height: 42px;
    }

    .listed-company-grid.list-view .listed-company-card h2 {
        padding-left: 54px;
        font-size: 14px;
    }

    .listed-company-grid.list-view .listed-company-card::before {
        width: 92px;
        min-height: 40px;

        font-size: 12px;
    }
}
