* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    margin-bottom: 15px;
    color: #2c3e50;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: #666;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s;
}

nav a:hover, nav a.active {
    background: #3498db;
    color: white;
}

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.sidebar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: fit-content;
}

.content-area {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 600px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    margin: 5px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.api-list {
    margin-top: 20px;
}

.api-item {
    padding: 15px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid #3498db;
}

.api-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.api-item.disabled {
    opacity: 0.5;
    border-left-color: #95a5a6;
}

.api-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.api-item-name {
    font-weight: bold;
    color: #2c3e50;
}

.api-item-method {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.method-GET { background: #27ae60; color: white; }
.method-POST { background: #3498db; color: white; }
.method-PUT { background: #f39c12; color: white; }
.method-DELETE { background: #e74c3c; color: white; }
.method-PATCH { background: #9b59b6; color: white; }

.api-item-path {
    color: #666;
    font-family: monospace;
    font-size: 13px;
}

.form-container {
    max-width: 800px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.test-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
}

.test-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.test-result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state h2 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.logs-controls {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logs-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

.logs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.log-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.log-method {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
}

.log-path {
    font-family: monospace;
    font-weight: bold;
    color: #2c3e50;
}

.log-timestamp {
    color: #666;
    font-size: 12px;
}

.log-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
}

.status-2xx { background: #d4edda; color: #155724; }
.status-4xx { background: #fff3cd; color: #856404; }
.status-5xx { background: #f8d7da; color: #721c24; }
.status-executing { 
    background: #cfe2ff; 
    color: #084298; 
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.log-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.log-section {
    margin-bottom: 15px;
}

.log-section-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
}

.log-section-content {
    background: white;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Details View Styles */
.details-container {
    max-width: 900px;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.details-header h2 {
    color: #2c3e50;
    margin: 0;
}

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

.details-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.detail-section-code {
    background: #2c3e50;
    border-left-color: #27ae60;
}

.detail-label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: #2c3e50;
    font-size: 15px;
}

.detail-path {
    font-family: monospace;
    font-size: 14px;
    color: #3498db;
    font-weight: 500;
}

.detail-code {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .details-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .details-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .details-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Async Logs Styles */
.async-logs-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.async-logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.async-logs-header h2 {
    margin: 0;
    color: #2c3e50;
}

.async-logs-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.async-logs-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.async-logs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.async-log-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.async-log-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.async-log-item.status-running {
    border-left: 4px solid #3498db;
}

.async-log-item.status-completed {
    border-left: 4px solid #2ecc71;
}

.async-log-item.status-failed {
    border-left: 4px solid #e74c3c;
}

.async-log-header {
    margin-bottom: 10px;
}

.async-log-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.status-icon {
    font-size: 20px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.status-running {
    background: #3498db;
    color: white;
}

.status-badge.status-completed {
    background: #2ecc71;
    color: white;
}

.status-badge.status-failed {
    background: #e74c3c;
    color: white;
}

.async-log-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.async-log-error {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    color: #c33;
    font-size: 14px;
}

.async-log-summary {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    font-size: 12px;
}

.async-log-summary pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.async-log-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-body {
    margin: 15px 0;
}

.modal-body pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.5;
}

.modal-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 2px solid #eee;
    text-align: right;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 15px;
    color: #c33;
    text-align: center;
}
