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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: #2c3e50;
    color: white;
    overflow-y: auto;
    border-right: 1px solid #34495e;
}

.sidebar-header {
    padding: 20px;
    background-color: #34495e;
    border-bottom: 1px solid #4a5f7a;
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

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

.variables-section h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #bdc3c7;
}

.variable-input {
    margin-bottom: 8px;
}

.variable-input label {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
    color: #ecf0f1;
}

.variable-input input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #4a5f7a;
    border-radius: 4px;
    background-color: #34495e;
    color: white;
    font-size: 12px;
}

.variable-input input:focus {
    outline: none;
    border-color: #3498db;
}

.api-list {
    padding: 15px 20px 20px;
}

.api-category {
    margin-bottom: 15px;
}

.api-category h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #3498db;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-category h3:hover {
    color: #5dade2;
}

.api-endpoint {
    margin-left: 20px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background-color: #34495e;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.api-endpoint:hover {
    background-color: #4a5f7a;
}

.api-endpoint.active {
    background-color: #3498db;
    border-left-color: #2980b9;
}

.endpoint-method {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    margin-right: 8px;
    min-width: 40px;
    text-align: center;
}

.method-get { background-color: #27ae60; }
.method-post { background-color: #e74c3c; }
.method-patch { background-color: #f39c12; }
.method-delete { background-color: #e67e22; }

.endpoint-name {
    font-size: 12px;
    color: #ecf0f1;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    height: 100vh;
    overflow: hidden;
}

.request-section {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
}

.request-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.method-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-weight: bold;
}

.url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.send-button {
    padding: 8px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.send-button:hover {
    background-color: #2980b9;
}

.send-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.request-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #666;
}

.tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-content {
    display: none;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.headers-section, .params-section, .body-section, .path-variables-section {
    margin-bottom: 15px;
}

.path-var-row {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.header-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
}

.param-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
}

.header-key, .param-key {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.header-value, .param-value {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.param-row.disabled {
    opacity: 0.6;
}

.param-row.disabled .param-key,
.param-row.disabled .param-value {
    background-color: #f5f5f5;
    color: #999;
}

.param-description {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
    font-style: italic;
    grid-column: 1 / -1;
}

.add-header, .add-param {
    padding: 6px 12px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.remove-header, .remove-param {
    padding: 6px 8px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.body-textarea {
    width: 100%;
    height: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    resize: vertical;
}

/* Response Section */
.response-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(100vh - 300px);
}

.response-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

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

.status-success { background-color: #d5f4e6; color: #27ae60; }
.status-error { background-color: #fadbd8; color: #e74c3c; }

.response-time {
    color: #666;
    font-size: 12px;
}

.response-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.response-content {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #666;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.error-message {
    background-color: #fadbd8;
    color: #e74c3c;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.collapsible {
    cursor: pointer;
}

.collapsible::before {
    content: '▶';
    margin-right: 5px;
    transition: transform 0.2s;
}

.collapsible.expanded::before {
    transform: rotate(90deg);
}

.collapsible-content {
    display: none;
}

.collapsible.expanded + .collapsible-content {
    display: block;
}
