:root {
    --primary-color: #4a90e2;
    --text-color: #333333;
    --background-color: #ffffff;
    --hover-color: #357abd;
    --max-width: 1200px;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

body {
    font-family: var(--font-family), serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: var(--max-width);
    padding: 2rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

nav {
    width: 100%;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    position: relative;
}

nav a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.2s ease-in-out;
}

nav a:hover {
    color: var(--hover-color);
}

nav a:hover::after {
    transform: scaleX(1);
}

nav a.active {
    background-color: var(--primary-color);
    color: white;
}

nav a.active:hover {
    background-color: var(--hover-color);
}

/* Main content area */
main {
    flex: 1;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Add this to center the content within main */
main > div {
    width: 100%;
    max-width: 800px; /* or any preferred width */
    text-align: center;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.readme-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.markdown-body {
    padding: 2rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
    color: #333;
    text-align: left;
}

.not-found-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.error-details {
    margin: 2rem 0;
    max-width: 600px;
}

.requested-url {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.requested-url code {
    font-family: monospace;
    font-weight: bold;
    color: #e74c3c;
}

.not-found-actions {
    margin-top: 2rem;
}

.back-home-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out;
}

.back-home-button:hover {
    background-color: var(--hover-color);
}

.crate-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.crate-details {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 1.5rem;
}

.crate-description {
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 1.5rem 0;
    color: #444;
}

.crate-features {
    list-style-type: disc;
    margin: 1rem 0 1.5rem 1.5rem;
}

.crate-features li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.crate-info {
    margin: 1.5rem 0;
}

.crate-info dt {
    font-weight: bold;
    margin-top: 1rem;
    color: var(--primary-color);
}

.crate-info dd {
    margin-left: 1rem;
    margin-bottom: 0.75rem;
}

pre {
    background-color: #f0f0f0;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    font-family: "Courier New", Courier, monospace;
    margin: 1rem 0;
}

code {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.error-message {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.error-container ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.error-container a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background-color: #f0f0f0;
    transition: all 0.2s ease;
}

.error-container a:hover {
    background-color: var(--primary-color);
    color: white;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

/* Language selector styles */
.language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    background-color: #f7f7f7;
    border-radius: 8px;
    padding: 0.5rem;
}

.language-selector__label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.language-selector__buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.language-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid #e0e0e0;
    background-color: white;
    color: var(--text-color);
    border-radius: 4px;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.language-button__flag {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-button__name {
    font-size: 0.9rem;
}

.language-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    border-color: #ccc;
}

.language-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

.language-button--active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.language-button--active:hover {
    background-color: var(--hover-color);
}

.feature-item {
    cursor: pointer;
    transition: background 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}
.feature-item:hover {
    background: #f0f8ff;
}
.active-feature {
    background: #e0f7fa;
    font-weight: bold;
    border: 1px solid #4a90e2;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    nav a {
        display: block;
        width: 200px;
        text-align: center;
    }

    .language-button__name {
        display: none;
    }

    .language-button {
        padding: 0.5rem;
    }

    .language-button__flag {
        font-size: 1.5rem;
    }
}

/* For devices that prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .language-button:hover {
        transform: none;
    }

    nav a::after,
    nav a,
    .language-button,
    .back-home-button {
        transition: none;
    }
}
