/* Error Log Page */
.spe-error-log-wrap {
    max-width: 1400px;
    overflow-x: auto;
}

.spe-error-log-wrap .wp-list-table {
    box-sizing: border-box;
}

/* Filters and Actions */
.spe-log-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.spe-log-filters form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.spe-log-filters select,
.spe-log-filters input[type="search"] {
    max-width: 200px;
}

.spe-log-actions {
    display: flex;
    gap: 10px;
}

/* Table Wrapper for horizontal scroll on small screens */
.spe-logs-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

/* Logs Table */
.spe-logs-table {
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    overflow: auto;
    display: block;
}

.spe-logs-table thead,
.spe-logs-table tbody,
.spe-logs-table tr {
    width: 100%;
}

.spe-logs-table th.spe-log-level {
    /* width: 8%; */
    width: 80px;
}

.spe-logs-table th.spe-log-type {
    /* width: 12%; */
    width: 100px;
}

.spe-logs-table th.spe-log-message {
    width: 40%;
    min-width: 200px;
}

.spe-logs-table th.spe-log-location {
    width: 15%;
    min-width: 260px;
}

.spe-logs-table th.spe-log-date {
    /* width: 15%; */
   min-width: 150px;
}

.spe-logs-table th.spe-log-actions {
    min-width: 120px;
}

.spe-logs-table td.spe-log-actions {
    text-align: center;
    width: 120px;
    min-width: 120px;
}

.spe-logs-table td.spe-log-actions .button {
    font-size: 11px;
    padding: 4px 8px;
    height: auto;
    line-height: 1.4;
    white-space: nowrap;
}

/* Table cell text wrapping and overflow control */
.spe-logs-table td {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.spe-logs-table td.spe-log-message,
.spe-logs-table td.spe-log-location {
    white-space: normal !important;
}

.spe-logs-table td.spe-log-location {
    font-size: 12px;
}

.spe-logs-table td.spe-log-location code {
    word-break: break-all !important;
    white-space: normal !important;
    display: block !important;
    max-width: 100%;
    background: transparent;
    padding: 0;
    border: none;
    font-family: Consolas, Monaco, monospace;
    overflow-wrap: break-word !important;
}

.spe-message-preview {
    white-space: normal !important;
    word-break: break-word;
}

/* Log Level Badges */
.spe-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
}

.spe-badge-error {
    background: #dc3232;
}

.spe-badge-warning {
    background: #f0ad4e;
}

.spe-badge-info {
    background: #00a0d2;
}

.spe-badge-debug {
    background: #72aee6;
}

/* Message Preview */
.spe-message-preview {
    font-size: 13px;
    color: #555;
}

/* No Logs Message */
.spe-no-logs {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Details Modal */
.spe-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spe-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 800px;
    max-height: 80vh;
    overflow: auto;
    position: relative;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.spe-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.spe-modal-close:hover {
    color: #000;
}

.spe-log-details-table {
    width: 100%;
    margin-top: 20px;
}

.spe-log-details-table th {
    text-align: left;
    padding: 10px;
    background: #f5f5f5;
    width: 150px;
    vertical-align: top;
}

.spe-log-details-table td {
    padding: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.spe-log-details-table pre {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    max-height: 300px;
    overflow: auto;
}

/* Responsive */
@media (max-width: 782px) {
    .spe-log-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .spe-log-filters form {
        width: 100%;
    }

    .spe-log-filters select,
    .spe-log-filters input[type="search"] {
        max-width: 100%;
    }

    .spe-log-actions {
        width: 100%;
        margin-top: 10px;
    }

    .spe-log-actions button {
        flex: 1;
    }

    .spe-modal-content {
        max-width: 95%;
        padding: 20px;
    }

    .spe-log-details-table th,
    .spe-log-details-table td {
        display: block;
        width: 100%;
    }

    .spe-log-details-table th {
        background: transparent;
        font-weight: bold;
        padding-bottom: 5px;
    }

    .spe-log-details-table td {
        padding-top: 0;
        padding-bottom: 15px;
    }
}
