:root {
    --primary: #E55039;
    --primary-light: #ff6b52;
    --primary-dark: #b33923;
    --secondary: #F0932B;
    --accent: #78E08F;
    --accent-light: #9af1b1;
    --bg-dark: #0D0D0D;
    --bg-panel: rgba(25, 25, 28, 0.7);
    --bg-panel-hover: rgba(35, 35, 40, 0.8);
    --bg-input: rgba(10, 10, 12, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(229, 80, 57, 0.3);
    --text-main: #f8f9fa;
    --text-muted: #adb5bd;
    --text-dim: #6c757d;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 15px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 15px rgba(229, 80, 57, 0.2);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Code Colors */
    --code-keyword: #F0932B;
    --code-type: #78E08F;
    --code-string: #E55039;
    --code-comment: #6c757d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(229, 80, 57, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(240, 147, 43, 0.03) 0%, transparent 50%);
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
    gap: 1rem;
}

/* Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.logo .highlight {
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.main-content {
    display: flex;
    flex: 1;
    gap: 1rem;
    min-height: 0; /* Important for scrollable children */
}

.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
}

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

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.rest-panel {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.editor-panel {
    flex: 1;
    min-width: 350px;
    max-width: 450px;
}

.graphql-panel {
    flex: 2;
    min-width: 400px;
}

.hidden {
    display: none !important;
}

/* Buttons */
.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.primary-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.danger-btn {
    background: transparent;
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.danger-btn:hover {
    background: rgba(255, 71, 87, 0.1);
    border-color: #ff4757;
}

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

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

.badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Endpoints List */
.endpoint-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.endpoint-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.endpoint-item.active {
    border-color: var(--primary);
    background: rgba(229, 80, 57, 0.1);
}

.method-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    width: 60px;
    text-align: center;
}

.method-GET { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.method-POST { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.method-PUT { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
.method-DELETE { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }

.ep-details {
    overflow: hidden;
}

.ep-path-text {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-name-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-style: italic;
}

/* Forms */
.form-row {
    display: flex;
    gap: 1rem;
}

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

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

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

input[type="text"], select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    width: 100%;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(229, 80, 57, 0.2);
}

.code-editor {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.9rem;
    color: var(--code-keyword);
    min-height: 150px;
    white-space: pre-wrap;
    outline: none;
    transition: var(--transition-fast);
}

.code-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(229, 80, 57, 0.2);
}

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

/* Tabs */
.tab-controls {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

.tab-btn.active {
    color: var(--primary);
    background: rgba(229, 80, 57, 0.1);
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.code-container {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    flex: 1;
    overflow: auto;
    padding: 1rem;
}

pre {
    margin: 0;
}

code {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-main);
}

.t-kw { color: var(--code-keyword); }
.t-type { color: var(--code-type); }
.t-str { color: var(--code-string); }
.t-com { color: var(--code-comment); }

/* Insights */
.insights-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insight-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--secondary);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
}

.insight-card h3 {
    color: var(--text-main);
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.insight-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.insight-card.highlight-card {
    border-left-color: var(--accent);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: var(--transition-normal);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}

.modal-body textarea {
    width: 100%;
    height: 300px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.modal-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .rest-panel, .editor-panel, .graphql-panel {
        width: 100%;
        max-width: none;
        min-width: 0;
        min-height: 300px;
    }
}
