#stock-screener {
    display: grid;
    -webkit-box-pack: justify;
    justify-content: space-between;
    align-items: flex-start;
    scrollbar-width: none;
    position: relative;
    grid-template-columns: clamp(320px, 20%, 400px) minmax(0, 1fr);
    color: #221b52;
}

#stock-screener p {
    margin-bottom: 0;
}

#stock-screener h2 {
    font-size: 22px;
    line-height: 26px;
    margin-bottom: 15px;
}

.default-screener {
    display: none;
    background-color: #f0f6ff;
    font-size: 18px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
}

.list-screener,
.result-screener {
    padding: 15px;
}

.list-screener .close-list {
    display: none;
    position: absolute;
    top: 15px;
    right: 10px;
    cursor: pointer;
}

.list-screener {
    transform: translateX(0);
}

.list-screener .list p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    background-color: #f0f2f5;
    padding: 6px 10px;
    margin-bottom: 10px !important;
    border-radius: 6px;
    cursor: pointer;
    transition: all ease-in-out 0.3s;
}

.list-screener .list p.active {
    background-color: #f5a504;
    color: #ffffff;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

p.qty-stock {
    margin-bottom: 0px !important;
}

p.qty-stock span.qty {
    font-size: 28px;
}

p.qty-stock span.name {
    font-weight: 500;
    font-style: italic;
}

p.qty-stock span {
    font-size: 18px;
}

.result-screener .box-title .exchange-name {
    margin-left: 0;
}

.result-screener .filter-screener {
    background-color: #f5a504;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 5px 8px;
    border-radius: 8px;
    cursor: pointer;
}

#result-screener {
    position: relative;
}

#result-screener .box-result {
    overflow-x: auto;
    max-height: 100vh;
    min-height: 550px;
}

#result-screener .box-result::-webkit-scrollbar {
    width: 0px;
}

#result-screener table thead {
    top: 0px;
    z-index: 1;
}

#result-screener table thead td.sort-col {
    cursor: pointer;
}

#result-screener table thead td.sort-col>div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

#result-screener table td.market-symbol {
    position: sticky;
    left: 0px;
}

#result-screener table td:first-child {
    min-width: 30px;
    max-width: 30px;
}

#result-screener table td {
    min-width: 95px;
}

#result-screener table td.market-symbol {
    min-width: 100px;
}

#result-screener table td.market-floor {
    min-width: 80px;
}

#result-screener table td.market-period {
    min-width: 120px;
}

#result-screener table td svg {
    flex-shrink: 0;
}

#result-screener tbody td.market-symbol .tooltip-custom {
    display: none;
    background-color: #f0f6ff;
    color: #333;
    width: 360px;
    text-align: left;
    border-radius: 10px;
    padding: 5px;
    position: absolute;
    z-index: 1000;
    bottom: 80%;
    left: 0px;
    box-shadow: 0px 0px 8px #c8c6c8;
}

#result-screener tbody td.market-symbol:hover .tooltip-custom {
    display: block;
}

#result-screener .tooltip-custom.hide {
    display: none !important;
}

#result-screener .caption p {
    font-size: 14px;
}

.tooltip-custom .info {
    margin: 6px;
}

.tooltip-custom .info .logo-symbol,
.tooltip-custom .link-symbol {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.tooltip-custom .logo-symbol .symbol {
    font-size: 22px;
    line-height: 22px;
    font-weight: bold;
}

.tooltip-custom .logo-symbol svg.tooltip-close {
    margin-left: auto;
    cursor: pointer;
}

.tooltip-custom .financial {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.tooltip-custom .financial .item {
    flex: 1 1 25%;
    background-color: #fff;
    padding: 3px 6px;
    border-radius: 8px;
    text-align: center;
}

.tooltip-custom .info .name,
.tooltip-custom .logo-symbol span:last-child,
.tooltip-custom .financial .item p:first-child {
    font-size: 14px;
}

.tooltip-custom .financial .item p:last-child,
.tooltip-custom .link-symbol a {
    font-size: 15px;
    font-weight: 500;
}

.tooltip-custom .link-symbol {
    margin-top: 10px;
}

.tooltip-custom .link-symbol a {
    background-color: #ceddff;
    color: #12365b;
    padding: 3px 6px;
    border-radius: 6px;
    transition: all ease-in-out 0.3s;
}

.tooltip-custom .link-symbol a:hover {
    background-color: #f5a504;
    color: #fff;
}

.box-screener {
    background-color: rgb(206 221 255 / 80%);
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 10000001;
    transition: all 0.3s ease-in-out;
}

.box-screener.show {
    opacity: 1;
    visibility: visible;
}

.box-screener.hide {
    opacity: 0;
    visibility: hidden;
}

.box-screener .criterion {
    position: relative;
    width: 860px;
    max-height: 95vh;
    margin: 15px auto;
    z-index: 9;
    /* max-height: 696px; */
    padding: 16px;
    background-color: rgb(240 241 245 / 86%);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    /* overflow-y: scroll; */
}

.box-screener .criterion h3 {
    font-size: 22px;
    margin-bottom: 0px;
    line-height: 26px;
    font-weight: 500;
}

.box-screener .criterion .title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.box-screener .screener-close {
    cursor: pointer;
}

.box-screener .screener-close svg {
    width: 28px;
    height: 28px;
}

#form-criterion>div {
    max-height: 70vh;
    overflow-x: hidden;
    margin-bottom: 10px;
}

#form-criterion>div::-webkit-scrollbar {
    width: 2px;
}

.box-screener .content {
    margin-top: 20px;
}

.box-screener .criterion-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.box-screener .criterion-info .criterion-name {
    min-width: 155px;
}

.box-screener .criterion-list {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 12px;
    column-gap: 6px;
}

.box-screener .criterion-list .criterion-item {
    position: relative;
    font-size: 15px;
    background-color: #d8e3ff;
    min-height: 36px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0px 10px;
    margin-right: 6px;
    border-radius: 6px;
    transition: all 0.6s ease;
    cursor: pointer;
}

.criterion-item.value-added {
    background-color: #f5a504 !important;
    font-weight: 500;
}

.criterion-item.value-added .value-added-close svg {
    width: 14px;
    height: 14px;
    margin-left: 6px;
}

.criterion-item .hide {
    display: none;
}

.criterion-item .show {
    position: absolute;
    bottom: 50px;
    right: 0px;
    z-index: 10000002;
    width: max-content;
    color: #fff;
    background-color: #888;
    padding: 10px;
    border-radius: 6px;
}

.criterion-item fieldset {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.criterion-item fieldset label {
    background-color: #fff;
    color: #222;
    padding: 3px 6px;
    border-radius: 6px;
    cursor: pointer;
}

.criterion-item .input-value {
    position: relative
}

.criterion-item .input-value .value {
    width: 120px;
    display: block;
    padding: 6px 10px;
    border: 1px solid #fff;
    border-radius: 8px;
}

.criterion-item .input-value .unit {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 1000000;
    background-color: #888888;
    color: #fff;
    min-width: 16px;
    min-height: 22px;
}

.criterion-item input[type="checkbox"],
.criterion-item input[type="radio"] {
    display: none;
}

.criterion-item input[type="checkbox"]:checked+label,
.criterion-item input[type="radio"]:checked+label {
    background-color: #d8e3ff;
    color: #f5a504;
}

.criterion-item input[type="number"] {
    width: 100%;
    background-color: #888888;
    color: #fff;
    border: none;
    outline: none;
}

.criterion-item input[type="number"]::placeholder {
    color: #fff;
    appearance: none;
}

.criterion-item input[type="number"]:focus {
    box-shadow: none !important;
    border: none;
}

.criterion-item input[type="number"]:focus+span.value {
    border: 1px solid #f5a504;
}

.criterion-item button {
    background-color: #f5a504;
    border: none;
    font-size: 15px;
}

.criterion-item .new-item {
    position: absolute;
    top: -10px;
    right: -6px;
    background-color: #f5294c;
    color: #ffffff;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 6px;
}

#form-criterion button.float-end {
    border: none;
    background-color: #f5a504;
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 1s;
}

#form-criterion button.float-end:hover {
    background-color: #bdbdbf;
}

.loader {
    width: 1.3em;
    height: 1.3em;
    margin-left: 10px;
    display: none;
}

.loader.show {
    display: block;
}

.loader circle {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
}

.loader circle:nth-child(2) {
    stroke: #001f3f;
    animation: rotate 0.6s linear infinite;
    transform-origin: 50% 50%;
    stroke-dasharray: 150;
    stroke-dashoffset: 60;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@media (min-width: 768.1px) {
    #stock-screener .list-screener {
        height: 100vh;
        grid-row: 1 / 999;
        z-index: 1;
        scrollbar-width: none;
        overflow: scroll;
        position: sticky;
        top: 60px;
        border-right: 1px solid #eff2f5;
    }
}

@media (max-width: 1279.98px) {

    #stock-screener .post-content,
    #stock-screener .related-post {
        padding-bottom: 0 !important;
    }
}

@media (max-width: 992px) {
    #stock-screener {
        grid-template-columns: clamp(280px, 20%, 360px) minmax(0, 1fr);
    }

    .box-screener .criterion {
        width: 96%;
    }
}

@media (max-width: 768px) {
    #stock-screener {
        grid-template-columns: minmax(0, 1fr);
    }

    #result-screener table td.market-period {
        display: none;
    }

    .box-screener .criterion-info {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .box-screener .criterion-list {
        justify-content: flex-start;
    }

    .box-screener .criterion-info .criterion-name {
        width: 100%;
    }

    .criterion-item .input-value .value {
        width: 96px;
    }

    .criterion-item .show {
        max-width: 280px;
    }
}

@media (max-width: 576px) {
    .result-screener {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 480px) {
    .default-screener {
        display: block;
    }

    .list-screener {
        position: fixed;
        left: 0;
        top: 0px;
        transform: translateX(-100%);
        z-index: 100002;
        background-color: #ceddff;
        height: 100%;
        transition: all ease-in-out 0.6s;
    }

    .list-screener .close-list {
        display: block;
    }

    .result-header {
        flex-wrap: wrap;
    }

    #result-screener tbody td.market-symbol .tooltip-custom {
        width: calc(100vw - 60px);
    }

    p.qty-stock span.qty {
        font-size: 22px;
    }

    p.qty-stock span,
    .default-screener {
        font-size: 15px;
    }

    #result-screener .caption p {
        font-size: 13px;
    }

    .home .market-table {
        position: relative;
        background-color: #ffffff;
        margin: 10px 0;
        border-radius: 10px;
    }

    .home .market-table .bigtitle {
        text-align: left;
        box-shadow: none;
    }

    .market-table .box-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-flow: wrap;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .market-table .box-title .exchange-name {
        margin-left: 10px;
    }

    .market-table .box-title .exchange-name span {
        font-size: 15px;
        font-weight: 600;
        background-color: #eaeff9;
        height: 36px;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        padding: 0px 10px;
        margin-right: 6px;
        border-radius: 6px;
        transition: all 0.6s ease;
        cursor: pointer;
    }

    .market-table .box-title .exchange-name span.active {
        background-color: #f0f6ff;
        color: #3861fb;
    }

    .market-table table {
        text-align: center;
        margin-bottom: 0px;
        width: 100%;
    }

    .market-table table thead {
        position: sticky;
        top: 60px;
    }

    .market-table table thead tr td {
        background-color: #eaeff9;
        font-weight: 600;
        padding-bottom: 5px;
        padding-top: 5px;
    }

    .market-table table thead tr td span,
    .topstock table thead tr th span {
        font-size: 13px;
        font-weight: 400;
    }

    .market-table table tr td {
        align-content: center;
        padding-top: 15px;
        padding-bottom: 15px;
        background-color: #ffffff;
    }

    .market-table table td.market-symbol a {
        color: #001f3f;
        font-weight: 600;
        text-decoration: none;
    }

    .market-table table td.market-symbol img {
        width: 30px;
        height: 30px;
        margin-right: 6px;
        border-radius: 50%;
        padding: 3px;
        background-color: #efefef;
        object-fit: contain;
    }

    .market-table table td.market-price span {
        padding: 6px 10px;
    }

    .market-table .ty-ajax-loading-box {
        top: 45vh;
    }
}

.home .market-table {
    position: relative;
    background-color: #ffffff;
    margin: 10px 0;
    border-radius: 10px;
}

.home .market-table .bigtitle {
    text-align: left;
    box-shadow: none;
}

.market-table .box-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-flow: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
}

.market-table .box-title .exchange-name {
    margin-left: 10px;
}

.market-table .box-title .exchange-name span {
    font-size: 15px;
    font-weight: 600;
    background-color: #eaeff9;
    height: 36px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0px 10px;
    margin-right: 6px;
    border-radius: 6px;
    transition: all 0.6s ease;
    cursor: pointer;
}

.market-table .box-title .exchange-name span.active {
    background-color: #f0f6ff;
    color: #3861fb;
}

.market-table table {
    text-align: center;
    margin-bottom: 0px;
    width: 100%;
}

.market-table table thead {
    position: sticky;
    top: 60px;
}

.market-table table thead tr td {
    background-color: #eaeff9;
    font-weight: 600;
    padding-bottom: 5px;
    padding-top: 5px;
}

.market-table table thead tr td span,
.topstock table thead tr th span {
    font-size: 13px;
    font-weight: 400;
}

.market-table table tr td {
    align-content: center;
    padding-top: 15px;
    padding-bottom: 15px;
    background-color: #ffffff;
}

.market-table table td.market-symbol a {
    color: #001f3f;
    font-weight: 600;
    text-decoration: none;
}

.market-table table td.market-symbol img {
    width: 30px;
    height: 30px;
    margin-right: 6px;
    border-radius: 50%;
    padding: 3px;
    background-color: #efefef;
    object-fit: contain;
}

.market-table table td.market-price span {
    padding: 6px 10px;
}

.market-table .ty-ajax-loading-box {
    top: 45vh;
}


.tab-container {
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
    gap: 8px;
    justify-content: center;
}

/* Mobile: chuyển thành dạng cột */
@media (max-width: 480px) {
    .tab-container {
        display: block;
    }
}

.tab-item {
    flex: 1 1 auto;
    /* Mỗi dòng 4 nút (25%) trừ đi gap */
    min-width: 150px;
    /* Đảm bảo không quá nhỏ */
    box-sizing: border-box;
    white-space: nowrap;
    padding: 6px 12px;
    text-align: center;
    border-radius: 6px;
    background-color: #f2f2f2;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 14px;
}

.tab-item.active {
    background-color: #ff8b23;
    color: white;
    /* border-color: #6c757d; */
}

@media (max-width: 768px) {
    .tab-item {
        flex: 1 1 auto;
        /* Mỗi dòng 2 nút trên mobile */
    }
}

@media (max-width: 480px) {
    .tab-item {
        flex: 1 1 auto;
        margin: 10px;
        /* Mỗi dòng 1 nút nếu quá hẹp */
    }
}

.color-gradient-heading {
    background-image: linear-gradient(75deg, rgb(213, 0, 249), rgb(41, 98, 255) 68.9%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 8px;
}

.negative,
td.negative {
    color: #fd1414;
}

.positive,
td.positive {
    color: #25a549;
}

.pagination-container {
    display: flex;
    justify-content: center;
}

.pagination-container ul li {
    width: auto;
    height: 32px;
    display: flex;
    justify-content: center;
    justify-items: center;
    align-items: center;
    margin-right: 10px;
    cursor: pointer;
    user-select: none;
    text-align: center;
}

.pagination-container ul li a,
.pagination-container ul li span {
    font-weight: 600;
    font-size: 15px;
    line-height: 20px;
    color: #001f3f;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin: 0;
}

.pagination-container .pagination.pagination-controls {
    margin-top: 15px;
}

.sort-col {
    text-align: center;
    cursor: pointer;
}

.sort-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.sort-header svg {
    flex-shrink: 0;
    margin-top: -2px;
}

.tab-item .loader {
    display: none;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    animation: spin 1s linear infinite;
    stroke: #4D4D4D;
}

.tab-item.loading .loader {
    display: inline-block;
}

.tab-item .loader circle {
    fill: none;
    stroke-width: 4;
    opacity: 0.6;
    stroke-dasharray: 125;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    transform-origin: center;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
        stroke-dashoffset: 0;
    }

    100% {
        transform: rotate(360deg);
        stroke-dashoffset: -125;
    }
}