@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&family=Source+Code+Pro:wght@400;500&display=swap');

:root {
    --primary-color: #009688;
    --success-color: #49cc90;
    --info-color: #61affe;
    --warning-color: #fca130;
    --danger-color: #f93e3e;
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --text-primary: #3b4151;
    --text-secondary: #999;
    --border-color: #e0e0e0;
    --code-bg: #41444e;
    --method-get: #61affe;
    --method-post: #49cc90;
    --method-delete: #f93e3e;
    --method-put: #fca130;
}

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

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

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

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem;
    position: relative;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
}

.refresh-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.refresh-btn:hover {
    background: #007a6e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.refresh-btn svg {
    width: 18px;
    height: 18px;
}

.refresh-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.header .version {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-left: 1rem;
    font-weight: 600;
}

.main-content {
    display: flex;
    min-height: calc(100vh - 120px);
}

.sidebar {
    width: 300px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    position: sticky;
    top: 0;
    height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section h3 {
    padding: 0 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sidebar-link:hover {
    background: var(--bg-primary);
}

.sidebar-link .method-badge {
    margin-right: 0.75rem;
    min-width: 55px;
    font-size: 0.7rem;
}

.content {
    flex: 1;
    padding: 2rem;
    max-width: calc(100vw - 300px);
}

.endpoint-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.endpoint {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.endpoint:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.endpoint-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.endpoint-header:hover {
    background: var(--bg-primary);
}

.endpoint.expanded .endpoint-header {
    border-bottom: 1px solid var(--border-color);
}

.method-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
    color: white;
}

.method-get {
    background-color: var(--method-get);
}

.method-post {
    background-color: var(--method-post);
}

.method-delete {
    background-color: var(--method-delete);
}

.method-put {
    background-color: var(--method-put);
}

.endpoint-path {
    flex: 1;
    margin-left: 1rem;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.95rem;
    font-weight: 500;
    word-break: break-all;
}

.endpoint-summary {
    color: var(--text-secondary);
    margin-left: auto;
    padding-left: 1rem;
    font-size: 0.9rem;
}

.endpoint-toggle {
    margin-left: 1rem;
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.endpoint.expanded .endpoint-toggle {
    transform: rotate(180deg);
}

.endpoint-body {
    display: none;
    padding: 1.5rem;
    background: var(--bg-primary);
}

.endpoint.expanded .endpoint-body {
    display: block;
}

.param-section {
    margin-bottom: 1.5rem;
}

.param-section h4 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.param-table th {
    background: var(--bg-primary);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.param-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.param-table tbody tr:last-child td {
    border-bottom: none;
}

.param-name {
    font-family: 'Source Code Pro', monospace;
    font-weight: 500;
}

.required-badge {
    background: var(--danger-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    margin-left: 0.5rem;
}

.try-it-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.try-it-section h4 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Source Sans Pro', sans-serif;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    transform: scale(0.98);
}

.btn-execute {
    background: var(--method-get);
    color: white;
    padding: 0.75rem 2rem;
}

.btn-clear {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    margin-left: 0.5rem;
    color: var(--text-primary);
}

.response-section {
    margin-top: 1.5rem;
}

.response-section h4 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.response-box {
    background: var(--code-bg);
    border-radius: 4px;
    padding: 1rem;
    max-height: 400px;
    overflow: auto;
}

.response-box::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.response-box::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.response-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.response-box::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.response-box pre {
    margin: 0;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #f8f8f2;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.response-status {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.response-status.success {
    background: rgba(73, 204, 144, 0.2);
    color: var(--success-color);
}

.response-status.error {
    background: rgba(249, 62, 62, 0.2);
    color: var(--danger-color);
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }

    .content {
        max-width: calc(100vw - 250px);
    }

    .endpoint-summary {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .content {
        max-width: 100%;
        padding: 1rem;
    }

    .endpoint-path {
        font-size: 0.85rem;
    }
}