:root {
    --bg-color: #060707;
    --panel-bg: rgba(18, 18, 18, 0.6);
    --hot-pink: #0aa55a;
    --neon-purple: #a1a1aa;
    --bright-cyan: #1ae784;
    --text-main: #ffffff;
    --text-muted: #8b8b9b;
}

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

body {
    font-family: 'Work Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    padding: 40px;
    overflow-x: hidden;
}

.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.1;
    animation: float 10s infinite alternate ease-in-out;
}

.glow.pink {
    background: var(--hot-pink);
    top: -100px;
    left: -100px;
}

.glow.cyan {
    background: var(--bright-cyan);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(50px, 50px) scale(1.2);
    }
}

h1,
h2,
h3 {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shift container left when panel opens */
body.panel-open .container {
    transform: translateX(-200px);
}

.header {
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 24px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.accent-cyan {
    color: var(--bright-cyan);
    text-shadow: 0 0 15px rgba(26, 231, 132, 0.4);
}

.subtitle {
    color: var(--neon-purple);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.description {
    color: var(--text-muted);
    max-width: 900px;
    line-height: 1.6;
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.tooltip {
    color: var(--bright-cyan);
    border-bottom: 1px dashed rgba(26, 231, 132, 0.5);
    cursor: help;
    position: relative;
    font-weight: 500;
    transition: all 0.2s;
}

.tooltip:hover {
    border-bottom-color: var(--bright-cyan);
    text-shadow: 0 0 8px rgba(26, 231, 132, 0.4);
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: max-content;
    max-width: 300px;
    background: rgba(10, 10, 15, 0.98);
    border: 1px solid var(--bright-cyan);
    color: #fff;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Work Sans', sans-serif;
    line-height: 1.5;
    font-weight: 400;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    pointer-events: none;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.8),
        0 0 15px rgba(26, 231, 132, 0.1);
    text-align: left;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

.controls {
    display: flex;
    justify-content: flex-start;
    gap: 16px;
    margin-top: 24px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 12px 24px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
    display: inline-block;
    line-height: 1;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.tab-btn.active {
    color: var(--bright-cyan);
    background: rgba(26, 231, 132, 0.05);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--bright-cyan);
    box-shadow: 0 0 10px var(--bright-cyan);
}

.tab-content {
    display: none;
}

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

/* Swagger Style Docs */
.swagger-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.swagger-lead {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 720px;
}

.swagger-lead code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    color: var(--bright-cyan);
}

#swagger-ui {
    background: #0a0a0a;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    min-height: 600px;
    padding: 8px 16px;
}

.api-group {
    margin-bottom: 32px;
}

.api-group h2 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 16px;
    border-left: 4px solid var(--neon-purple);
    padding-left: 12px;
}

.endpoint-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
    overflow: hidden;
}

.endpoint-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.endpoint-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.method {
    font-weight: 800;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 2px;
    min-width: 60px;
    text-align: center;
}

.method.get {
    background: rgba(26, 231, 132, 0.2);
    color: var(--bright-cyan);
    border: 1px solid var(--bright-cyan);
}
.method.post {
    background: rgba(161, 161, 170, 0.2);
    color: var(--neon-purple);
    border: 1px solid var(--neon-purple);
}

.path {
    font-family: 'Courier New', Courier, monospace;
    color: #fff;
    font-size: 14px;
}

.endpoint-details {
    padding: 16px;
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.endpoint-details.open {
    display: block;
}

.doc-text {
    color: var(--text-main);
    margin-bottom: 16px;
}

.code-block-header {
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
}

pre {
    background: #000;
    padding: 16px;
    border-radius: 4px;
    font-size: 13px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn {
    background: rgba(26, 231, 132, 0.1);
    border: 1px solid var(--bright-cyan);
    color: var(--bright-cyan);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(26, 231, 132, 0.2);
}

.btn:hover {
    background: var(--bright-cyan);
    color: #000;
    box-shadow: 0 0 20px rgba(26, 231, 132, 0.6);
}

.architecture-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 32px;
    position: relative;
    transition: opacity 0.3s ease;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.column:nth-child(1) {
    animation-delay: 0.1s;
}
.column:nth-child(2) {
    animation-delay: 0.2s;
}
.column:nth-child(3) {
    animation-delay: 0.3s;
}
.column:nth-child(4) {
    animation-delay: 0.4s;
}
.column:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.architecture-grid.focus-mode .node:not(.path-connected) {
    opacity: 0.08;
    filter: grayscale(100%) blur(2px);
    transform: scale(0.98);
}

.column-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.node {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.node.pulse-node {
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(26, 231, 132, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(26, 231, 132, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(26, 231, 132, 0);
    }
}

.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.node[data-color='pink'] .icon {
    color: var(--hot-pink);
}
.node[data-color='cyan'] .icon {
    color: var(--bright-cyan);
}
.node[data-color='purple'] .icon {
    color: var(--neon-purple);
}

.node:hover,
.node.path-connected {
    transform: translateY(-4px) scale(1.02);
    background: rgba(30, 30, 45, 0.9);
    z-index: 20;
}

.node.focused {
    background: rgba(40, 40, 60, 0.9);
    border-width: 2px;
}

.node[data-color='pink']:hover,
.node[data-color='pink'].path-connected {
    border-color: var(--hot-pink);
    box-shadow: 0 0 20px rgba(10, 165, 90, 0.3);
}

.node[data-color='cyan']:hover,
.node[data-color='cyan'].path-connected {
    border-color: var(--bright-cyan);
    box-shadow: 0 0 20px rgba(26, 231, 132, 0.3);
}

.node[data-color='purple']:hover,
.node[data-color='purple'].path-connected {
    border-color: var(--neon-purple);
    box-shadow: 0 0 20px rgba(161, 161, 170, 0.3);
}

.node h3 {
    font-size: 0.95rem;
    margin: 0;
}

/* SVG Connections Layer */
#connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

path.flow-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 2;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

path.flow-line.active {
    stroke-width: 3;
    stroke-dasharray: 8 8;
    animation: data-flow 1s linear infinite;
}

@keyframes data-flow {
    to {
        stroke-dashoffset: -16;
    }
}

path.flow-line.active.pink {
    stroke: rgba(10, 165, 90, 0.6);
    filter: drop-shadow(0 0 5px var(--hot-pink));
}
path.flow-line.active.cyan {
    stroke: rgba(26, 231, 132, 0.6);
    filter: drop-shadow(0 0 5px var(--bright-cyan));
}
path.flow-line.active.purple {
    stroke: rgba(161, 161, 170, 0.6);
    filter: drop-shadow(0 0 5px var(--neon-purple));
}

circle.packet {
    opacity: 0;
    transition: opacity 0.3s;
}

circle.packet.active {
    opacity: 1;
}

/* Side Panel Styles */
.side-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 400px;
    height: 100vh;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.side-panel.open {
    right: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
    position: relative;
}

.panel-header h2 {
    font-size: 1.4rem;
}

.panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: -10px;
    transition: color 0.2s;
}

.panel-close:hover {
    color: var(--hot-pink);
}

.panel-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--bright-cyan);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.panel-section p {
    color: var(--text-main);
    line-height: 1.6;
    font-size: 0.95rem;
}

pre {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
}

code {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--neon-purple);
}

@media (max-width: 1200px) {
    .architecture-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .architecture-grid {
        grid-template-columns: 1fr;
    }
    .side-panel {
        width: 100%;
        right: -100%;
    }
}
