/* General Styles */
body {
    background-color: #f0f0f0; /* Light grey background */
    color: #ffffff; /* Darker text color for better contrast */
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Centered Page for Login and Register */
.centered-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Navbar for Logged-In Pages */
.navbar {
    text-align: center;
    background-color: #666666; /* White background for navbar */
    padding: 10px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    /* Ensure navbar stays on top */
}

.navbar a {
    color: #000000; /* Darker text color for better contrast */
    margin: 0 10px;
    text-decoration: none;
}

.navbar a:hover {
    color: #005f99; /* Hover color */
}

/* Header Adjustment */
header {
    padding-top: 30px;
    /* Adjust this value as needed to prevent overlap */
    text-align: center;
}

/* Form Container Styles (Login/Register) */
.form-container {
    background-color: #333;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

/* Input & Button Styles */
input[type="text"],
input[type="email"],
input[type="password"],
button {
    width: 90%;
    padding: 10px;
    margin: 10px 0;
    border: none;
    border-radius: 4px;
}

/* Add black outline to input fields */
input[type="text"],
input[type="email"],
input[type="password"] {
    outline: 2px solid black;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: 2px solid black;
}

/* Button Styles */
button {
    background-color: #005f99;
    color: white;
    cursor: pointer;
    display: inline-block; /* Ensure buttons are only as wide as their content */
    width: auto; /* Override the width to auto */
    padding: 10px 20px; /* Add padding for better appearance */
    white-space: nowrap; /* Ensure buttons are on one line */
}

button:hover {
    background-color: #004080;
}

/* Home Page Layout (Logged-in Page) */
main {
    padding-top: 20px;
    /* Adjusted for fixed navbar */
    padding: 20px;
    background-color: #fff;
    color: #333;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Center page titles */
main h2 {
    text-align: center;
}

/* Center all page contents */
.profile-info,
#profile-edit-form,
#new-post-form,
#user-posts {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: white;
}

/* Post Styles */
.post {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0; /* Remove auto margin to make the post container full width */
    background-color: #fff;
    width: 100%; /* Make the post container full width */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

/* Center the image within the post and make it larger */
.post img {
    display: block;
    margin: 0 auto;
    max-width: 100%; /* Ensure the image does not overflow the container */
    width: 100%; /* Make the image take up the full width of the container */
    height: auto; /* Maintain aspect ratio */
}

/* Make the image container larger */
.post .image-container {
    width: 100%;
    margin: 0 auto;
}

/* Like Button Styles */
.post button[onclick^='likePost'] {
    background: none;
    color: red;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.post button[onclick^='likePost']:hover {
    color: darkred;
}

/* Consistent Container Class */
.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.search-container {
    margin-bottom: 20px;
    width: 100%; /* Ensure search container fills the width */
}

#user-search-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#conversation-list {
    margin-bottom: 20px;
    width: 100%; /* Ensure conversation list fills the width */
}

#chat-container {
    display: none; /* Hide chat container until a conversation is selected */
    width: 100%; /* Ensure chat container fills the width */
}

#chat-box {
    border: 1px solid #ccc;
    padding: 10px;
    height: 300px;
    overflow-y: scroll;
    background: #f9f9f9;
    margin-bottom: 10px;
    width: 100%;
}

#message-input {
    width: calc(100% - 60px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    width: auto; /* Ensure buttons are only as wide as their content */
    padding: 10px 20px; /* Add padding for better appearance */
    border: none;
    border-radius: 4px;
    background-color: #005f99;
    color: white;
    cursor: pointer;
    white-space: nowrap; /* Ensure buttons are on one line */
}

button:hover {
    background-color: #004080;
}

#search-results div, #conversation-list div {
    cursor: pointer;
    padding: 10px;
    border-bottom: 1px solid #ccc;
}

#search-results div:hover, #conversation-list div:hover {
    background-color: #f0f0f0;
}

/* Profile Picture Styles */
.post-header .profile-picture {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    vertical-align: middle;
}

/* Post Header Styles */
.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.post-header img {
    flex-shrink: 0;
}

.post-header p {
    margin: 0;
    flex-grow: 1;
}

/* Delete Button Styles */
.delete-button {
    background-color: red;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    margin-left: 10px;
}

.delete-button:hover {
    background-color: darkred;
}