.wmm-public-table-container {
    max-width: 100%;
    margin: 20px auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow-x: auto;
}

.wmm-table-controls {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.wmm-table-controls input,
.wmm-table-controls select,
.wmm-table-controls button {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.wmm-table-controls button {
    background-color: #0073aa;
    color: white;
    cursor: pointer;
    border: none;
}

.wmm-table-controls button:hover {
    background-color: #005177;
}

.wmm-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wmm-public-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wmm-public-data-table th,
.wmm-public-data-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    word-wrap: break-word;
}

.wmm-public-data-table th {
    background-color: #0073aa;
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.wmm-public-data-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.wmm-public-data-table tr:hover {
    background-color: #e6f3ff;
}

.wmm-public-mark-paid,
.wmm-public-upload-proof,
.wmm-public-add-comment {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin: 2px;
}

.wmm-public-mark-paid {
    background-color: #28a745;
}

.wmm-public-upload-proof {
    background-color: #17a2b8;
}

.wmm-public-add-comment {
    background-color: #6c757d;
}

.wmm-public-mark-paid:hover {
    background-color: #218838;
}

.wmm-public-upload-proof:hover {
    background-color: #138496;
}

.wmm-public-add-comment:hover {
    background-color: #5a6268;
}

/* Payment status styling */
.payment-status {
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-block;
    font-size: 12px;
}

.payment-paid {
    background-color: #d4edda;
    color: #155724;
}

.payment-pending {
    background-color: #fff3cd;
    color: #856404;
}

/* Comment display */
.wmm-comment-display {
    max-width: 120px;
    word-wrap: break-word;
    margin-bottom: 5px;
    font-size: 12px;
}

/* Modal styling */
.wmm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.wmm-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
}

.wmm-close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.wmm-close-button:hover,
.wmm-close-button:focus {
    color: black;
    text-decoration: none;
}

#wmm-public-comment-form label,
#wmm-public-payment-proof-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#wmm-public-comment-form textarea,
#wmm-public-payment-proof-form input[type="file"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.button-primary {
    background-color: #0073aa;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.button-primary:hover {
    background-color: #005177;
}

/* Mobile responsive design */
@media screen and (max-width: 768px) {
    .wmm-public-table-container {
        padding: 15px;
        margin: 10px auto;
    }
    
    .wmm-table-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .wmm-table-controls input,
    .wmm-table-controls select,
    .wmm-table-controls button {
        width: 100%;
        margin-bottom: 0;
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 6px;
        box-sizing: border-box;
    }
    
    .wmm-table-wrapper {
        margin-top: 20px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    
    .wmm-public-data-table {
        font-size: 14px;
        border: none;
        box-shadow: none;
    }
    
    .wmm-public-data-table,
    .wmm-public-data-table thead,
    .wmm-public-data-table tbody,
    .wmm-public-data-table th,
    .wmm-public-data-table td,
    .wmm-public-data-table tr {
        display: block;
    }
    
    .wmm-public-data-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .wmm-public-data-table tr {
        border: none;
        border-bottom: 10px solid #f0f0f0; /* Increased separation between rows */
        margin-bottom: 0;
        padding: 15px;
        background-color: white;
        position: relative;
        display: flex;
        flex-direction: column;
    }
    
    .wmm-public-data-table tr:last-child {
        border-bottom: none;
    }
    
    .wmm-public-data-table tr:nth-child(even) {
        background-color: #fafafa;
    }
    
    .wmm-public-data-table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding: 12px 0 12px 50% !important;
        text-align: right;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        word-break: break-word; /* Ensure long words break */
    }
    
    .wmm-public-data-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 45%;
        padding-right: 15px;
        white-space: nowrap;
        font-weight: bold;
        color: #0073aa;
        font-size: 13px;
        display: flex;
        align-items: center;
    }
    
    .wmm-public-data-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
        margin-top: 10px; /* Add some space above action buttons */
        justify-content: center; /* Center action buttons */
        flex-wrap: wrap; /* Allow buttons to wrap */
    }
    
    /* Better button styling for mobile */
    .wmm-public-data-table td button {
        margin: 5px; /* Increased margin for better touch */
        padding: 10px 15px;
        font-size: 13px;
        border-radius: 5px;
        min-width: 80px;
        white-space: nowrap;
    }
    
    /* Payment status mobile styling */
    .payment-status {
        padding: 6px 10px;
        font-size: 11px;
        border-radius: 4px;
        display: inline-block;
        margin-bottom: 5px;
    }
    
    /* Comment display mobile styling */
    .wmm-comment-display {
        max-width: none;
        margin-bottom: 8px;
        font-size: 13px;
        line-height: 1.4;
    }
    
    .wmm-modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .wmm-modal-content h2 {
        margin-top: 0;
        font-size: 18px;
    }
}

/* Extra small screens */
@media screen and (max-width: 480px) {
    .wmm-public-table-container {
        padding: 10px;
        margin: 5px auto;
    }
    
    .wmm-table-controls input,
    .wmm-table-controls select,
    .wmm-table-controls button {
        padding: 14px;
        font-size: 16px;
    }
    
    .wmm-public-data-table tr {
        padding: 12px;
    }
    
    .wmm-public-data-table td {
        padding: 10px 0 10px 48% !important;
        font-size: 13px;
        min-height: 36px;
    }
    
    .wmm-public-data-table td:before {
        width: 42%;
        font-size: 12px;
        padding-right: 10px;
    }
    
    .wmm-public-data-table td button {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 60px;
    }
    
    .wmm-modal-content {
        padding: 15px;
        margin: 2% auto;
    }
    
    .wmm-close-button {
        font-size: 24px;
    }
}

/* Landscape orientation on small screens */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .wmm-modal-content {
        margin: 2% auto;
        max-height: 95vh;
    }
}

