:root {
    --bg-app: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #f1f5f9;
    
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-placeholder: #94a3b8;
    
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --danger-color: #ef4444;
    
    --method-get: #0369a1;
    --method-get-bg: #e0f2fe;
    --method-post: #15803d;
    --method-post-bg: #dcfce7;
    --method-put: #c2410c;
    --method-put-bg: #ffedd5;
    --method-delete: #b91c1c;
    --method-delete-bg: #fee2e2;
    --method-patch: #6d28d9;
    --method-patch-bg: #ede9fe;
    --method-any: #0f766e;
    --method-any-bg: #ccfbf1;

    --font-main: "Pretendard", "SUIT", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "D2Coding", "Fira Code", Consolas, monospace;
    
    --header-height: 60px;
}

* { box-sizing: border-box; }

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

.layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    flex-shrink: 0;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}
.logo span { color: var(--primary-color); }

.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 340px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-controls {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 2;
}

.search-box {
    position: relative;
    margin-bottom: 0.75rem;
}
.search-box svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-placeholder);
}
.search-box input {
    width: 100%;
    padding: 0.6rem 0.6rem 0.6rem 2.2rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-app);
}
.search-box input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--bg-surface);
}

.filter-group {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.filter-chip {
    border: 1px solid var(--border-color);
    background: white;
    padding: 0.25rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.filter-chip:hover {
    background: var(--bg-app);
    color: var(--text-primary);
}
.filter-chip.active {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

.list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.4rem 0.25rem;
    position: sticky;
    top: 0;
    background: var(--bg-sidebar);
    z-index: 1;
}

.list-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.list-sub {
    color: var(--text-placeholder);
}

.btn-chip {
    border: 1px solid var(--border-color);
    background: white;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-chip:hover {
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.mock-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mock-list.compact .mock-item {
    padding: 0.6rem 0.7rem;
}

.mock-list.compact .mock-header {
    margin-bottom: 0.2rem;
}

.mock-list.compact .mock-preview-snippet {
    font-size: 0.7rem;
}

.mock-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.mock-item:hover {
    border-color: var(--primary-color);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.mock-item.active {
    border-color: var(--primary-color);
    background: #eff6ff;
    box-shadow: 0 0 0 1px var(--primary-color) inset;
}

.mock-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
    padding-right: 3rem;
}

.method-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.mock-path {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1.3;
}

.mock-preview-snippet {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 0.2rem;
}

.btn-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    background: white;
    border: 1px solid #fee2e2;
    color: var(--danger-color);
    border-radius: 4px;
    padding: 2px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mock-item:hover .btn-delete { opacity: 1; }
.btn-delete:hover { background: #fee2e2; }

.btn-open {
    position: absolute;
    top: 0.5rem;
    right: 2.2rem;
    opacity: 0;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 2px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mock-item:hover .btn-open { opacity: 1; }
.btn-open:hover:not(:disabled) { border-color: var(--primary-color); color: var(--primary-color); }
.btn-open:disabled { opacity: 0; cursor: default; }
.mock-item:hover .btn-open:disabled { opacity: 0.4; cursor: not-allowed; }


.editor-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    padding: 0;
    min-width: 0;
}

.editor-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 1.5rem 1.5rem;
    max-width: none;
    width: 100%;
    margin: 0;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.editor-header h2 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
}

.editor-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.input-group { display: flex; flex-direction: column; gap: 0.4rem; }
.input-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.method-select-group { width: 120px; flex-shrink: 0; }
.path-input-group { flex: 1; }

select, input[type="text"] {
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background: var(--bg-app);
}
select:focus, input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: white;
}

.test-url-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.test-url-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    overflow: hidden;
    flex: 1;
}

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

.test-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
}

.test-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.body-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.body-header label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.btn-small {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-small:hover { border-color: var(--border-focus); color: var(--border-focus); }

textarea {
    flex: 1;
    resize: none;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
    background: var(--bg-app);
    color: var(--text-primary);
    min-height: 50vh;
}
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 0.8rem;
}
.btn-text:hover { color: var(--text-primary); }

.method-GET { color: var(--method-get); background: var(--method-get-bg); }
.method-POST { color: var(--method-post); background: var(--method-post-bg); }
.method-PUT { color: var(--method-put); background: var(--method-put-bg); }
.method-DELETE { color: var(--method-delete); background: var(--method-delete-bg); }
.method-PATCH { color: var(--method-patch); background: var(--method-patch-bg); }
.method-ANY { color: var(--method-any); background: var(--method-any-bg); }

@media (max-width: 768px) {
    .workspace { flex-direction: column; overflow-y: auto; }
    .sidebar { width: 100%; height: 300px; border-right: none; border-bottom: 1px solid var(--border-color); }
    .editor-pane { height: auto; min-height: 600px; }
    body { overflow: auto; }
}


.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

@keyframes flash-highlight {
    0% {
        background-color: #fef08a;
        border-color: #eab308;
        box-shadow: 0 0 15px rgba(234, 179, 8, 0.4);
    }
    100% {
        background-color: #eff6ff;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 1px var(--primary-color) inset;
    }
}

.mock-item.flash-effect {
    animation: flash-highlight 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
