/* General styles */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #a8c0ff, #3f2b96);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #333;
}

.container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    width: 100%;
    backdrop-filter: blur(10px);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5rem;
    animation: fadeInDown 1s ease-in-out;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth and Header styles */
#auth-form {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: auto;
    animation: fadeIn 1.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

input, textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.2);
    outline: none;
}

button {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.header {
    background-color: #fff;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-buttons {
    position: relative;
    display: flex;
}

.header-buttons button {
    width: auto;
    margin-left: 10px;
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 20px;
}

.notification-btn-wrapper {
    position: relative;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    display: none;
}

/* Post creation section */
.create-post-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.create-post-card h3 {
    margin-top: 0;
    text-align: left;
    color: #4b4b4b;
}

#post-content {
    border: 1px solid #e0e0e0;
    background-color: #f9f9f9;
}

.post-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.custom-file-upload {
    font-size: 16px;
    padding: 10px 15px;
    border-radius: 20px;
    background-color: #f0f2f5;
    color: #555;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.custom-file-upload:hover {
    background-color: #e6e8eb;
}

.custom-file-upload i {
    margin-right: 5px;
}

.post-btn {
    width: auto;
    border-radius: 20px;
    padding: 10px 20px;
    font-weight: bold;
}

/* News Feed and Post card styles */
.post-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-picture {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #ddd;
    border: 2px solid #007bff;
}

.post-author-info {
    flex-grow: 1;
}

.post-author {
    font-weight: bold;
    color: #1c2b36;
    margin: 0;
}

.post-timestamp {
    font-size: 12px;
    color: #65676b;
}

.post-content {
    margin-top: 15px;
    line-height: 1.6;
    color: #333;
}

.post-image {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 15px;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Post actions and footer */
.post-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
}

.reactions-container {
    display: flex;
    gap: 5px;
    align-items: center;
}

.reaction-btn {
    font-size: 1.5em;
    cursor: pointer;
    background: none;
    border: none;
    transition: transform 0.2s ease, filter 0.2s ease;
    padding: 5px;
    border-radius: 50%;
}

.reaction-btn:hover {
    transform: scale(1.2);
    filter: brightness(1.1);
}

.reaction-count {
    font-size: 0.9em;
    color: #666;
    margin-left: 5px;
}

.delete-post-btn {
    background-color: #dc3545;
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    width: auto;
    border-radius: 20px;
    margin-left: auto;
    transition: background-color 0.3s ease;
}

.delete-post-btn:hover {
    background-color: #c82333;
    transform: none;
}

/* Comments section */
.comments-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #f7f9fb;
    border-radius: 10px;
}

.comment {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    padding: 8px 12px;
    background-color: #e9ebee;
    border-radius: 15px;
}

.comment .author {
    font-weight: bold;
    color: #1c2b36;
    font-size: 0.9em;
}

.comment-input-area {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.comment-input {
    flex-grow: 1;
    border-radius: 20px;
    border: 1px solid #ddd;
    padding: 8px 15px;
    background-color: #fff;
}

.add-comment-btn {
    width: auto;
    font-size: 14px;
    border-radius: 20px;
    padding: 8px 15px;
}

/* Notification styles */
.notification-item {
    background-color: #f0f2f5;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.notification-item p {
    margin: 0;
    font-weight: 500;
}

.notification-item small {
    color: #65676b;
    font-size: 12px;
}

/* Chat styles */
.chat-container {
    display: flex;
    gap: 20px;
    height: 600px;
    background: #f7f9fb;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 15px; /* Added margin to separate from button */
}

.new-chat-btn {
    width: auto;
    padding: 8px 20px;
    border-radius: 20px;
}

.chat-list {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    overflow-y: auto;
}

.chat-item {
    padding: 15px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-item:hover {
    background-color: #f0f2f5;
}

.chat-item h4 {
    margin: 0;
    font-size: 16px;
}

.chat-item p {
    margin: 5px 0 0;
    font-size: 14px;
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
}

.messages {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 20px;
    display: flex; /* Added to display messages correctly */
    flex-direction: column;
}

.message {
    padding: 10px 15px;
    border-radius: 20px;
    margin-bottom: 10px;
    max-width: 80%;
}

.message.sent {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.message.received {
    background-color: #e4e6eb;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.message-input-area {
    display: flex;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

#message-input {
    flex-grow: 1;
    border-radius: 20px;
    border: 1px solid #ddd;
    padding: 10px 15px;
}

#send-message-btn {
    width: auto;
    padding: 10px 20px;
    border-radius: 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    .header {
        flex-direction: column;
        gap: 15px;
    }
    .header-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    .header-buttons button {
        margin-left: 5px;
        margin-right: 5px;
    }
    .chat-container {
        flex-direction: column;
        height: auto;
    }
    .chat-list {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
}
/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Khmer:wght@400;600&family=Roboto:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans Khmer', 'Roboto', sans-serif;
}

body {
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

h1, h2, h3, h4 {
    color: #222;
    margin-bottom: 10px;
}

input, textarea, button {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

button {
    cursor: pointer;
    background: #1877f2;
    color: #fff;
    border: none;
    font-weight: 600;
    transition: 0.3s ease;
}

button:hover {
    background: #145dbf;
}

/* Auth form */
#auth-form {
    text-align: center;
    margin-bottom: 30px;
}
#auth-form input {
    width: 80%;
}
#auth-form button {
    width: 45%;
    margin: 5px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1877f2;
    color: #fff;
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}
.header p {
    font-weight: bold;
}
.header-buttons button {
    background: #fff;
    color: #1877f2;
    margin: 0 5px;
    padding: 8px 14px;
    border-radius: 8px;
}
.header-buttons button:hover {
    background: #f0f0f0;
}

/* Notification Badge */
.notification-btn-wrapper {
    position: relative;
}
.notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: red;
    color: #fff;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Create post */
.create-post-card {
    background: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.custom-file-upload {
    display: inline-block;
    cursor: pointer;
    color: #1877f2;
    font-weight: 600;
    margin-right: 15px;
}
.custom-file-upload i {
    margin-right: 5px;
}
.post-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.post-btn {
    width: auto;
    padding: 10px 20px;
}

/* Chat Layout */
.chat-container {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}
.chat-list {
    flex: 1;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 10px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}
.chat-area {
    flex: 3;
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.messages {
    min-height: 200px;
    margin-bottom: 10px;
}
.message-input-area {
    display: flex;
    gap: 10px;
}
.message-input-area input {
    flex: 1;
}
.new-chat-btn {
    background: #42b72a;
}
.new-chat-btn:hover {
    background: #2d8f1e;
}

/* Responsive */
@media(max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-buttons {
        display: flex;
        flex-wrap: wrap;
    }
    .header-buttons button {
        margin: 5px 5px 0 0;
    }
    .chat-container {
        flex-direction: column;
    }
}
