:root {
    /* Neon Cyan Palette */
    --primary: #00CEC9;
    --primary-hover: #00b3af;
    --secondary: #81ECEC;
    --accent: #E17055;
    --bg-dark: #0A1A1A;
    --bg-panel: rgba(255, 255, 255, 0.03);
    --bg-input: rgba(0, 0, 0, 0.4);
    --border: rgba(0, 206, 201, 0.15);
    --border-focus: rgba(0, 206, 201, 0.5);

    --text-main: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-dark: #0A1A1A;

    --error: #ff7675;
    --success: #55efc4;
    --warning: #fdcb6e;

    /* Method Colors */
    --m-get: #74b9ff;
    --m-post: #55efc4;
    --m-put: #fdcb6e;
    --m-patch: #ffeaa7;
    --m-delete: #ff7675;

    --radius: 12px;
    --radius-sm: 8px;
    --transition: 200ms ease;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(0, 206, 201, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(225, 112, 85, 0.03) 0%, transparent 40%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--bg-dark);
    background: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    box-shadow: 0 0 15px rgba(0, 206, 201, 0.3);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

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

/* Layout */
.grid-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    flex: 1;
    min-height: 0;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 0;
}

/* Panels */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Sidebar */
.sidebar {
    height: 100%;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

.endpoint-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.endpoint-item:hover {
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.05);
}

.endpoint-item.active {
    border-color: var(--primary);
    background: rgba(0, 206, 201, 0.1);
}

.method-badge {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
}

.method-badge[data-method="GET"] {
    color: var(--m-get);
    background: rgba(116, 185, 255, 0.15);
}

.method-badge[data-method="POST"] {
    color: var(--m-post);
    background: rgba(85, 239, 196, 0.15);
}

.method-badge[data-method="PUT"] {
    color: var(--m-put);
    background: rgba(253, 203, 110, 0.15);
}

.method-badge[data-method="PATCH"] {
    color: var(--m-patch);
    background: rgba(255, 234, 167, 0.15);
}

.method-badge[data-method="DELETE"] {
    color: var(--m-delete);
    background: rgba(255, 118, 117, 0.15);
}

.endpoint-path {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-main);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
}

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

.btn.primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 10px rgba(0, 206, 201, 0.3);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

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

.btn.outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.btn.flex-1 {
    flex: 1;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.icon-btn.primary-btn {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: transparent;
}

.icon-btn.primary-btn:hover {
    background: var(--primary-hover);
}

.icon-btn.danger {
    border-color: rgba(255, 118, 117, 0.3);
    color: var(--error);
}

.icon-btn.danger:hover {
    background: rgba(255, 118, 117, 0.1);
    border-color: var(--error);
}

/* Editor Panel */
.editor-panel {
    flex: 2;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.routing-row {
    align-items: flex-end;
}

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

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

.method-group {
    width: 120px;
    flex-shrink: 0;
}

.path-group {
    flex: 1;
}

.status-group {
    width: 150px;
}

.delay-group {
    width: 150px;
}

input[type="text"],
input[type="number"],
select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
    width: 100%;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--border-focus);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300CEC9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.input-with-prefix {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    overflow: hidden;
    align-items: stretch;
}

.input-with-prefix:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--border-focus);
}

.input-with-prefix .prefix {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    border-right: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.input-with-prefix input {
    border: none;
    background: transparent;
    border-radius: 0;
    flex: 1;
}

.input-with-prefix input:focus {
    box-shadow: none;
}

.code-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 250px;
    margin-bottom: 2rem;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.code-editor {
    flex: 1;
    background: #050a0a;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    color: var(--secondary);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 200px;
    outline: none;
    transition: all var(--transition);
    line-height: 1.5;
}

.code-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--border-focus);
}

.error-msg {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

/* Console Panel */
.console-panel {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.badge {
    background: rgba(0, 206, 201, 0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Fira Code', monospace;
    border: 1px solid var(--border-focus);
}

.tester-ui {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.test-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.test-output {
    flex: 1;
    background: #050a0a;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 150px;
}

.output-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    font-family: 'Fira Code', monospace;
}

.output-title {
    color: var(--text-muted);
    flex: 1;
}

.tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.tag.success {
    background: rgba(85, 239, 196, 0.2);
    color: var(--success);
}

.tag.error {
    background: rgba(255, 118, 117, 0.2);
    color: var(--error);
}

.time-ms {
    color: var(--text-muted);
}

.output-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    margin: 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 206, 201, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Utils */
.hidden {
    display: none !important;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: var(--primary);
    color: var(--bg-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 206, 201, 0.3);
    z-index: 100;
    transition: all 0.3s ease;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }

    .app-container {
        height: auto;
        display: block;
    }

    .sidebar {
        max-height: 400px;
        margin-bottom: 2rem;
    }
}