@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #050508;
    --surface: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    --surface-solid: rgba(18, 18, 24, 0.75);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.2);
    --primary: #818cf8;
    --primary-glow: rgba(129, 140, 248, 0.5);
    --primary-gradient: linear-gradient(135deg, #818cf8, #c084fc);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --blur: blur(24px);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100dvh;
    overflow: hidden;
    display: flex;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background Atmosphere */
.background-fx {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at top left, rgba(129, 140, 248, 0.05), transparent 50%),
                radial-gradient(circle at bottom right, rgba(192, 132, 252, 0.05), transparent 50%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 25s infinite ease-in-out alternate;
    will-change: transform;
}

.orb-1 { width: 450px; height: 450px; background: #4f46e5; top: -150px; left: -100px; }
.orb-2 { width: 350px; height: 350px; background: #9333ea; bottom: 5%; right: -50px; animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; background: #2563eb; top: 50%; left: 20%; animation-delay: -14s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -50px) scale(1.1); }
    66% { transform: translate(-30px, 40px) scale(0.9); }
    100% { transform: translate(-20px, -30px) scale(1.05); }
}

/* App Container */
.app-container {
    display: flex;
    width: 100%;
    height: 100dvh;
    padding: 2rem;
    gap: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    animation: fadeInPage 1s ease-out;
}

@keyframes fadeInPage {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Glass Panel Mixin */
.glass-panel {
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

/* Sidebar */
.sidebar {
    width: 300px;
    padding: 2.5rem 2rem;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-highlight);
    border-radius: 4px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
}

.logo {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 0 20px var(--primary-glow);
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
    padding-right: 0.5rem;
}

.nav-menu::-webkit-scrollbar {
    width: 4px;
}
.nav-menu::-webkit-scrollbar-thumb {
    background: var(--border-highlight);
    border-radius: 4px;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 14px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-item a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    transition: var(--transition-bounce);
}

.nav-item a:hover {
    background: var(--surface-hover);
    color: var(--text-main);
    transform: translateX(6px);
}

.nav-item a.active {
    background: rgba(129, 140, 248, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.nav-item a.active::before {
    transform: translateY(-50%) scaleY(1);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 3.5rem 4rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    position: relative;
    scroll-behavior: smooth;
}

.main-content::-webkit-scrollbar {
    width: 6px;
}
.main-content::-webkit-scrollbar-thumb {
    background: var(--border-highlight);
    border-radius: 6px;
}
.main-content::-webkit-scrollbar-track {
    background: transparent;
    margin: 2rem 0;
}

header {
    margin-bottom: 4rem;
    position: relative;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.3);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

header p {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 600px;
}

/* Sections & Typography */
.scroll-section {
    margin-bottom: 5rem;
    scroll-margin-top: 3rem;
}

h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 1rem;
}

h2::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border), transparent);
}

.card {
    padding: 2.5rem;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 20px;
    line-height: 1.7;
    font-size: 1rem;
    color: #cbd5e1;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    transition: var(--transition-fast);
}

.card:hover {
    border-color: var(--border-highlight);
}

.card h3 {
    color: var(--text-main);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
}

.card code {
    background: rgba(0,0,0,0.4);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: #e2e8f0;
    border: 1px solid var(--border);
}

/* Interactive Tool Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.tool-card {
    background: rgba(12, 12, 16, 0.8);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    overflow: hidden;
    word-break: break-word;
}

.tool-card:hover {
    background: rgba(20, 20, 26, 0.9);
    border-color: var(--border-highlight);
    border-left-color: var(--primary);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 15px 35px -5px rgba(0,0,0,0.4),
                0 0 20px -5px var(--primary-glow);
}

.tool-name {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    font-size: 1.15rem;
    font-weight: 600;
    list-style: none;
    outline: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    word-break: break-word;
}

.tool-name span {
    flex: 1;
}

.tool-name::-webkit-details-marker {
    display: none;
}

.tool-name::after {
    content: '+';
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.tool-card[open] .tool-name::after {
    transform: rotate(45deg);
}

.tool-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--border);
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.tool-desc strong {
    color: #e2e8f0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: block;
}

.tool-desc ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tool-desc li {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: rgba(255,255,255,0.03);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    word-break: break-word;
}

.tool-desc li code {
    color: var(--primary);
    background: transparent;
    border: none;
    padding: 0;
    font-weight: 600;
}

/* Accessibility Toggle Button */
.a11y-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    background: rgba(15, 15, 20, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.a11y-toggle:hover {
    color: var(--text-main);
    border-color: var(--border-highlight);
    transform: scale(1.1);
}

.a11y-toggle.active {
    background: rgba(129, 140, 248, 0.2);
    color: #c084fc;
    border-color: #818cf8;
    box-shadow: 0 0 15px var(--primary-glow);
}

.a11y-toggle .anim-text::after {
    content: " ON";
}
.a11y-toggle.active .anim-text::after {
    content: " OFF";
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    .sidebar {
        width: 100%;
        padding: 1.5rem;
        border-radius: 16px;
    }
    .brand { margin-bottom: 1.5rem; }
    .nav-menu { 
        flex-direction: row; 
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    .nav-item a { padding: 0.75rem 1rem; white-space: nowrap; }
    .main-content {
        padding: 2rem;
        border-radius: 16px;
    }
    h1 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
    .tools-grid { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .a11y-toggle { top: 1rem; right: 1rem; }
}

/* Enhancements: Search, Badges, Examples */
.search-container {
    margin-bottom: 2rem;
    position: relative;
}
.search-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    padding-left: 3rem;
    background: rgba(12, 12, 16, 0.8);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition-fast);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow), inset 0 2px 10px rgba(0,0,0,0.5);
}
.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.hidden { display: none !important; }

/* Tool Badges */
.tool-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.t-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.t-badge.live { background: rgba(16, 185, 129, 0.1); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.t-badge.cached { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.t-badge.auth { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.t-badge.dep { background: rgba(148, 163, 184, 0.1); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); font-family: "JetBrains Mono", monospace;}

/* Capability Matrix / Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.feature-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 12px;
}
.feature-card h4 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}
.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Agent Examples */
.agent-example {
    background: #000;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.agent-example h4 {
    color: #e2e8f0;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.agent-example p.prompt {
    font-family: "JetBrains Mono", monospace;
    color: #a5b4fc;
    font-size: 0.9rem;
    line-height: 1.5;
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* Config Tabs */
.mcp-table-container { overflow-x: auto; margin-bottom: 2.5rem; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.02); }
.mcp-table-container table { width: 100%; border-collapse: collapse; font-size: 0.9rem; text-align: left; }
.mcp-table-container th { padding: 14px 20px; color: #94a3b8; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.2); }
.mcp-table-container td { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.04); color: #e2e8f0; }
.mcp-table-container tr:last-child td { border-bottom: none; }
.mcp-table-container tr:hover td { background: rgba(255,255,255,0.02); }
.mcp-status-native { color: #34d399; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.mcp-status-bridge { color: #fbbf24; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }

.mcp-config-tabs { display: flex; gap: 10px; margin-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; flex-wrap: wrap; }
.mcp-tab-btn {
    background: transparent; color: #a0aec0; border: 1px solid transparent;
    padding: 8px 16px; border-radius: 6px; cursor: pointer; transition: all 0.2s;
    font-weight: 500; font-family: 'Inter', sans-serif;
}
.mcp-tab-btn.active, .mcp-tab-btn:hover {
    background: rgba(129, 140, 248, 0.1); color: var(--primary); border-color: rgba(129, 140, 248, 0.3);
}
.mcp-code-wrapper {
    position: relative; display: none; background: #0b0f19; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    padding-top: 38px;
}
.mcp-code-wrapper::before {
    content: ''; position: absolute; top: 14px; left: 16px; width: 12px; height: 12px; border-radius: 50%;
    background: #ef4444; box-shadow: 20px 0 0 #f59e0b, 40px 0 0 #10b981;
}
.mcp-code-wrapper.active { display: block; }
.mcp-code-block {
    padding: 0 1.25rem 1.25rem 1.25rem; padding-right: 90px; font-family: "JetBrains Mono", monospace; font-size: 0.85rem;
    color: #a5b4fc; overflow-x: auto; margin: 0; line-height: 1.6;
}
.mcp-copy-btn {
    position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,0.1); color: #fff;
    border: 1px solid rgba(255,255,255,0.1); padding: 6px 12px; border-radius: 6px; cursor: pointer;
    font-size: 0.75rem; font-weight: bold; transition: all 0.2s; backdrop-filter: blur(4px); font-family: 'Inter', sans-serif;
}
.mcp-copy-btn:hover { background: rgba(129, 140, 248, 0.2); color: var(--primary); border-color: rgba(129, 140, 248, 0.4); }
.mcp-toast {
    position: fixed; bottom: 24px; right: 24px; background: #10b981; color: #fff;
    padding: 12px 24px; border-radius: 8px; opacity: 0; transition: opacity 0.3s;
    pointer-events: none; z-index: 2147483647; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-family: 'Inter', sans-serif; font-weight: 600;
}
.mcp-toast.show { opacity: 1; }

/* Reduced Motion Override */
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
    backdrop-filter: none !important;
}

.reduce-motion .orb { display: none; }
.reduce-motion .tool-card:hover { transform: none !important; box-shadow: none !important; }

/* Responsive Design */
@media (max-width: 1024px) {
    body {
        overflow-y: auto;
        min-height: 100vh;
    }
    
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding: 1rem;
        gap: 1rem;
    }
    
    .sidebar {
        width: 100%;
        padding: 1.5rem;
        flex-shrink: 0;
        overflow: visible;
    }
    
    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        overflow-y: visible;
        padding-right: 0;
    }
    
    .brand {
        margin-bottom: 1.5rem;
    }
    
    .main-content {
        padding: 2rem 1.5rem;
        overflow-y: visible;
        overflow-x: hidden;
    }
}
