:root {
    --app-bg: #09090b;
    --panel-bg: #18181b;
    --input-bg: #000000;
    --hover-bg: #27272a;

    --text: #f4f4f5;
    --text-muted: #a1a1aa;

    --border: #27272a;
    --border-focus: #6366f1;

    --primary: #6366f1;
    --primary-hover: #4f46e5;

    --get: #3b82f6;
    --post: #10b981;
    --put: #f59e0b;
    --del: #ef4444;
    --patch: #8b5cf6;

    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'Fira Code', monospace;
}

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

body {
    font-family: var(--font-sans);
    background: var(--app-bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

.app-layout {
    display: flex;
    height: 100vh;
}

.glass {
    background: rgba(24, 24, 27, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
}

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
}

.brand {
    height: 64px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 1.1rem;
}

.logo-box {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

.section-header {
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ep-list {
    list-style: none;
    overflow-y: auto;
    padding: 0.5rem 1rem;
    flex-grow: 1;
}

.ep-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    margin-bottom: 0.2rem;
}

.ep-item:hover {
    background: var(--hover-bg);
}

.ep-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.method-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    width: 45px;
    text-align: center;
    color: #fff;
}

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

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

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

.method-tag.PATCH {
    background: var(--patch);
}

.method-tag.DELETE {
    background: var(--del);
}

.ep-path {
    font-size: 0.85rem;
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-status {
    flex-grow: 0;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--panel-bg);
}

.server-status h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.dot.online {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.dot.offline {
    background: #ef4444;
}

.live-url {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.live-url label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.live-url code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: var(--input-bg);
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    word-break: break-all;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-weight: 500;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    padding: 0.6rem 1.2rem;
}

.btn.primary {
    background: var(--text);
    color: var(--app-bg);
}

.btn.primary:hover {
    background: #d4d4d8;
}

.btn.secondary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.btn.secondary:hover {
    background: rgba(99, 102, 241, 0.2);
}

.btn.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--del);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn.outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn.outline:hover {
    border-color: var(--text-muted);
    background: var(--hover-bg);
}

.btn.sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn.lg {
    padding: 0.8rem 1.6rem;
    font-size: 1rem;
}

.full-width {
    width: 100%;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--hover-bg);
    color: var(--text);
}

/* Main Workspace */
.main-workspace {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.state-view {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    display: flex;
}

.state-view.active {
    opacity: 1;
    pointer-events: auto;
}

.hero {
    margin: auto;
    text-align: center;
    max-width: 500px;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hero p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.blob-bg::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}

/* Split View */
.split-view {
    flex-direction: row;
}

.editor-pane {
    flex: 3;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
}

.logger-pane {
    flex: 2;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 0.75rem;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grid-2 {
    display: flex;
    gap: 1.5rem;
}

.input-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.flex-fill {
    flex-grow: 1;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--primary);
}

.inp {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    outline: none;
    font-family: var(--font-sans);
    transition: border 0.2s;
    width: 100%;
}

.inp:focus {
    border-color: var(--primary);
}

.path-input-group {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border 0.2s;
    overflow: hidden;
}

.path-input-group:focus-within {
    border-color: var(--primary);
}

.path-input-group span {
    padding: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    border-right: 1px solid var(--border);
    background: var(--panel-bg);
}

.path-input-group input {
    border: none;
    background: transparent;
    font-family: var(--font-mono);
    width: 100%;
}

.path-input-group input:focus {
    outline: none;
}

.code-area {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #a6e22e;
    resize: none;
    flex-grow: 1;
    line-height: 1.5;
    padding: 1rem;
}

/* Logger */
.logger-pane .panel-header {
    padding: 2rem 2rem 1rem 2rem;
}

.log-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.idle-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 2rem;
    font-style: italic;
}

.log-item {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.log-item-header {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.log-timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.log-item-body {
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    word-break: break-all;
}

.log-tester {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    background: var(--panel-bg);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: var(--app-bg);
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}

.toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}