:root {
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --primary-color: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --text-color: #1f2937; /* Gray 800 */
    --text-secondary: #6b7280; /* Gray 500 */
    --border-color: #e5e7eb; /* Gray 200 */
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    padding: 20px;
    min-height: 100vh;
}

.app-layout {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

/* Form Elements */
input, select, textarea, button {
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

input[type="text"], select, textarea {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

input[type="text"]:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Request Line */
.request-line {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.method-select-wrapper {
    width: 120px;
    flex-shrink: 0;
}

#method {
    font-weight: 600;
    cursor: pointer;
    background-color: #f9fafb;
}

#url {
    flex-grow: 1;
}

#send-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0 24px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

#send-btn:hover {
    background-color: var(--primary-hover);
}

#send-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Tabs */
.tabs-container {
    display: flex;
    flex-direction: column;
}

.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn, .res-tab-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover, .res-tab-btn:hover {
    color: var(--text-color);
}

.tab-btn.active, .res-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content, .res-tab-content {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.tab-content.active, .res-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Key-Value Rows */
.key-value-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.key-value-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.key-value-row input {
    flex: 1;
}

.remove-row {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--error-color);
    width: 36px;
    height: 38px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-row:hover {
    background-color: #fef2f2;
    border-color: #fecaca;
}

.add-row {
    width: 100%;
    padding: 10px;
    background-color: #f9fafb;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.add-row:hover {
    background-color: #f3f4f6;
    border-color: var(--text-secondary);
    color: var(--text-color);
}

/* Cookie Section */
.cookie-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.cookie-section h3 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.cookie-section small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
}

/* Body Section */
.body-type-selector {
    margin-bottom: 16px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

textarea {
    min-height: 200px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    resize: vertical;
    line-height: 1.4;
}

/* Settings */
.setting-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.setting-desc strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-color);
}

.setting-desc p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Response Section */
.hidden {
    display: none;
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.response-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.response-meta {
    display: flex;
    gap: 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-label {
    font-weight: 500;
}

.status-badge {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.status-success { background: #d1fae5; color: #065f46; }
.status-error { background: #fee2e2; color: #991b1b; }

pre {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    color: #333;
}

/* Response Headers Table */
#response-headers-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#response-headers-content td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

#response-headers-content tr:last-child td {
    border-bottom: none;
}

#response-headers-content td:first-child {
    font-weight: 600;
    color: var(--text-secondary);
    width: 30%;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 600px) {
    .request-line {
        flex-direction: column;
    }
    
    .method-select-wrapper {
        width: 100%;
    }
    
    .response-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .response-meta {
        width: 100%;
        justify-content: space-between;
    }
}
