/**
 * WAAT Front-end Styles
 *
 * Minimal styling without Bootstrap dependency.
 * Compatible with Colibri and other themes.
 *
 * @package WAAT
 */

/* Table Wrapper */
.waat-wrapper {
    width: 100%;
    margin: 20px 0;
    overflow-x: auto;
}

/* Base Table Styles */
.waat-display-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Table Header */
.waat-display-table thead th {
    background-color: #f7f7f7;
    border-bottom: 2px solid #ddd;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 1.3em;
    white-space: nowrap;
}

/* Sortable Headers */
.waat-display-table thead th[data-orderable="true"],
.waat-display-table thead th:not([data-orderable="false"]) {
    cursor: pointer;
    position: relative;
    padding-right: 30px;
}

.waat-display-table thead th:not([data-orderable="false"])::after {
    content: '\2195';
    position: absolute;
    right: 10px;
    color: #999;
    font-size: 12px;
}

.waat-display-table thead th.sorting_asc::after {
    content: '\2191';
    color: #333;
}

.waat-display-table thead th.sorting_desc::after {
    content: '\2193';
    color: #333;
}

/* Table Body */
.waat-display-table tbody td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    color: #666;
}

.waat-display-table tbody tr:hover {
    background-color: #f9f9f9;
}

.waat-display-table tbody tr:last-child td {
    border-bottom: none;
}

/* Alternating Rows */
.waat-display-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* Links in Table */
.waat-display-table a {
    color: #0073aa;
    text-decoration: none;
}

.waat-display-table a:hover {
    color: #005177;
    text-decoration: underline;
}

/* Error Message */
.waat-error {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 20px 0;
}

/* DataTables Integration - Override default styles */
.waat-wrapper .dataTables_wrapper {
    padding: 0;
}

.waat-wrapper .dataTables_length,
.waat-wrapper .dataTables_filter {
    margin-bottom: 15px;
}

.waat-wrapper .dataTables_length select,
.waat-wrapper .dataTables_filter input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.waat-wrapper .dataTables_filter input {
    min-width: 200px;
}

.waat-wrapper .dataTables_info {
    padding-top: 10px;
    color: #666;
    font-size: 13px;
}

.waat-wrapper .dataTables_paginate {
    padding-top: 15px;
    text-align: right;
}

.waat-wrapper .dataTables_paginate .paginate_button {
    display: inline-block;
    padding: 6px 12px;
    margin-left: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    text-decoration: none;
}

.waat-wrapper .dataTables_paginate .paginate_button:hover {
    background: #f7f7f7;
    border-color: #ccc;
}

.waat-wrapper .dataTables_paginate .paginate_button.current {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.waat-wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.waat-wrapper .dataTables_empty {
    text-align: center;
    padding: 30px;
    color: #999;
}
.waat-search {
    margin-bottom: 15px;
    text-align: right;
}
.waat-search-input {
    width: 100%;
    max-width: 300px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
}

.waat-pagination {
    text-align: center;
    margin-top: 15px;
}
.waat-pagination button {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    text-decoration: none;
}
.waat-pagination button:hover {
    background: #f7f7f7;
    border-color: #ccc;
}
.waat-pagination button.active {
    background: #0073aa;
    border-color: #0073aa;              
}
.waat-pagination button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
button.waat-prev {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    margin-right: 40px;
}
button.waat-prev:hover {
    background-color: #005177;
}       
button.waat-next {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    margin-left: 40px;
}
button.waat-next:hover {
    background-color: #005177;
}   
/* Responsive Table */
@media screen and (max-width: 768px) {
    .waat-wrapper {
        margin: 15px -15px;
        padding: 0 15px;
    }

    .waat-display-table {
        font-size: 13px;
    }

    .waat-display-table thead th,
    .waat-display-table tbody td {
        padding: 8px 6px;
    }

    .waat-wrapper .dataTables_length,
    .waat-wrapper .dataTables_filter {
        float: none;
        text-align: left;
        margin-bottom: 10px;
    }

    .waat-wrapper .dataTables_filter input {
        min-width: 100%;
        margin-top: 5px;
    }

    .waat-wrapper .dataTables_paginate {
        text-align: center;
    }

    .waat-wrapper .dataTables_paginate .paginate_button {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* Responsive - Stacked Layout for Small Screens */
@media screen and (max-width: 480px) {
    .waat-display-table thead {
        display: none;
    }

    .waat-display-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }

    .waat-display-table tbody td {
        display: block;
        text-align: right;
        border-bottom: 1px solid #eee;
        padding: 10px 15px;
    }

    .waat-display-table tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: #333;
    }

    .waat-display-table tbody td:last-child {
        border-bottom: none;
    }
}
