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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: white;
    border-radius: 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 24px;
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 500;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}
.justify-content-between {
    justify-content: space-between;
    display: flex;
    align-items: center;
}
.main-content {
    display: flex;
    flex-direction: row;
    width: 100%;
}

.column {
    flex: 1;
    padding: 15px;
    min-width: 0; /* Prevent flex items from overflowing */
    max-height: calc(100vh - 90px); /* Limit height and enable scrolling */
    overflow-y: auto;
}

.column:not(:last-child) {
    border-right: 1px solid #eee;
}

.config-section,
.call-section,
.results-section,
.logs-section {
    padding: 15px 0;
}

.logs-section {
    border-bottom: none;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

input[type="text"],
input[type="tel"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.radio-label:hover {
    border-color: #667eea;
    background: white;
}

.radio-label input[type="radio"] {
    width: auto;
    margin-right: 12px;
    padding: 0;
    background: none;
}

.radio-text {
    font-weight: 500;
    color: #555;
}

.radio-label input[type="radio"]:checked + .radio-text {
    color: #667eea;
    font-weight: 600;
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.mode-section {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.json-input-container {
    position: relative;
}

.json-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.format-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.format-btn:hover {
    background: #5a67d8;
}

.format-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.validation-status {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.validation-status.valid {
    color: #38a169;
    background: #f0fff4;
    border: 1px solid #9ae6b4;
}

.validation-status.invalid {
    color: #e53e3e;
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.validation-status.empty {
    color: #718096;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

textarea.json-valid {
    border-color: #38a169;
    background: #f0fff4;
}

textarea.json-invalid {
    border-color: #e53e3e;
    background: #fff5f5;
}

.call-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 200px;
}

.call-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.call-btn:active {
    transform: translateY(0);
}

.call-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    font-size: 18px;
    animation: spin 1s linear infinite;
}

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

.results-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.results-section h2 {
    flex-shrink: 0;
}

.results-content {
    flex-grow: 1;
    overflow-y: auto;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.result-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.result-box.error {
    background: #fff5f5;
    border-color: #fed7d7;
}

.result-box h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.result-box.error h3 {
    color: #e53e3e;
}

pre {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.result-box.error pre {
    background: #fff;
    border-color: #fed7d7;
    color: #e53e3e;
}

.logs-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    height: calc(100vh - 200px);
    min-height: 500px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 15px;
}

.log-entry {
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.log-timestamp {
    color: #666;
    font-weight: bold;
}

.log-level-info {
    color: #2563eb;
}

.log-level-error {
    color: #dc2626;
}

.log-level-success {
    color: #16a34a;
}

.log-data {
    margin-top: 8px;
    margin-left: 20px;
}

.log-data pre {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 8px;
    font-size: 11px;
    line-height: 1.3;
    max-height: 200px;
    overflow-y: auto;
    color: #334155;
}

/* API Call Details styling */
.log-data .api-endpoint {
    color: #0369a1;
    font-weight: bold;
}

.log-data .api-method {
    color: #b91c1c;
    font-weight: bold;
}

.log-data .api-header-key {
    color: #4338ca;
    font-weight: 500;
}

.log-data .api-header-value {
    color: #1e40af;
}

.log-data .api-payload-key {
    color: #047857;
    font-weight: 500;
}

.log-data .api-payload-value {
    color: #065f46;
}

.clear-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clear-btn:hover {
    background: #4b5563;
}

/* Responsive design */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .column {
        width: 100%;
        border-right: none;
        max-height: none;
        overflow-y: visible;
    }
    
    .column:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    
    .logs-container {
        height: 400px;
        min-height: 400px;
    }
    
    .results-content {
        height: 400px;
        min-height: 400px;
    }
    
    .results-section {
        height: auto;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    h1 {
        font-size: 24px;
        padding: 20px;
    }
    
    .config-section,
    .call-section,
    .results-section,
    .logs-section {
        padding: 15px 0;
    }
    
    .call-btn {
        width: 100%;
    }
    
    .logs-container,
    .results-content {
        height: 300px;
        min-height: 300px;
    }
}

/* Animation for showing/hiding sections */
.result-box {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
