/**
 * Trade-in Table Module Styles
 * All styles for Trade-in Tables functionality
 */

/* Trade In Tables DataTables */

.emakx_dt {
    width: 100%;
    border-collapse: collapse !important;
    margin-top: 0px;
    background-color: white;
    box-sizing: border-box !important;
}

.emakx_dt thead:first-child tr:first-child th {
    border-block-start: none;
}

table.emakx_dt>thead>tr>th, table.emakx_dt>tbody>tr>td {
    padding: 8px 10px;
    border-bottom: none;
    border-left: none;
    border-right: none;
    text-align: center;
    vertical-align: middle;
}

.emakx_dt th {
    background-color: #ffeb00 !important;
    text-align: center;
    padding: 8px 4px !important;
    color: black;
    font-size: 13px;
    position: relative;
    font-weight: 700 !important;
    border-bottom: none !important;
    border-right: none !important;
    border-left: none !important;
}

table.dataTable tr.dtrg-group.dtrg-level-0 th {
    font-weight: bold;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 13px 20px !important;
    background-color: #fff !important;
    color: #000 !important;
    position: sticky !important;
    top: 0;
    z-index: 3;
    text-align: center;
}

.emakx_dt tr:nth-child(even):not(.dtrg-group) {
    background-color: rgba(255, 235, 0, 0.1);
}

.sticky-group {
    position: sticky !important;
    top: 0;
    z-index: 2;
}

.dt-search label {
    display: none !important;
}

div.dt-container .dt-search input {
    padding: 8px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 33px;
    font-size: 14px;
    color: #000;
    min-width: 266px;
}

.dt_emakx_flex_row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
}

.dt_emakx_flex_row .dt_emakx_flex_col:first-child {
    flex: 1 1 100%;
    padding-bottom: 4px;
}

.dt_emakx_flex_col.table_title {
    flex-grow: 1;
    font-size: 24px;
    font-weight: bold;
}

.dt_emakx_flex_col.custom-brand-filter {
    min-width: 266px;
}

div.dt-processing>div:last-child>div {
    background: rgb(0 0 0);
}

div.dt-processing {
    top: 22px;
}

.dt_emakx_flex_row label {
    display: none;
}

.brand-filter {
    border: 1px solid #E5E5E5 !important;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding: 8px 10px;
}

.dt-column-title svg {
    margin-bottom: -3px;
}

.dt-column-title {
    text-transform: capitalize;
}

.emakx_dt abbr[rel~="tooltip"] {
    position: relative;
    cursor: pointer;
}

.emakx_dt abbr[title] {
    text-decoration: none !important;
}

.emakx_dt abbr.mmx-icon-help-circled {
    padding-left: 5px;
}

.emakx_dt i.mmx-icon-link-ext {
    margin-right: 10px;
}

.emakx_dt tbody>tr:nth-child(odd)>td, .emakx_dt tbody>tr:nth-child(odd)>th {
    background-color: #ffffff;
}

table.dataTable th.dt-type-numeric, table.dataTable th.dt-type-date, table.dataTable td.dt-type-numeric, table.dataTable td.dt-type-date {
    text-align: center;
}

/* ToolTip */
/* tooltip related css start here */
#tooltip {
    text-align: left;
    color: #fff;
    background: #212121;
    position: absolute;
    z-index: 100;
    padding: 12px 12px 12px 12px;
    max-width: 340px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 12px;
    line-height: normal;
}

#tooltip:after {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #212121;
    content: "";
    position: absolute;
    left: 50%;
    bottom: -10px;
    margin-left: -10px;
}

#tooltip.top:after {
    border-top-color: transparent;
    border-bottom: 10px solid #212121;
    top: -20px;
    bottom: auto;
}

abbr[rel~="tooltip"] {
    position: relative;
    cursor: pointer;
}

#tooltip.left:after {
    left: 10px;
    margin: 0;
}

#tooltip.right:after {
    right: 10px;
    left: auto;
    margin: 0;
}

#trade-in-table-new .fixed-width-column {
    width: 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
}

#trade-in-table-used .fixed-width-column {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
}

/* Handle overflow in cells if needed */
#trade-in-table_new td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

table.emakx_dt>tbody>tr>td:first-child {
    text-align: left;
    padding: 17px 32px;
}

.trade-in-table-post-url {
    color: #007cba;
    text-decoration: none;
}

.trade-in-table-post-url:hover {
    text-decoration: underline;
}

/* Mobile Responsive Styles */
@media only screen and (max-width: 480px) {
    .trade-in-table-post-url {
        font-size: 9px !important;
        line-height: 10px !important;
    }
    
    .dt_emakx_flex_col.custom-brand-filter {
        min-width: unset;
        padding-right: 10px;
    }
    
    .dt_emakx_flex_row {
        flex-wrap: wrap;
        gap: 0px;
        margin: 12px 0;
    }
    
    .dt_emakx_flex_row .dt_emakx_flex_col:first-child {
        flex: 1 1 100%;
        padding-bottom: 4px;
    }
    
    div.dt-container .dt-search input {
        min-width: unset;
        margin: 0;
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .dt_emakx_flex_col {
        width: 50%;
    }
    
    .dt_emakx_flex_col.table_title {
        font-size: 16px;
        width: 100%;
    }
    
    table.emakx_dt>tbody>tr>td:first-child {
        text-align: left;
        padding: 15px 5px;
    }
    
    #trade-in-table-new .fixed-width-column {
        width: 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
    }
    
    #trade-in-table-used .fixed-width-column {
        width: auto !important;
        min-width: unset !important;
        max-width: unset !important;
    }

    table.dataTable tr.dtrg-group.dtrg-level-0 th {
        font-size: 8px !important;
        padding: 13px 12px !important;
    }

    table.emakx_dt>thead>tr>th {
        font-size: 6px !important;
    }
    
    table.emakx_dt>tbody>tr>td {
        font-size: 8px !important;
    }

    .emakx_dt abbr.mmx-icon-help-circled {
        padding-left: 0px;
        display: block;
    }
    
    .emakx_dt i.mmx-icon-link-ext {
        margin-right: 5px;
    }

    .custom-brand-filter .brand-filter {
        padding: 6px 8px;
        font-size: 12px;
    }

    .emakx_dt.emakx_dt>thead>tr>th:first-child {
        width: 200px !important;
    }
}