/* === General Styles === */
body, h2, h3, h4, h5 {
    font-family: "Raleway", sans-serif;
    background-color: #1c1c1c;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
}

body {
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

p {
    margin-bottom: 1rem;
}

/* === Layout === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* === Article Title === */
h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 2rem 0;
    color: #ffffff;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* === Article Index === */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Individual Article Card */
.article-card {
    background: #2e2e2e;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Article Title */
.article-card-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ff69b4;
    overflow-wrap: break-word;
    margin-bottom: 0.2rem;
}

/* Article Date (Left-Aligned Below Title) */
.article-card-date {
    font-size: 1rem;
    font-style: italic;
    color: #cccccc;
    text-align: left;
    margin-top: 0.3rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .article-card {
        padding: 1rem;
    }

    .article-card-title {
        font-size: 1.2rem;
    }

    .article-card-date {
        font-size: 0.9rem;
    }
}

/* === Navigation Buttons === */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    margin: 2rem 0;
    gap: 1rem;
    flex-wrap: nowrap;
}

.nav-button {
    background-color: #6a5de2;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    padding: 12px 16px;
    flex: 1;
    max-width: 45%;
    min-width: 220px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: normal;
    word-wrap: break-word;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-button:hover {
    background-color: #ff00ff;
}

/* Mobile Adjustments for Navigation */
@media (max-width: 768px) {
    .navigation-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }

    .nav-button {
        max-width: 100%;
        min-width: unset;
        min-height: 70px;
        font-size: 0.9rem;
        padding: 10px 12px;
    }
}

/* === Content Container === */
.content-container {
    background-color: #2e2e2e;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    overflow-wrap: break-word;
}

/* === Hyperlinks in Article Text === */
.content-container a {
    text-decoration: underline;
}

/* === Related Articles === */
.related-articles-container {
    background-color: #3f3f3f;
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 2rem;
}

.related-articles-container h3 {
    margin-top: 0;
    color: #ff69b4;
}

.related-articles a {
    display: block;
    margin-bottom: 0.5rem;
    color: #ff69b4;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-articles a:hover {
    text-decoration: underline;
    color: #ff00ff;
}

/* === Footer === */
footer {
    background-color: #2b2b2b;
    color: #e0e0e0;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    border-top: 1px solid #3f3f3f;
}

/* === Syntax Highlighting with Highlight.js === */
pre[class*="language-"],
code[class*="language-"] {
    background: #1e1e1e;
    color: #dcdcdc;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: auto;
    border-radius: 6px;
    padding: 1.2rem;
    margin: 1.5rem 0;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
    white-space: pre;
}

/* === Animations === */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Center diagram containers */
.diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto; /* Add some spacing above and below */
    max-width: 90%; /* Prevent overflow on small screens */
    overflow: auto; /* Enable scrolling if content overflows */
}
.diagram > svg {
    max-width: 100%;
    height: auto;
}

/* Diagram container with background */
.diagram-container {
    background-color: #c6c6f2; /* Purple background */
    border: 1px solid #000; /* Black border */
    border-radius: 8px; /* Rounded corners */
    padding: 20px; /* Spacing inside the container */
    margin: 20px auto; /* Center the container itself */
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    text-align: center; /* Align text if any */
    min-height: 300px; /* Minimum height for centering */
    max-width: 100%; /* Prevent overflow */
    overflow: auto; /* Scroll if content overflows */
    box-sizing: border-box; /* Ensures padding doesn't affect dimensions */
}

/* Mermaid-specific overrides */
.diagram-container .mermaid {
    display: block; /* Takes up the necessary space */
    margin: auto; /* Centers inside the container */
    width: 100%; /* Ensures it uses full available width */
    max-width: 800px; /* Limits excessive scaling on large screens */
    min-width: 300px; /* Ensures a minimum size for readability */
    height: auto; /* Adjusts height dynamically */
    overflow: visible; /* Prevents clipping */
}

/* Bright white arrows and lines */
.mermaid .marker {
    stroke: #FFFFFF !important;
    fill: #FFFFFF !important;
}

.mermaid .edgePath .path {
    stroke: #FFFFFF !important;
    stroke-width: 2px !important;
}

/* === Adding Table Styles === */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 1rem;
    background-color: #554ead;
    color: #f7f7f7;
    border: 1px solid #6554ff;
}

table th, table td {
    padding: 0.8rem;
    text-align: left;
    border: 1px solid #b6adff; /* Ensure visible borders for all cells */
}

table th {
    background-color: #6a5de2;
    font-weight: bold;
    color: #ffffff;
}

@media (max-width: 768px) {
    table {
        font-size: 0.9rem;
    }

    table th, table td {
        padding: 0.6rem;
    }
}

