/**
 * Total Processing Gateway Logger - Admin Styles
 */

/* Container */
#tp-gateway-logs-container {
    margin: 10px 0;
}

/* Header */
.tp-logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tp-logs-info p {
    margin: 0;
    color: #666;
}

.tp-logs-actions {
    display: flex;
    gap: 10px;
}

/* Filters */
#tp-logs-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tp-filter-buttons {
    display: flex;
    gap: 8px;
}

.tp-filter-btn {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.tp-filter-btn:hover {
    background: #f8f9fa;
    border-color: #2271b1;
}

.tp-filter-btn.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.tp-logs-counter {
    color: #666;
    font-size: 13px;
    font-weight: 500;
}

/* Logs Content */
#tp-logs-content {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Log Entry */
.tp-log-entry {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #fff;
    transition: background 0.2s;
}

.tp-log-entry:hover {
    background: #f8f9fa;
}

.tp-log-entry:last-child {
    border-bottom: none;
}

/* Log Levels */
.tp-log-error {
    border-left: 4px solid #d63638;
}

.tp-log-warning {
    border-left: 4px solid #dba617;
}

.tp-log-info {
    border-left: 4px solid #2271b1;
}

.tp-log-success {
    border-left: 4px solid #00a32a;
}

/* Log Header */
.tp-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tp-log-level {
    font-weight: 600;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-block;
}

.tp-log-error .tp-log-level {
    background: #fee;
    color: #d63638;
}

.tp-log-warning .tp-log-level {
    background: #fef8e7;
    color: #dba617;
}

.tp-log-info .tp-log-level {
    background: #e5f5fa;
    color: #2271b1;
}

.tp-log-success .tp-log-level {
    background: #e7f5ec;
    color: #00a32a;
}

.tp-log-time {
    color: #999;
    font-size: 12px;
    cursor: help;
}

/* Log Message */
.tp-log-message {
    margin: 8px 0;
    color: #333;
    line-height: 1.6;
}

/* Log Meta */
.tp-log-meta {
    display: flex;
    gap: 15px;
    margin: 8px 0;
    font-size: 12px;
    color: #666;
}

.tp-log-meta-item code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

/* Log Data Toggle */
.tp-log-data-toggle {
    margin: 8px 0;
}

.tp-log-data-toggle a {
    font-size: 12px;
    text-decoration: none;
    color: #2271b1;
}

.tp-log-data-toggle a:hover {
    text-decoration: underline;
}

/* Log Data & Stack Trace */
.tp-log-data,
.tp-log-stack {
    margin: 10px 0 0 0;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    max-height: 300px;
    overflow: auto;
}

.tp-log-data pre,
.tp-log-stack pre {
    margin: 0;
    padding: 10px;
    font-size: 11px;
    line-height: 1.5;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Empty State */
.tp-log-empty {
    padding: 40px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.tp-log-error {
    padding: 20px;
    background: #fee;
    color: #d63638;
    border: 1px solid #d63638;
    border-radius: 4px;
    text-align: center;
}

/* Loader */
#tp-logs-loader {
    padding: 40px;
    text-align: center;
}

.tp-loader-spinner {
    display: inline-block;
}

.tp-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: tp-spin 1s linear infinite;
}

@keyframes tp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tp-loader-spinner p {
    color: #666;
    margin: 0;
}

/* Load More */
#tp-load-more-container {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

#tp-load-more-btn {
    min-width: 150px;
}

/* Responsive */
@media (max-width: 782px) {
    .tp-logs-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .tp-logs-info {
        width: 100%;
    }
    
    .tp-logs-actions {
        width: 100%;
        justify-content: center;
    }
    
    #tp-logs-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .tp-filter-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tp-log-meta {
        flex-direction: column;
        gap: 5px;
    }
}
