:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --error-color: #e74c3c;
    --dark-color: #34495e;
    --light-color: #ecf0f1;
    --border-color: #bdc3c7;
    --hover-color: #2980b9;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    color: var(--dark-color);
    font-size: 1.8rem;
}

.url-builder {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.syft-url-container {
    margin-bottom: 20px;
}

.syft-url-container input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.field-container {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--dark-color);
}

input,
textarea {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.buttons-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--hover-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #27ae60;
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

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

.btn-light {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.btn-light:hover {
    background-color: #d0d3d4;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.checkbox-container input {
    margin-right: 8px;
}

.request-builder {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.headers-section,
.body-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.headers-list {
    display: grid;
    gap: 10px;
}

.header-item {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: center;
}

.remove-header {
    background-color: var(--error-color);
    color: white;
    height: 35px;
    width: 35px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.add-header {
    display: inline-block;
    padding: 8px 12px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

.body-textarea {
    width: 100%;
    height: 200px;
    font-family: monospace;
    resize: vertical;
}

.send-request-btn {
    grid-column: 1 / -1;
    padding: 15px;
    font-size: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.send-request-btn:hover {
    background-color: var(--hover-color);
}

.history-view {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.requests-list {
    padding: 15px;
    border-right: 1px solid var(--border-color);
    max-height: 500px;
    overflow-y: auto;
}

.request-details {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--dark-color);
    color: white;
}

.request-item {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.request-item:hover {
    background-color: #f0f2f5;
}

.request-item.active {
    background-color: #e1f5fe;
    border-left: 3px solid var(--primary-color);
}

.request-endpoint {
    font-weight: bold;
    margin-bottom: 5px;
}

.request-method {
    display: inline-block;
    padding: 2px 6px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-right: 5px;
}

.request-status {
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 3px;
    color: white;
}

.status-pending {
    background-color: #f39c12;
}

.status-polling {
    background-color: #3498db;
}

.status-success {
    background-color: #2ecc71;
}

.status-error {
    background-color: #e74c3c;
}

.duplicate-badge {
    display: inline-block;
    padding: 2px 6px;
    background-color: #9b59b6;
    color: white;
    border-radius: 3px;
    font-size: 0.7rem;
    margin-left: 5px;
}

.details-section {
    margin-bottom: 20px;
}

.details-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.details-content {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    font-family: monospace;
    margin-bottom: 15px;
    overflow-x: auto;
}

.json-viewer {
    white-space: pre-wrap;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background-color: var(--secondary-color);
}

.toast-error {
    background-color: var(--error-color);
}

.toast-info {
    background-color: var(--primary-color);
}

.no-details {
    color: #7f8c8d;
    text-align: center;
    padding: 50px 0;
    font-style: italic;
}

.badge {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 5px;
    color: white;
}

.badge-primary {
    background-color: var(--primary-color);
}

.badge-secondary {
    background-color: var(--secondary-color);
}

.badge-error {
    background-color: var(--error-color);
}

.badge-purple {
    background-color: #9b59b6;
}

.status-code {
    font-weight: bold;
}

.code-200 {
    color: var(--secondary-color);
}

.code-202 {
    color: #f39c12;
}

.code-400,
.code-500 {
    color: var(--error-color);
}

.request-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.request-actions button {
    font-size: 0.7rem;
    padding: 2px 5px;
}

/* New styles for polling progress */
.polling-progress-bar {
    height: 5px;
    background-color: #eaeaea;
    border-radius: 3px;
    margin-top: 5px;
    overflow: hidden;
}

.polling-progress {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

@media (max-width: 768px) {
    .field-grid {
        grid-template-columns: 1fr;
    }

    .history-view {
        grid-template-columns: 1fr;
    }

    .requests-list {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 200px;
    }
}