/**
 * CSS Styles for RHD Stock DataTable Plugin
 */
/* Price columns */
.rhd-stock-table td:nth-child(6),
.rhd-stock-table td:nth-child(7),
.rhd-stock-table td.dt-right {
    text-align: right;
    font-weight: 600;
}

/* Discounted price highlight */
.rhd-stock-table td:nth-child(7),
.rhd-stock-table td.discounted-price {
    color: #e03131;
    font-weight: 700;
}

/* Actions column */
.rhd-stock-table td:nth-child(8),
.rhd-stock-table td.dt-center {
    text-align: center;
}

/* DataTable container */
.rhd-stock-container {
    margin: 20px 0;
    padding: 10px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Loading state */
.rhd-stock-container.rhd-loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 999;
}

.rhd-stock-container.rhd-loading::after {
    content: "Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    font-weight: 600;
    color: #333;
}

/* Compact table styles */
#rhd-stock-table {
    width: 100% !important;
    font-size: 14px;
}

#rhd-stock-table th,
#rhd-stock-table td {
    padding: 8px 10px;
}

/* Header styling */
#rhd-stock-table thead th {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

/* Price columns */
#rhd-stock-table td:nth-child(6),
#rhd-stock-table td:nth-child(7) {
    text-align: right;
    font-weight: 600;
}

/* Discounted price highlight */
#rhd-stock-table td:nth-child(7) {
    color: #e03131;
}

/* Email button styling */
.rhd-mailto-button {
    display: inline-block;
    padding: 6px 12px;
    background-color: #F47721;
    color: #fff;
    border-radius: 3px;
    text-decoration: none;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.rhd-mailto-button:hover,
.rhd-mailto-button:focus {
    background-color: #e06617;
    color: #fff;
    text-decoration: none;
}

/* Search box styling */
.dataTables_filter input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    background-color: #fff;

    border-radius: 4px;
    /* margin-left: 10px; */
}

/* Pagination styling */
.dataTables_paginate .paginate_button {
    border-radius: 3px;
    border: 1px solid #ddd !important;
}

.dataTables_paginate .paginate_button.current {
    background: #F47721 !important;
    border-color: #F47721 !important;
    color: #fff !important;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .rhd-stock-container {
        overflow-x: auto;
    }

    #rhd-stock-table {
        font-size: 12px;
    }

    #rhd-stock-table th,
    #rhd-stock-table td {
        padding: 6px 8px;
    }

    .rhd-mailto-button {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* When table is in processing state */
.dataTables_processing {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid #ddd;
    border-radius: 3px;
}


/* Orange pagination buttons */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    background-color: #c7c7c7 !important;
    color: #000 !important;
    border: 1px solid #c7c7c7 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: #e06617 !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: #F47721 !important;
    color: white !important;
}

/* Style for mailto button */
.rhd-mailto-button {
    background-color: #F47721 !important;
    color: white !important;
    border: none !important;
    padding: 5px 10px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
}

.rhd-mailto-button:hover {
    background-color: #e06617 !important;
}

/* Prevent text wrapping in specific columns */
#rhd-stock-table td:nth-child(1),
#rhd-stock-table td:nth-child(2),
#rhd-stock-table td:nth-child(4),
#rhd-stock-table td:nth-child(5),
#rhd-stock-table td:nth-child(6) {
    white-space: nowrap !important;
}

#rhd-stock-table th {
    white-space: nowrap !important;
}

.rhd-filters-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.rhd-top-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.rhd-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rhd-filter-group label {
    font-weight: 600;
    margin-bottom: 0;
    white-space: nowrap;
}

.rhd-filter {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 180px;
}


.rhd-filter-button {
    padding: 6px 12px;
    background-color: #F47721;
    border: 1px solid #F47721;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.rhd-filter-button:hover {
    background-color: #e06617;
    color: #fff;
}

/* Length menu styling */
.rhd-length-filter {
    margin-left: auto;
}

#colour-filter,
#drive-type-filter {
    background-color: #fff !important;

}

.dataTables_length select {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff !important;
    min-width: 80px;
}

/* Search container */
.rhd-search-container {
    width: 100%;
}

/* Adjust the default search box */
.dataTables_filter {
    width: 100%;
    margin: 0;
}

.dataTables_filter input {
    width: 100%;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .rhd-top-filters {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .rhd-filter-group {
        width: 100%;
    }

    .rhd-filter,
    .dataTables_length select {
        width: 100%;
    }

    .rhd-length-filter {
        margin-left: 0;
    }
}