.stock-page {
    background-color: #FDFCFA;
}

.stock {
    margin: 20px 0;

}

.stock p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #475569;
    margin-bottom: 1.5rem;
}

.stock a {
    color: var(--clr-ocean-blue);

}

.stock span {
    color: var(--clr-ocean-blue);
    text-decoration: underline;
}

.stock-table {
    background-color: #FFFFFF;
    border-radius: 15px;
    padding: 0 6px 20px 6px;
    border: 1px solid #CDCDCD;
    margin: 0 0 100px 0;
}

.stock-table-header {
    display: flex;
    padding: 20px 20px 10px 20px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #CDCDCD;
}

.container h1 {
    font-size: 30px;
    font-weight: 500;
    line-height: 29px;
    color: var(--dim-black);
}

.stock-table-header title {
    display: flex;
    align-items: left;
    gap: 10px;
    font-size: 16px;
    font-weight: 400;
    line-height: 18.75px;
    cursor: pointer;
    color: var(--dim-black);
}

.stock-table-header form {
    display: flex;
    align-items: center;
    width: 51%;
    height: 44px;
    border-radius: 10px;
    padding: 5px 10px 5px 25px;
    gap: 10px;
    border: 1px solid #CDCDCD;
}

.stock-filter .lists1 {
    width: 70%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stock-filter .lists2 {
    width: 30%;
    display: flex;
    justify-content: end;
}

.stock-table-header div {
    display: flex;
    width: 60%;
    gap: 50px;

}

.stock-table-header form input {
    height: 100%;
    width: 88%;
    font-size: 14px;
    font-weight: 400;
    line-height: 16.41px;
    color: var(--dim-black);
}

.stock-filter h1 {
    font-size: 14px;
    font-weight: 400;
    line-height: 16.41px;
    color: var(--dim-black);
    border: 1px solid #CDCDCD;
    border-radius: 10px;
    padding: 10px;
    width: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stock-filter {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    align-items: center;
}

.stock-table table {
    width: 100%;
}

.stock-table table thead th {
    padding: 15px;
    border: 1px solid #CDCDCD;
    text-align: center;
}

.stock-table table thead {
    background-color: #FDFCFA;
}

.stock-table table thead th:first-child {
    background-color: var(--white);
}

.stock-table table tbody tr td {
    padding: 16px;
    border: 1px solid #CDCDCD;
    text-align: center;
}

.stock-table table thead th:last-child,
.stock-table table tbody tr td:last-child {
    border-right: none;
}

.stock-table table thead th:first-child,
.stock-table table tbody tr td:first-child {
    border-left: none;
    border-bottom: none;
    border-right: none;
}

.stock-table table tbody tr:nth-child(20) td:first-child {
    border-bottom: 1px solid #CDCDCD;
}

.stock-table table tbody tr td a,
.stock-table table thead th,
.stock-table table tbody tr td {
    font-size: 14px;
    font-weight: 400;
    line-height: 16.41px;
    color: var(--dim-black);
}

.stock-table table tbody tr td a {
    text-decoration: underline;
    color: var(--clr-ocean-blue);
}

.stock-table table thead th:nth-child(2),
.stock-table table tbody td:nth-child(2) {
    text-align: left;
    padding: 16px 20px;
    min-width: 200px;
}


.stock-table table thead th:first-child,
.stock-table table tbody tr td:first-child {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stock-table table thead th:nth-child(4),
.stock-table table tbody tr td:nth-child(4) {
    text-align: left;

}

.stock-table table thead th:nth-child(2),
.stock-table table thead th:nth-child(3),
.stock-table table thead th:nth-child(5) {
    padding-left: 25px;
}

.stock-table table tbody tr:nth-child(15) td:last-child,
.stock-table table tbody tr:nth-child(16) td:last-child,
.stock-table table tbody tr:nth-child(17) td:last-child,
.stock-table table tbody tr:nth-child(18) td:last-child,
.stock-table table tbody tr:nth-child(1) td:last-child,
.stock-table table tbody tr:nth-child(6) td:last-child,
.stock-table table tbody tr:nth-child(12) td:last-child,
.stock-table table tbody tr:nth-child(7) td:last-child,
.stock-table table tbody tr:nth-child(8) td:last-child,
.stock-table table tbody tr:nth-child(2) td:last-child,
.stock-table table tbody tr:nth-child(4) td:last-child {
    color: var(--clr-emerald-green);
}

.stock-table table tbody tr:nth-child(19) td:last-child,
.stock-table table tbody tr:nth-child(20) td:last-child,
.stock-table table tbody tr:nth-child(5) td:nth-child(6),
.stock-table table tbody tr:nth-child(13) td:last-child,
.stock-table table tbody tr:nth-child(9) td:last-child,
.stock-table table tbody tr:nth-child(10) td:last-child,
.stock-table table tbody tr:nth-child(11) td:last-child,
.stock-table table tbody tr:nth-child(3) td:last-child {
    color: var(--clr-fire-red);
}

/* Add these styles after your existing desktop styles but before the media queries */

/* Make tables scrollable on all devices, not just mobile */
.stock-table-main {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    background-color: #FFFFFF;
    z-index: 1;
    margin-bottom: 20px;
}

/* Ensure tables take full width inside the scrollable container */
.stock-table-main table {
    width: 100%;
    min-width: 800px; /* Ensures wide tables display properly */
}

/* Make first column sticky on all devices, not just mobile */
.stock-table-main table thead th:first-child {
    position: sticky;
    left: 0;
    background-color: #FDFCFA !important;
    z-index: 3;
    box-shadow: 2px 0 5px -2px rgba(0,0,0,0.1);
}

.stock-table-main table tbody td:first-child {
    position: sticky;
    left: 0;
    background-color: #FFFFFF !important;
    z-index: 2;
    box-shadow: 2px 0 5px -2px rgba(0,0,0,0.1);
}

/* Fix for hover effect on sticky columns */
.stock-table-main table tbody tr:hover td:first-child {
    background-color: #F8F9FA !important;
}

@media screen and (max-width: 767px) {
    /* Stock paragraph styling */
    .stock p {
        width: 100%;
    }

    /* Filter and header layout */
    .stock-filter,
    .stock-table-header {
        flex-direction: column;
        gap: 10px;
    }

    /* List widths */
    .lists1,
    .lists2,
    .stock-table-header h1:first-child {
        width: 100% !important;
    }

    /* Filter grid layout */
    .stock-filter .lists1 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    /* List alignment */
    .stock-filter .lists2 {
        justify-content: flex-start;
    }

    /* Header layout */
    .stock-table-header div {
        width: 100%;
        justify-content: flex-start;
    }

    .stock-table-header h1 {
        font-size: 14px;
    }

    /* Table container */
    .stock-table-main {
        width: 100%;
        overflow: scroll;
        -webkit-overflow-scrolling: touch;
        position: relative;
        background-color: #FFFFFF;
        z-index: 1;
    }

    .stock-table-main table {
        width: 100%;
    }

    /* Hide only company name column */
    .stock-table-main table thead th:nth-child(2),
    .stock-table-main table tbody td:nth-child(2) {
        display: none;
    }

    /* Sticky header for first column */
    .stock-table-main table thead th:first-child {
        position: sticky;
        left: 0;
        background-color: #FDFCFA !important;
        z-index: 3;
        box-shadow: 2px 0 5px -2px rgba(0, 0, 0, 0.1);
        border-right: 1px solid #CDCDCD;
        border-bottom: 1px solid #CDCDCD;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 16px;
        min-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Sticky cells for first column */
    .stock-table-main table tbody td:first-child {
        position: sticky;
        left: 0;
        background-color: #FFFFFF !important;
        z-index: 2;
        box-shadow: 2px 0 5px -2px rgba(0, 0, 0, 0.1);
        border-right: 1px solid #CDCDCD;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 16px;
        min-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Table rows */
    .stock-table-main table tbody tr {
        background-color: #FFFFFF;
    }

    /* Row borders */
    .stock-table-main table tbody tr td {
        border-bottom: 1px solid #CDCDCD;
    }

    /* Hover effects */
    .stock-table-main table tbody tr:hover td:first-child {
        background-color: #F8F9FA !important;
    }

    /* Scrollbar styling */
    .stock-table-main::-webkit-scrollbar {
        height: 6px;
    }

    .stock-table-main::-webkit-scrollbar-thumb {
        background: #CDCDCD;
        border-radius: 3px;
    }

    .stock-table-main::-webkit-scrollbar-track {
        background: #F8F9FA;
    }

    /* Firefox scrollbar */
    .stock-table-main {
        scrollbar-width: thin;
        scrollbar-color: #CDCDCD #F8F9FA;
    }

    /* Cell text handling */
    .stock-table-main table tbody tr td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Other table cell styles */
    .stock-table table tbody tr td {
        padding: 16px;
        border: 1px solid #CDCDCD;
        text-align: center;
    }

    /* Remove unwanted borders */
    .stock-table-main table thead th:first-child,
    .stock-table-main table tbody td:first-child {
        border-left: none;
    }

    /* Text alignment for other cells */
    .stock-table table tbody tr td,
    .stock-table table thead tr th {
        text-align: left;
        padding-left: 16px;
    }
}


@media screen and (max-width: 380px) {
    .stock-filter .lists1 {
        grid-template-columns: repeat(2, 1fr);
    }
}
