body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    margin-top: 20px;
}

/* Navbar Styles */
nav {
    background-color: #333;
    color: #fff;
    padding: 10px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px; /* Adjust spacing between icons */
    font-size: 20px; /* Adjust icon size */
}

.nav-links a:hover {
    color: #77aaff;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-logo {
    flex: 1;
}

.navbar-logo a {
    color: #fff;
    font-size: 24px; /* Adjust icon size */
    text-decoration: none;
}

.navbar-logo a:hover {
    color: #77aaff;
}

.navbar-icons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 3;
}

.navbar-icons a {
    color: #fff;
    font-size: 24px; /* Adjust icon size */
    margin-left: 20px;
    text-decoration: none;
}

.navbar-icons a:hover {
    color: #77aaff;
}

.navbar-search {
    display: flex;
    align-items: center;
}

.navbar-search input {
    width: 200px; /* Adjust search bar width */
    padding: 5px;
    border: none;
    border-radius: 3px;
    margin-right: 5px;
}

.navbar-search button {
    background-color: #77aaff;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.category-search {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f4f4f4;
}

.category-search h1 {
    margin: 0;
}

.search-bar {
    margin-left: auto;
    width: 300px; /* Set a fixed width for the search bar */
    display: flex;
    align-items: center;
}

.search-bar input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
}

.search-bar button {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-left: none;
    background-color: #007bff;
    color: #fff;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

@media (max-width: 768px) {
    nav {
        justify-content: center; /* Center icons on mobile */
    }

    .nav-links {
        width: 100%;
        justify-content: space-around; /* Distribute icons evenly */
    }

    .nav-links a {
        font-size: 24px; /* Increase icon size on mobile */
        margin: 0; /* Remove extra margins */
    }

    .navbar-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .navbar-search {
        width: 100%;
        margin-bottom: 10px;
    }

    .navbar-search input {
        width: 100%;
    }

    .navbar-icons {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        margin-top: 10px;
    }

    .navbar-icons a {
        font-size: 20px; /* Adjust icon size for mobile */
    }

    .navbar-icons a:nth-child(1) {
        order: 1; /* Home icon */
    }

    .navbar-icons a:nth-child(2) {
        order: 2; /* Messages icon */
    }

    .navbar-icons a:nth-child(3) {
        order: 3; /* Post icon */
    }

    .navbar-icons a:nth-child(4) {
        order: 4; /* Logout icon */
    }

    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Adjust category item size for mobile */
    }

    .category-search {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-bar {
        width: 100%;
        margin-top: 10px;
    }
}

.chat-container {
    position: relative;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .navbar-search {
        width: 100%;
        margin: 10px 0;
    }

    .navbar-icons {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    .navbar-icons a:nth-child(2) {
        order: 3; /* Move profile icon to the right */
    }

    .navbar-icons a:nth-child(3) {
        order: 2; /* Move post-creating icon to the middle */
    }

    .category-search {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-bar {
        width: 100%;
        margin-top: 10px;
    }
}

.chat-container {
    position: relative;
    height: calc(100vh - 120px); /* Adjust height to account for header and footer */
    display: flex;
    flex-direction: column;
    border: none;
}

.chat-sidebar {
    width: 25%;
    border-right: 1px solid #ccc;
    padding: 10px;
}

.chat-main {
    width: 75%;
    padding: 10px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding-top: 80px; /* Space for the fixed header */
    padding-bottom: 80px; /* Space for the message form */
    scroll-behavior: smooth;
}

.message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
}

.message.sent {
    background-color: #e1ffc7;
    align-self: flex-end;
}

.message.received {
    background-color: #f1f1f1;
    align-self: flex-start;
}

.message img, .message video {
    max-width: 100%;
    height: auto;
    margin-top: 10px;
}

.timestamp {
    display: block;
    font-size: 0.8em;
    color: #888;
    margin-top: 5px;
}

.dropdown {
    position: relative;
    display: inline-block;
    background-color: white;
    color: black;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-family: 'Arial, sans-serif';
    font-size: 16px;
    position: relative;
}

.dropbtn {
    background-color: white;
    color: black;
    padding: 10px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    position: relative; /* Add relative positioning */
}

.dropbtn::after {
    content: '\25BC'; /* Add arrow */
    font-size: 12px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.dropbtn:hover {
    background-color: #f1f1f1;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 220px; /* Increase min-width to ensure text is fully visible */
    max-height: 200px; /* Limit the height of the dropdown */
    overflow-y: auto; /* Add a scroll bar if necessary */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 4px;
    font-family: 'Arial, sans-serif'; /* Add font style */
    font-size: 16px; /* Add font size */
    border: 1px solid #ccc;
    right: 0; /* Ensure dropdown is aligned to the right */
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #ddd;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    background-color: #0056b3;
}

.icon {
    margin-right: 10px;
    color: #007bff;
    text-decoration: none;
    font-size: 16px;
}

.icon:hover {
    color: #0056b3;
}

.icon i {
    margin-right: 5px;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.message-form {
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    background: #fff;
    padding: 10px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    align-items: center;
    z-index: 1001;
    justify-content: space-between; /* Ensure items are spaced evenly */
}

.message-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
}

.message-form button {
    padding: 10px 20px;
    border: none;
    background: #007bff;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}

.message-form .file-picker {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-left: 10px;
}

.message-form .file-picker input[type="file"] {
    display: none;
}

.message-form .file-picker i {
    font-size: 24px;
    color: #007bff;
}

.chat-header {
    position: fixed;
    top: 40px; /* Adjust top position to account for the home icon */
    width: 100%;
    background-color: #333;
    color: #fff;
    padding: 10px;
    text-align: center;
    border-bottom: 2px solid #007bff;
    z-index: 1000;
}

.chat-header h1 {
    margin: 0;
    font-size: 18px;
}

.chat-header p {
    margin: 5px 0 0;
    font-size: 14px;
}

.home-icon {
    position: fixed;
    top: 0;
    left: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 24px;
    z-index: 1001;
}

.progress-bar {
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar-fill {
    height: 20px;
    background-color: darkgray;
    width: 0;
    transition: width 0.2s;
}

.file-preview {
    display: none;
    margin-top: 10px;
    text-align: center;
}

.file-preview img, .file-preview video {
    max-width: 100%;
    height: auto;
}

.progress-bar-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    display: none;
}

.progress-bar {
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 20px;
    background-color: darkgray;
    width: 0;
    transition: width 0.2s;
}

.progress-bar-text {
    text-align: center;
    padding: 10px;
    color: #333;
}

@media (max-width: 768px) {
    .message-form {
        flex-direction: column;
        align-items: stretch;
        padding: 5px; /* Adjust padding for mobile */
    }

    .message-form input {
        margin-right: 0;
        margin-bottom: 10px;
        padding: 8px; /* Adjust padding for mobile */
    }

    .message-form button {
        width: 100%;
        padding: 8px; /* Adjust padding for mobile */
    }

    .message-form .file-picker,
    .message-form .audio-recorder {
        margin: 0; /* Reset margins */
    }
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    background-color: blue; /* Set the background color for the category body to blue */
}

.category-item {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-family: 'Arial, sans-serif';
    font-size: 18px;
    color: #333;
    transition: color 0.3s ease; /* Add transition for smooth color change */
}

.category-item:hover {
    background-color: rgba(128, 0, 0, 0.5); /* Add hover effect with animated maroon color at 50% opacity */
    color: #fff; /* Change text color to white on hover */
    transition: background-color 0.3s ease, color 0.3s ease; /* Add transition for smooth animation */
}

.post, .user {
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
}

.post a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
    border-bottom: 2px solid transparent;
    transition: border-bottom 0.3s ease, color 0.3s ease;
}

.post a:hover {
    border-bottom: 2px solid #007bff;
    color: #0056b3;
}

button {
    background-color: #f44336;
    color: #fff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

a.button {
    background-color: #4CAF50;
    color: #fff;
    padding: 5px 10px;
    text-decoration: none;
}

nav {
    background-color: #333;
    color: #fff;
    padding: 10px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000; /* Ensure the navbar is above other content */
    display: flex;
    justify-content: space-between; /* Align items from left to right */
    align-items: center;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin-right: 20px;
    font-size: 18px; /* Restore previous icon size */
}

video {
    max-width: 100%;
    height: auto;
}

.aspect-ratio-box {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.aspect-ratio-box img, .aspect-ratio-box video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

@media (max-width: 768px) {
    .category-grid {
        display: none;
    }

    .category-dropdown {
        display: block;
        margin: 20px;
    }

    .post {
        padding: 5px;
        margin-bottom: 5px;
    }

    .aspect-ratio-box {
        padding-top: 75%; /* Increase height for better appearance on smartphones */
    }
}

@media (min-width: 769px) {
    .category-dropdown {
        display: none;
    }

    .post {
        padding: 20px;
        margin-bottom: 20px;
    }
}

.post {
    position: relative; /* Add relative positioning to the post */
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown {
    position: relative;
    display: inline-block;
    background-color: white;
    color: black;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-family: 'Arial, sans-serif';
    font-size: 16px;
    position: relative;
}

.dropdown::after {
    content: '\25BC'; /* Unicode for downward arrow */
    float: right;
    margin-right: 10px;
}

.dropdown-menu {
    display: none; /* Hide the dropdown menu by default */
    position: absolute;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 10px;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.dropdown:focus + .dropdown-menu,
.dropdown-menu:hover {
    display: block;
}

.dropdown-item {
    padding: 10px;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: #f1f1f1; /* Highlight option on hover */
}

.highlight {
    background-color: yellow; /* Highlight color for shared post */
}

.post-content {
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Limit to 4 lines */
    line-clamp: 4; /* Standard property for compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.read-more {
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
}

.post-dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: white;
    color: black;
    padding: 10px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    position: relative;
}

.dropbtn::after {
    content: '\25BC'; /* Add arrow */
    font-size: 12px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.dropbtn:hover {
    background-color: #f1f1f1;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 220px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 4px;
    font-family: 'Arial, sans-serif';
    font-size: 16px;
    border: 1px solid #ccc;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #ddd;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.post-dropdown:hover .dropdown-content {
    display: block;
}

/* Profile Specific Styles */
.catalog {
    display: flex;
    overflow-x: scroll;
    padding: 10px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.catalog-item {
    flex: 0 0 auto;
    margin-right: 10px;
    position: relative;
}

.catalog-item img, .catalog-item video {
    max-width: 200px;
    max-height: 200px;
    cursor: pointer;
}

.full-image-preview {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.full-image-preview img, .full-image-preview video {
    max-width: 90%;
    max-height: 90%;
}

.post-item {
    position: relative;
}

.post-options {
    position: absolute;
    top: 10px;
    right: 10px;
}

.post-options select {
    padding: 5px;
}

@media (max-width: 768px) {
    .post-item {
        padding: 5px;
        margin-bottom: 5px;
    }

    .category-list {
        display: none;
    }

    .category-dropdown {
        display: block;
    }

    .aspect-ratio-box {
        padding-top: 75%; /* Increase height for better appearance on smartphones */
    }
}

@media (min-width: 769px) {
    .post-item {
        padding: 20px;
        margin-bottom: 20px;
    }

    .category-list {
        display: block;
    }

    .category-dropdown {
        display: none;
    }
}

/* Enhanced Edit and Delete Icons */
.post-actions {
    display: flex;
    justify-content: flex-start; /* Align items to the start */
    align-items: center; /* Vertically align items */
    margin-top: 10px;
}

.post-actions button,
.post-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    margin-right: 10px; /* Add spacing between icons */
    border: none;
    border-radius: 5px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 14px;
}

.post-actions button {
    background-color: #f44336; /* Red for Delete */
}

.post-actions a {
    background-color: #4CAF50; /* Green for Edit */
}

.post-actions button:hover,
.post-actions a:hover {
    transform: scale(1.1);
}

.post-actions i {
    margin-right: 5px;
}

@media (max-width: 768px) {
    .message {
        max-width: 100%; /* Ensure messages take up the full width */
        margin: 5px 0; /* Adjust margin for mobile */
    }

    .message.sent {
        align-self: flex-end;
        text-align: right;
    }

    .message.received {
        align-self: flex-start;
        text-align: left;
    }

    .message-form {
        flex-direction: column;
        align-items: stretch;
    }

    .message-form input {
        margin-bottom: 10px;
    }

    .message-form button {
        width: 100%;
    }

    .message-form .file-picker,
    .message-form .audio-recorder {
        margin: 0; /* Reset margins */
    }
}

form {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="submit"],
form button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

form input[type="submit"],
form button {
    background-color: #007bff;
    color: #fff;
    border: none;
    cursor: pointer;
}

form input[type="submit"]:hover,
form button:hover {
    background-color: #0056b3;
}

@media (max-width: 768px) {
    form {
        padding: 15px;
    }

    form input[type="text"],
    form input[type="email"],
    form input[type="password"],
    form input[type="number"],
    form input[type="submit"],
    form button {
        padding: 8px;
    }
}