/* ═══════════════════════════════════════════
   APIForge — REST API Tester
   Modern Dark Glassmorphic Theme
   ═══════════════════════════════════════════ */

/* ── Reset & Foundation ───────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --bg-card: rgba(22, 22, 35, 0.7);
    --bg-card-hover: rgba(30, 30, 48, 0.8);
    --bg-glass: rgba(18, 18, 30, 0.65);
    --bg-input: rgba(15, 15, 25, 0.8);
    --bg-input-focus: rgba(20, 20, 35, 0.9);

    --border-primary: rgba(255, 255, 255, 0.06);
    --border-secondary: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(129, 140, 248, 0.5);

    --text-primary: #e8e8f0;
    --text-secondary: #9898b0;
    --text-tertiary: #6a6a82;
    --text-muted: #4a4a62;

    --accent-indigo: #818cf8;
    --accent-purple: #a78bfa;
    --accent-violet: #c084fc;
    --accent-cyan: #67e8f9;
    --accent-emerald: #34d399;
    --accent-amber: #fbbf24;
    --accent-rose: #fb7185;
    --accent-orange: #fb923c;

    --gradient-primary: linear-gradient(135deg, #818cf8, #c084fc);
    --gradient-send: linear-gradient(135deg, #818cf8 0%, #6366f1 50%, #a78bfa 100%);
    --gradient-glow: linear-gradient(135deg, rgba(129,140,248,0.15), rgba(192,132,252,0.1));

    /* Method colors */
    --method-get: #34d399;
    --method-post: #fbbf24;
    --method-put: #60a5fa;
    --method-patch: #fb923c;
    --method-delete: #fb7185;
    --method-head: #a78bfa;
    --method-options: #67e8f9;

    /* Status colors */
    --status-success: #34d399;
    --status-redirect: #60a5fa;
    --status-client-err: #fbbf24;
    --status-server-err: #fb7185;

    /* Spacing */
    --sidebar-width: 280px;
    --sidebar-collapsed: 0px;
    --header-height: 52px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Ambient Background ───────────────────── */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99,102,241,0.4), transparent 70%);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(192,132,252,0.3), transparent 70%);
    bottom: -5%;
    left: 10%;
    animation-delay: -7s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(34,211,153,0.2), transparent 70%);
    top: 40%;
    left: 40%;
    animation-delay: -14s;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -50px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 40px) scale(1.05); }
}

/* ── App Container ────────────────────────── */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ──────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    transition: all var(--transition-slow);
    overflow: hidden;
}

.sidebar.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--gradient-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-secondary);
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.sidebar-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}

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

.sidebar-section:first-of-type {
    border-bottom: 1px solid var(--border-primary);
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 8px;
    flex-shrink: 0;
}

.sidebar-section-header h3 {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-tertiary);
}

.history-list, .collections-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.history-list::-webkit-scrollbar, .collections-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-thumb, .collections-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 16px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state p {
    font-size: 12px;
}

.history-item, .collection-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.history-item:hover, .collection-item:hover {
    background: rgba(255,255,255,0.04);
}

.history-item .method-badge {
    font-size: 9px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    min-width: 36px;
    text-align: center;
    padding: 2px 4px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.history-item .history-url {
    font-size: 11.5px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
}

.history-item .history-status {
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.collection-group {
    margin-bottom: 6px;
}

.collection-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.collection-group-header:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
}

.collection-group-header svg {
    transition: transform var(--transition-fast);
}

.collection-group-header.expanded svg {
    transform: rotate(90deg);
}

.collection-group-items {
    padding-left: 20px;
    display: none;
}

.collection-group-items.expanded {
    display: block;
}

/* ── Main Content ─────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── Top bar ──────────────────────────────── */
.top-bar {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-shrink: 0;
}

.sidebar-open-btn {
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.sidebar-open-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}

.sidebar.collapsed ~ .main-content .sidebar-open-btn {
    display: flex;
}

.environment-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.environment-selector label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.environment-selector select {
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-fast);
}

.environment-selector select:focus {
    border-color: var(--border-focus);
}

/* ── Buttons ──────────────────────────────── */
.btn-icon {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

.btn-sm {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-sm:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.btn-sm.active {
    background: rgba(129,140,248,0.12);
    color: var(--accent-indigo);
    border-color: rgba(129,140,248,0.3);
}

.btn-primary {
    padding: 8px 20px;
    border-radius: var(--radius-md);
    background: var(--gradient-send);
    border: none;
    color: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

.btn-secondary {
    padding: 8px 20px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

/* ── Request Builder ──────────────────────── */
.request-builder {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.url-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: 4px;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.url-bar:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 2px 20px rgba(99,102,241,0.15), 0 0 0 3px rgba(99,102,241,0.08);
}

.method-selector select {
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--method-get);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    border-right: 1px solid var(--border-primary);
    appearance: none;
    -webkit-appearance: none;
    min-width: 90px;
    text-align: center;
}

.method-selector select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.url-input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    outline: none;
    min-width: 0;
}

.url-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--gradient-send);
    color: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.send-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.send-btn:hover::before {
    opacity: 1;
}

.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99,102,241,0.35);
}

.send-btn:active {
    transform: translateY(0);
}

.save-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.save-btn:hover {
    color: var(--accent-indigo);
    background: rgba(129,140,248,0.08);
}

/* ── Request Tabs ─────────────────────────── */
.request-tabs, .response-tabs {
    display: flex;
    gap: 2px;
    margin-top: 14px;
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 0;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--accent-indigo);
    border-bottom-color: var(--accent-indigo);
}

.tab-count {
    font-size: 9px;
    font-weight: 700;
    background: rgba(129,140,248,0.15);
    color: var(--accent-indigo);
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* ── Tab Panels ───────────────────────────── */
.tab-panels {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.tab-panels::-webkit-scrollbar {
    width: 4px;
}

.tab-panels::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
}

.tab-panel {
    display: none;
    padding: 12px 0;
}

.tab-panel.active {
    display: block;
}

/* ── Key-Value Editor ─────────────────────── */
.kv-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 36px;
    gap: 8px;
    padding: 4px 0;
    margin-bottom: 4px;
}

.kv-col, .kv-col-desc {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.kv-col-actions {
    width: 36px;
}

.kv-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 36px;
    gap: 8px;
    margin-bottom: 4px;
    align-items: center;
    animation: fadeSlideIn 0.2s ease;
}

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

.kv-row input {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    outline: none;
    transition: all var(--transition-fast);
    width: 100%;
}

.kv-row input:focus {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
}

.kv-row input::placeholder {
    color: var(--text-muted);
}

.kv-row .kv-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.kv-row .kv-delete:hover {
    background: rgba(251,113,133,0.1);
    color: var(--accent-rose);
}

.add-row-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px dashed var(--border-secondary);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 6px;
    width: 100%;
}

.add-row-btn:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
    background: rgba(129,140,248,0.04);
}

/* ── Auth Panel ───────────────────────────── */
.auth-config {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-type-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-type-selector label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.auth-type-selector select,
.auth-fields input {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    outline: none;
    transition: all var(--transition-fast);
}

.auth-type-selector select:focus,
.auth-fields input:focus {
    border-color: var(--border-focus);
}

.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-field-group label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.auth-field-group input {
    width: 100%;
    max-width: 420px;
}

.auth-no-auth p {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0;
}

/* ── Body Panel ───────────────────────────── */
.body-config {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.body-type-selector {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.radio-label:hover {
    color: var(--text-primary);
}

.radio-label input[type="radio"] {
    accent-color: var(--accent-indigo);
    cursor: pointer;
}

.body-editor-toolbar {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.body-editor, .tests-editor {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    transition: border-color var(--transition-fast);
    tab-size: 2;
}

.body-editor:focus, .tests-editor:focus {
    border-color: var(--border-focus);
}

.tests-info {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0;
}

/* ── Response Section ─────────────────────── */
.response-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.response-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.placeholder-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
}

.placeholder-content p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Loading ──────────────────────────────── */
.response-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.loader-ring {
    width: 44px;
    height: 44px;
    position: relative;
}

.loader-ring div {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--accent-indigo);
    animation: loaderSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-ring div:nth-child(1) { animation-delay: -0.45s; }
.loader-ring div:nth-child(2) { animation-delay: -0.3s; border-top-color: var(--accent-purple); }
.loader-ring div:nth-child(3) { animation-delay: -0.15s; border-top-color: var(--accent-violet); }

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

.response-loading p {
    font-size: 13px;
    color: var(--text-secondary);
}

.cancel-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cancel-btn:hover {
    border-color: var(--accent-rose);
    color: var(--accent-rose);
}

/* ── Response Content ─────────────────────── */
.response-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.response-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.response-status {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.status-badge.status-2xx {
    background: rgba(52,211,153,0.12);
    color: var(--status-success);
    border: 1px solid rgba(52,211,153,0.2);
}

.status-badge.status-3xx {
    background: rgba(96,165,250,0.12);
    color: var(--status-redirect);
    border: 1px solid rgba(96,165,250,0.2);
}

.status-badge.status-4xx {
    background: rgba(251,191,36,0.12);
    color: var(--status-client-err);
    border: 1px solid rgba(251,191,36,0.2);
}

.status-badge.status-5xx {
    background: rgba(251,113,133,0.12);
    color: var(--status-server-err);
    border: 1px solid rgba(251,113,133,0.2);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
}

.response-actions {
    display: flex;
    gap: 4px;
}

.response-tabs {
    margin-top: 0;
    padding: 0 20px;
    background: var(--bg-glass);
    flex-shrink: 0;
}

.response-tab-panels {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.response-tab-panels::-webkit-scrollbar {
    width: 6px;
}

.response-tab-panels::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
}

.response-tab-panel {
    display: none;
}

.response-tab-panel.active {
    display: block;
}

.response-body-toolbar {
    display: flex;
    gap: 4px;
    padding: 10px 0;
    flex-shrink: 0;
}

.response-body {
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.65;
    overflow: auto;
    max-height: 60vh;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-primary);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.response-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.response-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
}

/* JSON Syntax highlighting */
.json-key { color: #93c5fd; }
.json-string { color: #86efac; }
.json-number { color: #fdba74; }
.json-boolean { color: #c4b5fd; }
.json-null { color: #94a3b8; font-style: italic; }
.json-bracket { color: #9898b0; }

/* ── HTML Preview ─────────────────────────── */
.html-preview-wrapper {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-secondary);
    overflow: hidden;
    animation: fadeSlideIn 0.25s ease;
    background: var(--bg-tertiary);
}

.html-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(15, 15, 25, 0.9);
    border-bottom: 1px solid var(--border-primary);
    gap: 12px;
}

.preview-device-btns {
    display: flex;
    gap: 4px;
}

.preview-device-btns .btn-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
}

.preview-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.3px;
}

.html-preview-frame-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
    background: repeating-conic-gradient(rgba(255,255,255,0.02) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
    min-height: 350px;
    max-height: 60vh;
    overflow: auto;
    transition: all var(--transition-normal);
}

.html-preview-frame {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: var(--radius-sm);
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.06);
    transition: width var(--transition-slow), box-shadow var(--transition-normal);
}

.html-preview-frame.device-desktop {
    width: 100%;
}

.html-preview-frame.device-tablet {
    width: 768px;
    max-width: 100%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 0 8px rgba(30,30,48,0.8), 0 0 0 9px rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
}

.html-preview-frame.device-mobile {
    width: 375px;
    max-width: 100%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 0 8px rgba(30,30,48,0.8), 0 0 0 9px rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
}

/* ── Response Headers Table ───────────────── */
.response-headers-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.response-headers-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-primary);
}

.response-headers-table td {
    padding: 7px 12px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    border-bottom: 1px solid var(--border-primary);
}

.response-headers-table td:first-child {
    color: var(--accent-indigo);
    font-weight: 500;
    white-space: nowrap;
}

.response-headers-table td:last-child {
    color: var(--text-secondary);
    word-break: break-all;
}

.response-headers-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

/* ── Test Results ─────────────────────────── */
.test-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: 12px;
}

.test-result.pass {
    background: rgba(52,211,153,0.06);
    color: var(--status-success);
}

.test-result.fail {
    background: rgba(251,113,133,0.06);
    color: var(--status-server-err);
}

.test-result-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Modals ───────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: 90%;
    max-width: 720px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-sm {
    max-width: 480px;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header h2 {
    font-size: 15px;
    font-weight: 600;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--border-focus);
}

/* Environment Modal */
.env-sidebar {
    margin-bottom: 16px;
}

.add-env-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
}

.env-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.env-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 12px;
    color: var(--text-secondary);
}

.env-list-item:hover, .env-list-item.active {
    background: rgba(129,140,248,0.08);
    color: var(--text-primary);
}

.env-editor {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 14px;
    min-height: 120px;
}

/* ── Toast Notifications ──────────────────── */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 200px;
}

.toast.success {
    border-left: 3px solid var(--accent-emerald);
}

.toast.error {
    border-left: 3px solid var(--accent-rose);
}

.toast.info {
    border-left: 3px solid var(--accent-indigo);
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

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

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

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

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

/* ── Responsive ───────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 100;
        left: 0;
        top: 0;
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .environment-selector label {
        display: none;
    }

    .kv-header, .kv-row {
        grid-template-columns: 1fr 1fr 36px;
    }

    .kv-col-desc, .kv-row input:nth-child(3) {
        display: none;
    }
}

/* ── Selection ────────────────────────────── */
::selection {
    background: rgba(129,140,248,0.3);
    color: white;
}
