:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 60px;
    --header-height: 60px;
    --primary-color: #1890ff;
    --sidebar-bg: #1a365d;
    --sidebar-hover: #2d3748;
    --sidebar-text: #e2e8f0;
    --sidebar-border: #2d3748;
    --border-color: #e8e8e8;
    --bg-color: #fff;
    --text-color: #333;
    --hover-color: #f5f5f5;
}

.dark {
    --bg-color: #1e1e1e;
    --text-color: #f0f0f0;
    --hover-color: #2d2d2d;
    --border-color: #444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

#app {
    display: flex;
    height: 100vh;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-controls select,
.header-controls button {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    top: var(--header-height);
    left: 0;
    transition: all 0.3s ease;
    z-index: 999;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-content {
    padding: 20px;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
}

/* Search Box */
.search-container {
    margin-bottom: 20px;
    position: relative;
}

.search-box {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--sidebar-border);
    border-radius: 6px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-box::placeholder {
    color: #a0aec0;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.sidebar.collapsed .search-container {
    display: none;
}

/* Toggle Sidebar Button */
.sidebar-toggle {
    position: absolute;
    top: 10px;
    right: -45px;
    width: 40px;
    height: 40px;
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 4px;
    color: var(--sidebar-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 998;
}

.sidebar-toggle:hover {
    background: var(--sidebar-hover);
}

/* Tag Items */
.tag-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    color: var(--sidebar-text);
}

.tag-item:hover {
    background-color: var(--sidebar-hover);
    border-color: var(--sidebar-border);
}

.tag-item.highlighted {
    background-color: #2b6cb0;
    border-color: #4299e1;
}

.tag-item .icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    flex-shrink: 0;
}

.tag-item .name {
    flex: 1;
    font-weight: 500;
    color: var(--sidebar-text);
}

.tag-item .chev {
    font-size: 12px;
    color: #a0aec0;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.tag-children {
    margin-left: 32px;
    margin-bottom: 8px;
}

.tag-child {
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sidebar-text);
}

.tag-child:hover {
    background-color: var(--sidebar-hover);
}

.tag-child.highlighted {
    background-color: #2b6cb0;
}

.tag-child.hidden {
    display: none;
}

.method {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.method.get {
    background: #61affe;
    color: white;
}

.method.post {
    background: #49cc90;
    color: white;
}

.method.put {
    background: #fca130;
    color: white;
}

.method.delete {
    background: #f93e3e;
    color: white;
}

.method.patch {
    background: #50e3c2;
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow: hidden;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed~.main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Swagger UI Adjustments */
#swagger-ui {
    height: 100%;
    overflow-y: auto;
}

.swagger-ui .opblock-tag-section {
    margin-bottom: 20px;
}

/* Search Results Info */
.search-info {
    margin-bottom: 15px;
    padding: 8px 12px;
    background: #2d3748;
    border-radius: 4px;
    font-size: 14px;
    color: var(--sidebar-text);
}

.search-info.hidden {
    display: none;
}

.clear-search {
    background: none;
    border: none;
    color: #4299e1;
    cursor: pointer;
    margin-left: 5px;
    text-decoration: underline;
}

/* Collapsed Sidebar Icons */
.collapsed-tags {
    display: none;
    padding: 10px;
}

.sidebar.collapsed .collapsed-tags {
    display: block;
}

.collapsed-tag {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border-radius: 6px;
    cursor: pointer;
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    font-size: 16px;
    transition: all 0.2s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        right: -40px;
    }
}