/* Report DataTable Styling - Uses theme colors from common.css */

/* Theme Colors:
   --primary1: 86,56,40 (#563828) - Dark brown - Headers
   --primary2: 222,225,197 (#DEE1C5) - Light beige - Alternate rows
   --primary3: 155,159,115 (#9B9F73) - Olive green - Hover
   --primary4: 125,110,96 (#7D6E60) - Dark gray-brown - Accents
   --primary5: 80,73,73 (#504949) - Very dark gray
*/

/* DataTable Container */
.dataTables_wrapper {
    font-family: inherit;
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding: 0.75rem 1rem;
    color: rgb(var(--baseColor));
}

/* Table styling - Using theme colors */
.report-datatable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.report-datatable thead th {
    background-color: #ab9684;
    color: rgb(var(--color_white));
    font-weight: 700;
    border: 1px solid  #ab9684;
    border-top: none;
    border-bottom: none;
    padding: 0.5rem 1rem;
    text-align: left;
}

.report-datatable tbody td {
    background-color: #FAF6F5;
    border: 1px solid  #ab9684;
    border-top: none;
    border-bottom: none;
    padding: 0.5rem 1rem;
    vertical-align: middle;
    color: rgb(var(--baseColor));
}

.report-datatable tbody tr:nth-child(even) td {
    background-color: #efe8dd;
    
}

.report-datatable tbody tr:hover td {
    background-color: #937f6e;
    color: rgb(var(--color_white));
}

.report-datatable img {
    vertical-align: middle;
}

/* DataTable Pagination - Using Theme Colors */
.dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
    margin: 0 2px;
    background: #FAF6F5;
    color:  #ab9684;
    border: 1px solid  #ab9684;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.3s ease;
}

.dataTables_paginate .paginate_button:hover {
    background: #937f6e;
    color: rgb(var(--color_white));
    border-color: #937f6e;
}

.dataTables_paginate .paginate_button.active {
    background: rgb(var(--primary1));
    color: rgb(var(--color_white));
    border-color: rgb(var(--primary1));
    font-weight: 700;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgb(var(--primary2));
    color: #937f6e;
}

/* DataTable Search/Filter */
.dataTables_filter input {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgb(var(--primary1));
    border-radius: 0;
    font-size: 0.9rem;
    color: rgb(var(--baseColor));
}

.dataTables_filter input:focus {
    outline: none;
    border-color: rgb(var(--primary1));
    box-shadow: 0 0 5px rgba(86, 56, 40, 0.3);
}

.dataTables_filter input::placeholder {
    color: rgb(var(--primary4));
}

/* DataTable Length */
.dataTables_length select {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgb(var(--primary1));
    border-radius: 0;
    font-size: 0.9rem;
    color: rgb(var(--baseColor));
    background-color: #FAF6F5;
}

.dataTables_length select:focus {
    outline: none;
    border-color: rgb(var(--primary1));
    box-shadow: 0 0 5px rgba(86, 56, 40, 0.3);
}

/* DataTable Info */
.dataTables_info {
    color: rgb(var(--primary4));
}

/* Responsive wrapper */
.table-responsive {
    overflow-x: auto;
}

/* PDF Download Icon */
.report-datatable .pdf-download-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    transition: transform 0.3s ease;
    filter: var(--imgPrimary1);
}

.report-datatable .download-link:hover .pdf-download-icon {
    transform: scale(1.15);
}

/* First column styling - ensure consistent appearance with other columns */
.report-datatable tbody td:nth-child(1) {
    background-color: #FAF6F5 !important;
    text-align: center;
}

.report-datatable tbody tr:nth-child(even) td:nth-child(1) {
    background-color: #efe8dd !important;
}

.report-datatable tbody tr:hover td:nth-child(1) {
    background-color: #937f6e !important;
    color: rgb(var(--color_white));
}

/* Column specific styling */
.report-datatable thead th:nth-child(1),
.report-datatable tbody td:nth-child(1) {
    width: 10%;
    text-align: center;
}

.report-datatable thead th:nth-child(4),
.report-datatable tbody td:nth-child(4) {
    width: 15%;
    text-align: center;
}

.report-datatable thead th:nth-child(5),
.report-datatable tbody td:nth-child(5) {
    width: 12%;
    text-align: center;
}

/* Mobile responsive adjustments */
@media only screen and (max-width: 768px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 1rem;
    }

    .report-datatable thead th,
    .report-datatable tbody td {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .dataTables_paginate .paginate_button {
        padding: 0.4rem 0.6rem;
        margin: 0 1px;
        font-size: 0.85rem;
    }

    .report-datatable .download-link {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
}

@media only screen and (max-width: 480px) {
    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label {
        display: block;
        margin-bottom: 0.5rem;
    }

    .dataTables_wrapper .dataTables_length select,
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        max-width: 100%;
    }

    .report-datatable thead th:nth-child(2),
    .report-datatable thead th:nth-child(3) {
        font-size: 0.8rem;
    }
}
