/**
 * BillBuddy Bills List Styles
 * Modern, sleek styling for the bills list display
 */

/* Container styles */
.billbuddy-billslist-container {
    font-family: inherit;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    color: #333;
}

/* Filter styles */
.billbuddy-filters {
    margin-bottom: 0;
    display: flex;
    justify-content: center;
}

.billbuddy-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 0;
    justify-content: center;
}

.billbuddy-filter-group {
    position: relative;
    display: inline-block;
}

.billbuddy-filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #24292e;
    cursor: pointer;
    min-width: 120px;
    max-width: 100%;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath fill='%23444d56' d='M6 8.825c-.2 0-.4-.1-.5-.2l-3.3-3.3c-.3-.3-.3-.8 0-1.1.3-.3.8-.3 1.1 0l2.7 2.7 2.7-2.7c.3-.3.8-.3 1.1 0 .3.3.3.8 0 1.1l-3.3 3.3c-.1.1-.3.2-.5.2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s ease;
    width: auto;
}

.billbuddy-filter-select:hover {
    border-color: #d1d5da;
}

.billbuddy-filter-select:focus {
    border-color: #0366d6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.3);
}

.billbuddy-filter-select:disabled {
    background-color: #f6f8fa;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Make sure each dropdown is only as wide as its content plus margin */
.billbuddy-filter-select {
    width: auto;
}

/* Bills table */
.billbuddy-bills-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e4e8;
}

.billbuddy-bills-table thead {
    background-color: #f6f8fa;
}

.billbuddy-bills-table th {
    padding: 16px 18px;
    text-align: left;
    font-weight: 600;
    font-size: 1.1em;
    color: #24292e;
    border-bottom: 1px solid #e1e4e8;
    white-space: nowrap;
}

.billbuddy-bills-table td {
    padding: 10px 18px;
    text-align: left;
    border-bottom: 1px solid #e1e4e8;
    vertical-align: top;
}

.billbuddy-bills-table tr:last-child td {
    border-bottom: none;
}

.billbuddy-bills-table tr:hover {
    background-color: #f6f8fa;
}

/* Column width settings */
.billbuddy-bills-table .bill-number {
    width: auto;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}

.billbuddy-bills-table .bill-title {
    width: 45%;
    vertical-align: middle;
}

.billbuddy-bills-table .bill-summary {
    width: 50%;
}

/* Bill link styles */
.billbuddy-bills-table .billbuddy-bill-link {
    color: #0366d6;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05em;
}

.billbuddy-bills-table .billbuddy-bill-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* No results message */
.billbuddy-no-bills {
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    color: #6a737d;
    font-style: italic;
}

/* Date header styling */
.billbuddy-date-header {
    background-color: rgb(239, 246, 255);
}

.billbuddy-date-header-cell {
    padding: 16px 18px;
    font-size: 1em;
    font-weight: 600;
    color: #24292e;
    text-align: left;
    border-bottom: 2px solid #e1e4e8;
    position: relative;
}

/* Add subtle shadow to date headers for depth */
.billbuddy-date-header-cell::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
}

/* Empty summary placeholder */
.billbuddy-bills-table td.bill-summary em {
    color: #6a737d;
    font-style: italic;
}

/* Pagination styles */
.billbuddy-billslist-pagination {
    margin-top: 30px;
    margin-bottom: 20px;
}

.billbuddy-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.billbuddy-pagination-info {
    flex-basis: 100%;
    text-align: center;
    margin-bottom: 16px;
    font-weight: 600;
    color: #24292e;
}

.billbuddy-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    margin: 0;
    background-color: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    color: #24292e;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.billbuddy-page-link:hover {
    background-color: #f6f8fa;
    border-color: #d1d5da;
    color: #0366d6;
}

.billbuddy-page-link.current {
    background-color: #0366d6;
    border-color: #0366d6;
    color: #fff;
    font-weight: 600;
}

.billbuddy-page-link.disabled {
    color: #d1d5da;
    pointer-events: none;
    cursor: default;
    background-color: #f6f8fa;
    border-color: #e1e4e8;
    opacity: 0.7;
}

.billbuddy-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 40px;
    padding: 0 5px;
    margin: 0;
    color: #6a737d;
    font-weight: 600;
}

/* Responsive styles */
@media (max-width: 992px) {
    .billbuddy-bills-table th,
    .billbuddy-bills-table td {
        padding: 12px;
    }

    /* Filter adjustments for medium screens */
    .billbuddy-filters-container {
        gap: 8px;
    }

    .billbuddy-filter-select {
        padding: 8px 28px 8px 10px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    /* Filter adjustments for mobile */
    .billbuddy-filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

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

    .billbuddy-filter-select {
        width: 100%;
        max-width: 100%;
    }

    /* Table adjustments for mobile */
    .billbuddy-bills-table,
    .billbuddy-bills-table tbody,
    .billbuddy-bills-table tr:not(.billbuddy-date-header),
    .billbuddy-bills-table td:not(.billbuddy-date-header-cell) {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .billbuddy-bills-table thead {
        display: none;
    }

    /* Style date headers for mobile */
    .billbuddy-date-header {
        display: block;
        width: 100%;
        margin-top: 24px;
        margin-bottom: 8px;
    }

    .billbuddy-date-header-cell {
        display: block;
        width: 100%;
        padding: 12px 18px;
        font-size: 1em;
        background-color: rgb(239, 246, 255);
        border-radius: 6px 6px 0 0;
        border-bottom: 2px solid #e1e4e8;
        text-align: center;
    }

    /* Style regular bill rows */
    .billbuddy-bills-table tr:not(.billbuddy-date-header) {
        margin-bottom: 16px;
        border: 1px solid #e1e4e8;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .billbuddy-bills-table td {
        position: relative;
        padding-left: 40%;
        text-align: left;
        border-bottom: 1px solid #eee;
        min-height: 30px;
    }

    /* Ensure date header cells don't have the left padding */
    .billbuddy-bills-table td.billbuddy-date-header-cell {
        padding-left: 18px;
    }

    .billbuddy-bills-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        width: 35%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #24292e;
    }

    .billbuddy-bills-table td.bill-title,
    .billbuddy-bills-table td.bill-summary {
        padding-left: 12px;
        padding-top: 10px;
        padding-bottom: 10px;
        min-height: 40px;
    }

    .billbuddy-bills-table td.bill-title:before,
    .billbuddy-bills-table td.bill-summary:before {
        position: static;
        display: block;
        width: 100%;
        margin-bottom: 5px;
        padding-bottom: 3px;
        border-bottom: 1px solid #e1e4e8;
    }

    .billbuddy-bills-table td.bill-number {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: #f6f8fa;
        padding: 8px 12px;
    }

    .billbuddy-bills-table td.bill-number:before {
        position: static;
        width: auto;
        padding-right: 0;
        border-bottom: none;
        margin-right: 8px;
    }

    /* Ensure summary takes full width */
    .billbuddy-bills-table td.bill-summary {
        clear: both;
        float: none;
        display: block;
        width: 100%;
    }

    /* Add more spacing between rows */
    .billbuddy-bills-table tr + tr {
        margin-top: 20px;
    }

    /* Pagination adjustments for mobile */
    .billbuddy-page-link {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .billbuddy-bills-table td {
        padding: 6px 6px 6px 40%;
        font-size: 0.9em;
        line-height: 1.4;
    }

    .billbuddy-bills-table td.bill-title,
    .billbuddy-bills-table td.bill-summary {
        padding: 8px 8px 8px 8px;
    }

    .billbuddy-bills-table td:before {
        font-size: 0.9em;
        left: 8px;
    }

    .billbuddy-page-link {
        min-width: 30px;
        height: 30px;
        padding: 0 5px;
        font-size: 0.8em;
    }
}
