/* Article page styles */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
    line-height: 1.7;
}

.article-header {
    margin-bottom: 3rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    display: inline-block;
    transition: opacity 0.2s ease;
}

.back-link:hover {
    opacity: 0.8;
}

.article-content {
    color: var(--text-secondary);
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2.5rem 0 1rem 0;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content pre {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-content pre::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 8px;
    height: 8px;
    background: #ff5f56;
    border-radius: 50%;
    box-shadow: 16px 0 0 #ffbd2e, 32px 0 0 #27ca3f;
}

.article-content pre code {
    background: none;
    padding: 0;
    border: none;
    color: var(--text-primary);
    padding-top: 1rem;
    display: block;
}

.article-content code {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.85em;
    border: 1px solid var(--border);
    color: var(--accent);
    font-weight: 500;
}

/* HTTP Demo Animation Styles (specific to HTTP article) */
.http-demo {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.demo-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 120px;
    position: relative;
}

.browser, .server {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.9rem;
    border: 2px solid var(--border);
    position: relative;
    z-index: 2;
}

.browser {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

.server {
    background: linear-gradient(135deg, var(--accent), #ff7849);
    color: white;
}

.request-arrow, .response-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0;
    z-index: 1;
}

.request-arrow {
    width: 0;
    animation: requestFlow 3s ease-in-out infinite;
}

.response-arrow {
    width: 0;
    animation: responseFlow 3s ease-in-out infinite;
    animation-delay: 1.5s;
    background: #4f46e5;
}

.request-arrow::after, .response-arrow::after {
    content: '';
    position: absolute;
    right: -8px;
    top: -4px;
    width: 0;
    height: 0;
    border-left: 8px solid;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.request-arrow::after {
    border-left-color: var(--accent);
}

.response-arrow::after {
    border-left-color: #4f46e5;
    transform: rotate(180deg);
    right: auto;
    left: -8px;
}

@keyframes requestFlow {
    0%, 20% {
        opacity: 0;
        width: 0;
    }
    25%, 45% {
        opacity: 1;
        width: 200px;
    }
    50%, 100% {
        opacity: 0;
        width: 200px;
    }
}

@keyframes responseFlow {
    0%, 20% {
        opacity: 0;
        width: 0;
    }
    25%, 45% {
        opacity: 1;
        width: 200px;
    }
    50%, 100% {
        opacity: 0;
        width: 200px;
    }
}

.demo-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.request-label, .response-label {
    opacity: 0;
    animation: labelFade 3s infinite;
}

.response-label {
    animation-delay: 1.5s;
}

@keyframes labelFade {
    0%, 20% { opacity: 0; }
    25%, 45% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@media (max-width: 600px) {
    .demo-container {
        flex-direction: column;
        gap: 2rem;
        min-height: 200px;
    }

    .request-arrow, .response-arrow {
        width: 3px;
        height: 0;
        transform: translateX(-50%) translateY(-50%) rotate(90deg);
    }

    @keyframes requestFlow {
        0%, 20% { opacity: 0; height: 0; }
        25%, 45% { opacity: 1; height: 80px; }
        50%, 100% { opacity: 0; height: 80px; }
    }

    @keyframes responseFlow {
        0%, 20% { opacity: 0; height: 0; }
        25%, 45% { opacity: 1; height: 80px; }
        50%, 100% { opacity: 0; height: 80px; }
    }
}