body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background-color: #222;
    color: #fff;
    padding: 15px 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    margin-bottom: 20px;
    position: relative;
}
.header h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: bold;
}
.header .nav-links {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    display: flex;
    gap: 15px;
}
.header .nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
}
.header .nav-links a:hover {
    color: #ccc;
}
.header .nav-links .fa-home {
    font-size: 1.3em;
}

/* New style for right-aligned navigation links */
.header .nav-right {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}
.header .nav-right a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid #fff;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.header .nav-right a:hover {
    background-color: #fff;
    color: #222;
}


.content-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 20px;
}
.content {
    max-width: 900px;
    width: 100%;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.content h1, .content h2 {
    color: #222;
}
.content h3 {
    color: #444;
}
/*
.content pre {
    background: #eee;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    border: 1px solid #ddd;
}
.content code {
    font-family: 'Courier New', monospace;
    background-color: #e9e9e9;
    padding: 2px 4px;
    border-radius: 3px;
}
*/
.content pre {
    background: #272822; /* Dark background for code block */
    color: #f8f8f2; /* Light text for code block */
    padding: 15px; /* Increased padding */
    border-radius: 8px; /* Slightly more rounded corners */
    overflow-x: auto;
    border: 1px solid #333;
    line-height: 1.4; /* Adjust line height for better readability */
}
.content code {
    font-family: 'Courier New', monospace;
    background-color: #e0e0e0; /* Lighter background for inline code */
    color: #333; /* Darker text for inline code */
    padding: 2px 4px;
    border-radius: 3px;
}
.content-wrap {
    white-space: pre-wrap;
    word-break: break-all;
}
.content pre code {
    background-color: transparent; 
    color: inherit;
    padding: 0;
    border-radius: 0;
}
.content ul {
    list-style-type: disc;
    margin-left: 20px;
}
.content p {
    margin-bottom: 10px;
    text-align: left;
    color: #333;
}

/* Specific styles for the index page to override .content max-width and ul/li */
/* .content in index page should have max-width 800px */
.ai-index-content {
    max-width: 800px;
}
.ai-index-content p {
    text-align: center;
    margin-bottom: 25px;
    color: #555;
    font-size: 1.05em;
}

.ai-index-content ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.ai-index-content li {
    margin-bottom: 12px;
    background-color: #f9f9f9;
    border-left: 5px solid #666;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.ai-index-content li:last-child {
    margin-bottom: 0;
}
.ai-index-content li:hover {
    background-color: #eaeaea;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
.ai-index-content a {
    text-decoration: none;
    color: #444;
    font-weight: bold;
    font-size: 1.1em;
    display: block;
    padding: 15px 20px;
    outline: none;
}
.ai-index-content a:hover {
    color: #000;
}
.ai-index-content a:active {
    transform: translateY(1px);
}

/* New navigation at the bottom of pages */
.page-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
width: clamp(300px, calc(100vw - 40px), 900px);
    margin: 20px auto;
    padding: 15px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.page-navigation .nav-link {
    flex: 1;
    text-align: center;
}
.page-navigation .nav-link.prev {
    text-align: left;
}
.page-navigation .nav-link.next {
    text-align: right;
}
.page-navigation .nav-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.page-navigation .nav-link a:hover {
    background-color: #007bff;
    color: #fff;
}
.page-navigation .nav-link a i {
    font-size: 1em;
}
.page-navigation .nav-link span {
    font-size: 0.9em;
    color: #666;
    display: block;
    margin-top: 5px;
}
.page-navigation .nav-link.disabled a {
    color: #ccc;
    cursor: not-allowed;
    background-color: transparent;
}
.page-navigation .nav-link.disabled a:hover {
    background-color: transparent;
    color: #ccc;
}


.footer {
    background-color: #222;
    color: #fff;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.9em;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    margin-top: 20px;
}

@media (max-width: 600px) {
    .header {
        padding: 10px 15px;
    }
    .header h1 {
        font-size: 1.0em;
        padding: 0px 35px;
    }
    .header .nav-links {
		left: 5px;
    	gap: 0px;
	}
    .header .nav-right {
		right: 5px;
    }
/*
    .header .nav-links {
        position: static;
        transform: none;
        justify-content: center;
        margin-top: 10px;
    }
    .header .nav-right {
        position: static;
        transform: none;
        margin-top: 10px;
        text-align: center;
        width: 100%;
    }
*/
    .content {
        padding: 20px;
        margin: 15px;
    }
    li {
        margin-bottom: 8px;
    }
/*
    a {
        font-size: 1em;
        padding: 12px 5px;
    }
*/
    .page-navigation {
        flex-direction: column;
        padding: 10px;
    }
    .page-navigation .nav-link {
        width: 100%;
        text-align: center !important;
        margin-bottom: 10px;
    }
    .page-navigation .nav-link:last-child {
        margin-bottom: 0;
    }
/*
    .page-navigation .nav-link a {
        display: flex;
        justify-content: center;
    }
*/
    .page-navigation .nav-link a {
        display: flex; /* Changed from inline-flex for better block-like behavior */
        flex-direction: column; /* Stack icon and text vertically */
        align-items: center; /* Center items vertically */
        justify-content: center; /* Center items horizontally within the link */
        white-space: normal; /* Allow text to wrap */
        word-break: break-word; /* Break long words if necessary */
        padding: 10px; /* Adjust padding for mobile links */
    }
    .page-navigation .nav-link a i {
        margin-bottom: 5px; /* Add some space between icon and text */
    }
    .page-navigation .nav-link span {
        display: block; /* Ensure the span text takes its own line */
        font-size: 0.85em; /* Slightly smaller font for secondary text */
        line-height: 1.2;
    }
}
