/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
    line-height: 1.4;
}

/* Header */
header {
    background-color: #1877f2;
    padding: 10px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

/* Notification Bell */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 5px;
    font-size: 20px;
}

.notification-bell:hover {
    opacity: 0.8;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #e41e3f;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Notifications Panel */
.notifications-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 350px;
    max-height: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    overflow: hidden;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #dddfe2;
    background: #f7f8fa;
}

.notifications-header h4 {
    margin: 0;
    font-size: 16px;
}

#notifications-list {
    max-height: 340px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: #f7f8fa;
}

.notification-item.unread {
    background-color: #e7f3ff;
}

.notification-item.unread:hover {
    background-color: #d4e9ff;
}

.notification-message {
    font-size: 14px;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 12px;
    color: #65676b;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #1877f2;
    color: white;
}

.btn-primary:hover {
    background-color: #166fe5;
}

.btn-secondary {
    background-color: #e4e6eb;
    color: #050505;
}

.btn-secondary:hover {
    background-color: #d8dadf;
}

.btn-success {
    background-color: #42b72a;
    color: white;
}

.btn-success:hover {
    background-color: #36a420;
}

.btn-danger {
    background-color: #fa3e3e;
    color: white;
}

.btn-danger:hover {
    background-color: #e02020;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    padding: 16px;
    margin-bottom: 16px;
}

/* Auth Page */
.auth-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 48px;
    color: #1877f2;
    margin-bottom: 10px;
}

.auth-header p {
    font-size: 18px;
    color: #606770;
}

.auth-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-form h2 {
    margin-bottom: 20px;
    text-align: center;
}

.auth-form input {
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    font-size: 16px;
}

.auth-form input:focus {
    border-color: #1877f2;
    outline: none;
}

.auth-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    margin-top: 10px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dddfe2;
}

.auth-switch a {
    color: #1877f2;
    text-decoration: none;
    font-weight: 600;
}

.error-message {
    background-color: #ffebe8;
    border: 1px solid #dd3c10;
    color: #dd3c10;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
}

/* Main Content */
main {
    padding-top: 70px;
    min-height: 100vh;
}

/* Feed Page */
.feed-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px;
}

.create-post textarea {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 20px;
    background-color: #f0f2f5;
    font-size: 16px;
    resize: none;
}

.create-post textarea:focus {
    outline: none;
    background-color: #e4e6eb;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e4e6eb;
}

.file-upload input[type="file"] {
    display: none;
}

#file-name {
    font-size: 12px;
    color: #65676b;
    flex: 1;
}

/* Post Card */
.post {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

.post-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1877f2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

.post-author {
    font-weight: 600;
}

.post-time {
    font-size: 12px;
    color: #65676b;
}

.post-content {
    padding: 0 16px 12px;
}

.post-media {
    max-width: 100%;
}

.post-media img,
.post-media video {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background-color: #000;
}

.post-stats {
    padding: 10px 16px;
    color: #65676b;
    font-size: 14px;
    border-bottom: 1px solid #e4e6eb;
}

.post-actions-bar {
    display: flex;
    padding: 4px 16px;
}

.post-action {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    color: #65676b;
    font-weight: 600;
    background: none;
    border: none;
    font-size: 14px;
}

.post-action:hover {
    background-color: #f0f2f5;
}

.post-action.liked {
    color: #1877f2;
}

/* Comments */
.comments-section {
    display: block;
    padding: 8px 16px 16px;
    border-top: 1px solid #e4e6eb;
}

.comments-section.hidden {
    display: none;
}

.comment {
    display: flex;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-right: 8px;
    flex-shrink: 0;
}

.comment-content {
    background-color: #f0f2f5;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: calc(100% - 40px);
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
}

.comment-text {
    font-size: 14px;
}

.comment-form {
    display: flex;
    margin-top: 8px;
}

.comment-form input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    background-color: #f0f2f5;
    font-size: 14px;
}

.comment-form input:focus {
    outline: none;
}

.comment-form button {
    margin-left: 8px;
    padding: 8px 16px;
}

/* Profile Page */
.profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: #1877f2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
}

.profile-info {
    flex: 1;
}

.profile-info h2 {
    font-size: 28px;
    margin-bottom: 4px;
}

.profile-info p {
    color: #65676b;
}

#profile-bio {
    margin-top: 10px;
    color: #1c1e21;
}

/* Friends Page */
.friends-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.friends-container h3 {
    margin-bottom: 15px;
}

.friend-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e4e6eb;
}

.friend-item:last-child {
    border-bottom: none;
}

.friend-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #1877f2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: 600;
}

.friend-username {
    font-size: 13px;
    color: #65676b;
}

.mutual-friends-info {
    font-size: 12px;
    color: #1877f2;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.friend-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pending-label {
    font-size: 12px;
    color: #f7b928;
    font-weight: 500;
    padding: 4px 8px;
    background: #fff8e6;
    border-radius: 4px;
}

#find-friend-form {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#find-friend-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Utilities */
.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #65676b;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #65676b;
}

/* Avatar Images */
.avatar-img {
    object-fit: cover;
}

.post-avatar.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
}

.comment-avatar.avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}

.friend-avatar.avatar-img,
.post-avatar.avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 12px;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Profile Avatar Upload */
.profile-avatar-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
}

.avatar-upload-label {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 36px;
    height: 36px;
    background-color: #e4e6eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
}

.avatar-upload-label:hover {
    background-color: #d8dadf;
}

.avatar-upload-icon {
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
        font-size: 32px;
    }

    .profile-avatar-wrapper {
        width: 100px;
        height: 100px;
    }
}

/* Edit/Delete Buttons */
.post-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    justify-content: flex-start;
}

.post-header-info {
    flex: 1;
}

/* Clickable author names */
.post-author-clickable {
    display: flex;
    align-items: center;
    flex: 1;
}

.post-author-link {
    cursor: pointer;
}

.post-author-link:hover .post-author {
    text-decoration: underline;
}

/* Vibes page */
.vibes-title {
    margin: 0 0 16px;
    font-size: 24px;
}

.post-owner-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.2s, background-color 0.2s;
}

.btn-icon:hover {
    opacity: 1;
    background-color: #f0f2f5;
}

.btn-icon-sm {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.btn-icon-sm:hover {
    opacity: 1;
}

/* Comment with actions */
.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-actions {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

/* Edit Content Modal */
#edit-content-modal textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

/* ============ Messages Page ============ */

/* Unread Badge */
.nav-link {
    position: relative;
}

.unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #fa3e3e;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Messages Container */
.messages-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
    height: calc(100vh - 90px);
}

/* Conversations Sidebar */
.conversations-sidebar {
    width: 350px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.conversations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e4e6eb;
}

.conversations-header h3 {
    margin: 0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

/* Conversation Item */
.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.conversation-item:hover {
    background-color: #f0f2f5;
}

.conversation-item.active {
    background-color: #e7f3ff;
}

.conversation-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #1877f2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.conversation-avatar.group {
    background-color: #42b72a;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 13px;
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview.unread {
    color: #1c1e21;
    font-weight: 600;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 10px;
}

.conversation-time {
    font-size: 12px;
    color: #65676b;
}

.conversation-unread {
    background-color: #1877f2;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    margin-top: 4px;
}

/* Chat View */
.chat-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #65676b;
}

.chat-active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #e4e6eb;
    margin-bottom: 12px;
}

.chat-header h4 {
    margin: 0;
}

.chat-participants {
    font-size: 13px;
    color: #65676b;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
}

.message {
    display: flex;
    margin-bottom: 12px;
    max-width: 70%;
}

.message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.received {
    align-self: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.message.sent .message-avatar {
    margin-left: 8px;
}

.message.received .message-avatar {
    margin-right: 8px;
}

.message-content {
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 100%;
    word-wrap: break-word;
}

.message.sent .message-content {
    background-color: #1877f2;
    color: white;
}

.message.received .message-content {
    background-color: #f0f2f5;
    color: #1c1e21;
}

.message-sender {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #65676b;
}

.message.sent .message-sender {
    display: none;
}

.message-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
}

.message.sent .message-time {
    text-align: right;
}

/* Send Message Form */
.send-message-form {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #e4e6eb;
    margin-top: auto;
}

.send-message-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #dddfe2;
    border-radius: 20px;
    font-size: 14px;
}

.send-message-form input:focus {
    outline: none;
    border-color: #1877f2;
}

/* New Conversation Modal */
.conversation-type-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #e4e6eb;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #65676b;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #1877f2;
}

.tab-btn.active {
    color: #1877f2;
    border-bottom-color: #1877f2;
}

.participant-search {
    position: relative;
    margin-bottom: 10px;
}

.participant-search input {
    width: 100%;
}

.participant-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.participant-result {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.participant-result:hover {
    background-color: #f0f2f5;
}

.participant-result-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #1877f2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-right: 10px;
}

.participant-result-name {
    font-weight: 600;
    font-size: 14px;
}

.participant-result-username {
    font-size: 12px;
    color: #65676b;
}

.selected-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    min-height: 32px;
}

.selected-participant {
    display: flex;
    align-items: center;
    background-color: #e7f3ff;
    padding: 4px 8px 4px 12px;
    border-radius: 16px;
    font-size: 13px;
}

.selected-participant .remove-participant {
    margin-left: 6px;
    cursor: pointer;
    color: #65676b;
    font-weight: bold;
}

.selected-participant .remove-participant:hover {
    color: #fa3e3e;
}

/* Group Settings */
.group-participants-list {
    margin-bottom: 20px;
}

.group-participant-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e4e6eb;
}

.group-participant-item:last-child {
    border-bottom: none;
}

.group-participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1877f2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

.group-participant-info {
    flex: 1;
}

.group-participant-name {
    font-weight: 600;
}

.group-participant-role {
    font-size: 12px;
    color: #65676b;
}

.add-participant-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e4e6eb;
}

.add-participant-section h4 {
    margin-bottom: 10px;
}

.add-participant-section input {
    width: 100%;
    margin-bottom: 10px;
}

/* Responsive Messages */
@media (max-width: 900px) {
    .messages-container {
        flex-direction: column;
        height: auto;
    }

    .conversations-sidebar {
        width: 100%;
        max-height: 300px;
    }

    .chat-view {
        min-height: 400px;
    }
}
/* ============ Events Page ============ */
.events-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.events-header h2 {
    margin: 0;
}

/* Calendar */
.calendar-card {
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #dddfe2;
}

.calendar-header h3 {
    margin: 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #dddfe2;
    padding: 1px;
}

.calendar-day-header {
    background: #f0f2f5;
    padding: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #65676b;
}

.calendar-day {
    background: white;
    min-height: 80px;
    padding: 8px;
    position: relative;
}

.calendar-day.other-month {
    background: #f7f8fa;
    color: #b0b3b8;
}

.calendar-day.today {
    background: #e7f3ff;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-event {
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    background: #1877f2;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event.my-event {
    background: #42b72a;
}

/* Event Lists */
.events-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .events-lists {
        grid-template-columns: 1fr;
    }
}

.event-item {
    padding: 12px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.2s;
}

.event-item:hover {
    background: #f0f2f5;
}

.event-item:last-child {
    border-bottom: none;
}

.event-item-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.event-item-time {
    font-size: 13px;
    color: #65676b;
}

.event-item-location {
    font-size: 12px;
    color: #8a8d91;
}

/* Event Details Modal */
.event-details {
    max-width: 600px;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.event-header h3 {
    margin: 0;
}

.event-visibility {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #e4e6eb;
}

.event-visibility.public {
    background: #e7f3ff;
    color: #1877f2;
}

.event-meta {
    margin-bottom: 16px;
}

.event-meta p {
    margin: 4px 0;
    font-size: 14px;
}

#event-detail-description {
    margin-bottom: 16px;
    padding: 12px;
    background: #f7f8fa;
    border-radius: 6px;
    white-space: pre-wrap;
}

#event-detail-description:empty {
    display: none;
}

.event-rsvp-counts {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f0f2f5;
    border-radius: 6px;
}

.rsvp-count {
    text-align: center;
}

.rsvp-count-number {
    font-size: 24px;
    font-weight: 600;
}

.rsvp-count-label {
    font-size: 12px;
    color: #65676b;
}

.event-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rsvp-btn.active {
    background: #42b72a;
    border-color: #42b72a;
}

.rsvp-btn.active.not-going {
    background: #e41e3f;
    border-color: #e41e3f;
}

.rsvp-btn.active.maybe {
    background: #f7b928;
    border-color: #f7b928;
}

/* Event Comments */
.event-comments-section {
    border-top: 1px solid #dddfe2;
    padding-top: 16px;
    margin-top: 16px;
}

.event-comments-section h4 {
    margin-bottom: 12px;
}

#event-comments {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.event-comment {
    padding: 8px 0;
    border-bottom: 1px solid #f0f2f5;
}

.event-comment:last-child {
    border-bottom: none;
}

.event-comment-author {
    font-weight: 600;
    font-size: 13px;
}

.event-comment-content {
    font-size: 14px;
    margin: 4px 0;
}

.event-comment-time {
    font-size: 11px;
    color: #65676b;
}

.event-comment-form {
    display: flex;
    gap: 8px;
}

.event-comment-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dddfe2;
    border-radius: 20px;
    font-size: 14px;
}

/* Event Attendees */
.event-attendees-section {
    border-top: 1px solid #dddfe2;
    padding-top: 16px;
    margin-top: 16px;
}

.event-attendees-section h4 {
    margin-bottom: 12px;
}

.attendee-group {
    margin-bottom: 12px;
}

.attendee-group-label {
    font-weight: 600;
    font-size: 13px;
    color: #65676b;
    margin-bottom: 6px;
}

.attendee-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attendee-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f0f2f5;
    border-radius: 16px;
    font-size: 13px;
}

.attendee-item.current-user {
    background: #e7f3ff;
    border: 1px solid #1877f2;
}

.you-badge {
    font-size: 11px;
    color: #1877f2;
    font-weight: 600;
}

/* Event Invite Section */
.event-invite-section {
    border-top: 1px solid #dddfe2;
    padding-top: 16px;
    margin-top: 16px;
}

.event-invite-section h4 {
    margin-bottom: 12px;
}

.event-invite-section h5 {
    margin: 16px 0 8px;
    font-size: 13px;
    color: #65676b;
}

.invite-search-form input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    font-size: 14px;
}

.invite-search-results {
    margin-top: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.invite-search-result {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid #f0f2f5;
}

.invite-search-result:last-child {
    border-bottom: none;
}

.invite-user-name {
    font-weight: 500;
}

.invite-user-handle {
    color: #65676b;
    font-size: 13px;
    flex: 1;
}

.invited-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #f0f2f5;
}

.invited-user-item:last-child {
    border-bottom: none;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-danger {
    background: #e41e3f;
    color: white;
    border-color: #e41e3f;
}

.btn-danger:hover {
    background: #c8102e;
}

/* Create Event Form */
#create-event-form input[type="text"],
#create-event-form textarea {
    width: 100%;
    margin-bottom: 12px;
}

.datetime-inputs {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.datetime-inputs label {
    flex: 1;
    font-size: 13px;
    color: #65676b;
}

.datetime-inputs input {
    width: 100%;
    margin-top: 4px;
    padding: 8px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
    margin: 0;
}

.close-modal {
    margin-top: 16px;
    width: 100%;
}

/* ============ Admin Menu ============ */

.admin-menu {
    position: relative;
    display: inline-block;
}

.admin-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.admin-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1001;
    overflow: hidden;
    margin-top: 4px;
}

.admin-dropdown.open {
    display: block;
}

.admin-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #1c1e21;
    transition: background-color 0.15s;
}

.admin-dropdown-item:hover {
    background-color: #f0f2f5;
}

/* ============ Social Graph Page ============ */

.graph-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #e4e6eb;
}

.graph-page-header h2 {
    margin: 0;
    font-size: 20px;
}

.graph-legend {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 13px;
    color: #65676b;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-line {
    width: 20px;
    height: 3px;
    display: inline-block;
    border-radius: 2px;
}

.legend-line.bridge {
    background: #ff4444;
}

.legend-line.intra {
    background: rgba(150, 150, 150, 0.4);
}

.social-graph-container {
    width: 100%;
    height: calc(100vh - 120px);
    background: #0a0a1a;
    position: relative;
}

.graph-loading,
.graph-error,
.graph-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #aaa;
    font-size: 16px;
}

.graph-error {
    color: #ff6b6b;
}

#admin-graph-page {
    padding: 0;
    margin-top: 0;
}

/* ============ Event Banner ============ */
.event-banner-container {
    margin-bottom: 16px;
}

.event-banner-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.event-banner-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ============ Media Attachments ============ */
.file-upload-icon {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.file-upload-icon input[type="file"] {
    display: none;
}

.attach-icon {
    font-size: 20px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.attach-icon:hover {
    opacity: 1;
}

.comment-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.comment-input-row input[type="text"] {
    flex: 1;
}

.media-preview {
    margin-top: 8px;
    padding: 8px;
    background: #f0f2f5;
    border-radius: 6px;
}

.preview-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.preview-item img {
    max-height: 80px;
    max-width: 120px;
    border-radius: 4px;
    object-fit: cover;
}

.remove-preview {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.remove-preview:hover {
    background: rgba(0, 0, 0, 0.8);
}

.media-attachment {
    margin-top: 8px;
}

.media-attachment img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    object-fit: contain;
}

.media-attachment video {
    max-width: 100%;
    min-width: 300px;
    border-radius: 6px;
}

.media-attachment audio {
    max-width: 100%;
    margin-top: 4px;
}

.message-content .media-attachment video {
    min-width: 250px;
    max-width: 100%;
}

/* Clickable images */
.media-clickable {
    cursor: pointer;
    transition: opacity 0.15s;
}

.media-clickable:hover {
    opacity: 0.85;
}

/* Download button */
.media-download {
    display: inline-block;
    margin-top: 4px;
    font-size: 18px;
    text-decoration: none;
    color: #65676b;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.15s, color 0.15s;
}

.media-download:hover {
    background-color: #e4e6eb;
    color: #1c1e21;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-actions {
    display: flex;
    gap: 10px;
}

.lightbox-actions .btn {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-decoration: none;
}

.lightbox-actions .btn:hover {
    background: rgba(255, 255, 255, 0.25);
}
