body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f9;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

nav {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.5rem 2rem;
    margin-bottom: 40px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

nav li {
    margin: 0 15px;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out;
}

nav a:hover, nav a.active {
    background-color: #eef5ff; /* A subtle hover/active color */
}

.header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 20px;
}

h1 { font-size: 2.5rem; color: #1a1a1a; }
h2, h3, h4 { color: #1a1a1a; }

.content-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 2rem 4rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.dialogue-entry { 
    margin-bottom: 2rem; 
    display: flex; 
    flex-direction: column; 
}

.bubble {
    padding: 15px 25px;
    border-radius: 20px;
    max-width: 85%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow-wrap: break-word;
}

.user-bubble {
    background-color: #007aff;
    color: #ffffff;
    border-bottom-right-radius: 5px;
    align-self: flex-end;
}

.ai-bubble {
    background-color: #ffffff;
    color: #333;
    border-bottom-left-radius: 5px;
    align-self: start;
    border: 1px solid #e0e0e0;
}

.ai-bubble p, .user-bubble p { margin: 1em 0; }
.ai-bubble p:first-child, .user-bubble p:first-child { margin-top: 0; }
.ai-bubble p:last-child, .user-bubble p:last-child { margin-bottom: 0; }
.ai-bubble ul, .ai-bubble ol { padding-left: 20px; }

.label { 
    font-size: 0.9rem; 
    font-weight: bold; 
    color: #555; 
    margin-bottom: 5px; 
}

.user-label { align-self: flex-end; margin-right: 20px; }
.ai-label { align-self: flex-start; margin-left: 20px; }

.home-link { 
    display: block; 
    text-align: center; 
    margin-top: 40px; 
    padding-top: 20px; 
    border-top: 2px solid #e0e0e0; 
    text-decoration: none; 
    color: #007aff; 
    font-weight: bold; 
}

/* Table Styles */
.ai-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.ai-bubble th, .ai-bubble td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.ai-bubble th {
    background-color: #f2f2f2;
    font-weight: bold;
}

footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.9rem;
    color: #777;
}

footer p {
    margin: 0.5em 0;
}

.cta-section {
    background-color: #eef5ff;
    border: 1px solid #cce0ff;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-top: 40px;
}

.cta-button {
    display: inline-block;
    background-color: #007aff;
    color: #ffffff;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s ease-in-out;
}

.cta-button:hover {
    background-color: #0056b3;
}

.resource-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

dl {
    margin: 1.5rem 0;
}

dt {
    font-weight: bold;
    font-size: 1.2rem;
    color: #1a1a1a;
}

dd {
    margin-left: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.perspective-entry {
    margin-top: 3rem;
}

.attribution {
    font-style: italic;
    color: #555;
    font-size: 0.9rem;
}

blockquote {
    border-left: 4px solid #cce0ff;
    padding-left: 1.5rem;
    margin-left: 0;
    font-style: italic;
}

.back-to-top {
    display: block;
    text-align: right;
    margin-top: 1rem;
    font-weight: bold;
    text-decoration: none;
    color: #007aff;
}

/* Styles for the new sidebar */
.sidebar {
    width: 240px;       /* Set a fixed width for the sidebar */
    flex-shrink: 0;     /* Prevents the sidebar from shrinking */
    position: sticky;   /* Makes the sidebar stick within its container */
    top: 40px;          /* The distance from the top it should stick at */
}

.sidebar h3 {
    margin-top: 0;
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 0.5rem;
}

.sidebar a {
    text-decoration: none;
    color: #555;
    display: block;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
}

.sidebar a:hover {
    background-color: #eef5ff;
    color: #007aff;
}

/* Ensure the main content area takes up the remaining space */
main {
    flex-grow: 1; /* Allows the content to fill the available space */
    min-width: 0; /* Prevents content overflow issues in flexbox */
}

.layout-sidebar {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}
