:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--gray-900) 0%, #0f172a 100%);
    color: var(--gray-100);
    min-height: 100vh;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-800);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.logo {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-800);
    border-radius: 50px;
    font-size: 0.875rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-500);
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-800);
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, white 0%, var(--gray-400) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-content p {
    color: var(--gray-400);
}

.header-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 968px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--gray-300);
}

.section-title svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

/* Endpoint Cards */
.endpoint-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.endpoint-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.endpoint-card:hover {
    background: var(--gray-700);
    border-color: var(--primary);
    transform: translateX(4px);
}

.endpoint-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.endpoint-icon svg {
    width: 24px;
    height: 24px;
}

.endpoint-icon.status {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.endpoint-icon.users {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.endpoint-icon.inventory {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.endpoint-icon.order {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.endpoint-info {
    flex: 1;
}

.endpoint-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.endpoint-info p {
    font-size: 0.875rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.endpoint-method {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.endpoint-method.get {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.endpoint-method.post {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.endpoint-arrow {
    width: 20px;
    height: 20px;
    color: var(--gray-500);
    transition: transform 0.2s ease;
}

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

/* Response Panel */
.response-panel {
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-700);
    background: var(--gray-900);
}

.panel-header .section-title {
    margin-bottom: 0;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.latency-badge {
    padding: 0.25rem 0.75rem;
    background: var(--gray-700);
    border-radius: 50px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--gray-400);
}

.latency-badge.fast {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.latency-badge.medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.latency-badge.slow {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--gray-600);
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--gray-700);
    color: white;
    border-color: var(--gray-500);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Output Container */
.output-container {
    padding: 1.25rem;
    min-height: 400px;
    max-height: 500px;
    overflow: auto;
}

#output {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.placeholder {
    color: var(--gray-500);
    font-style: italic;
}

.loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-400);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-600);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error {
    color: var(--danger);
}

/* JSON Syntax Highlighting */
.json-key {
    color: #7dd3fc;
}

.json-string {
    color: #86efac;
}

.json-number {
    color: #fcd34d;
}

.json-boolean {
    color: #c4b5fd;
}

.json-null {
    color: var(--gray-500);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
    font-size: 0.875rem;
    border-top: 1px solid var(--gray-800);
    margin-top: 3rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.75rem 1.5rem;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.875rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

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

::-webkit-scrollbar-track {
    background: var(--gray-800);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-600);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Responsive */
@media (max-width: 640px) {
    .navbar {
        padding: 1rem;
    }
    
    .main-container {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .header-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .endpoint-card {
        padding: 1rem;
    }
    
    .endpoint-icon {
        width: 40px;
        height: 40px;
    }
    
    .endpoint-icon svg {
        width: 20px;
        height: 20px;
    }
}
