* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a1a;
    padding-bottom: 70px;
}

body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

img, a, button {
    -webkit-user-drag: none;
    user-drag: none;
}

.app-container {
    min-height: 100vh;
    background: #f0f2f5;
}

/* ========== NAVBAR ========== */
.navbar {
    background: white;
    border-bottom: 2px solid #cc0000;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(204, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo h2 {
    color: #cc0000;
    font-size: 20px;
    margin: 0;
}

.nav-search {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.nav-search input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #cc0000;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    background: white;
}

.nav-search input:focus {
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.2);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #cc0000;
    border-radius: 12px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-item:hover {
    background: #ffe6e6;
}

.nav-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-icons a {
    color: #cc0000;
    font-size: 20px;
    text-decoration: none;
}

.nav-icons a:hover {
    opacity: 0.7;
}

/* ========== MOBILE BOTTOM NAVIGATION ========== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid #cc0000;
    padding: 8px 20px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-items a {
    color: #cc0000;
    font-size: 24px;
    text-decoration: none;
    padding: 8px;
    position: relative;
}

.bottom-nav-items a.active {
    background: #ffe6e6;
    border-radius: 50%;
}

.bottom-notif-icon {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.bottom-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: #cc0000;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    min-width: 18px;
    text-align: center;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }
    .nav-icons {
        display: none;
    }
    .bottom-nav {
        display: block;
    }
    .navbar {
        position: fixed;
        top: 0;
    }
    .main-content {
        margin-top: 70px;
        margin-bottom: 10px;
    }
    .profile-container {
        margin-top: 70px;
    }
    .chat-container {
        margin-top: 70px;
        height: calc(100vh - 140px);
    }
    .messenger-container {
        margin-top: 70px;
        height: calc(100vh - 140px);
    }
    .groups-container {
        margin-top: 70px;
    }
}

@media (min-width: 769px) {
    .main-content {
        margin-top: 20px;
    }
    .profile-container {
        margin-top: 20px;
    }
}

/* ========== MAIN CONTENT WITH MARGIN ========== */
.main-content {
    max-width: 680px;
    margin: 80px auto 20px auto;
    padding: 0 15px;
}

@media (max-width: 768px) {
    .main-content {
        margin-top: 70px;
        padding: 0 12px;
    }
}

.feed-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========== CREATE POST CARD ========== */
.create-post-card {
    background: white;
    border: 1px solid #cc0000;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.create-post-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.post-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #cc0000;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    background: #f9f9f9;
    resize: vertical;
    min-height: 45px;
    max-height: 200px;
    overflow-y: auto;
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
}

.post-input:focus {
    border-color: #cc0000;
    background: white;
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.1);
}

/* ========== POST CARD ========== */
.post-card {
    background: white;
    border: 1px solid #cc0000;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
}

.post-user-link {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    align-items: center;
}

.post-user-link:hover .post-user-name {
    text-decoration: underline;
}

.post-user-name {
    font-weight: 700;
    color: #cc0000;
    font-size: 15px;
}

.post-time {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.post-content {
    margin-bottom: 12px;
    line-height: 1.5;
    font-size: 14px;
    color: #333;
    word-wrap: break-word;
}

.post-stats {
    display: flex;
    gap: 20px;
    padding: 8px 0;
    border-top: 1px solid #e4e6eb;
    border-bottom: 1px solid #e4e6eb;
    margin-bottom: 8px;
    color: #65676b;
    font-size: 13px;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-actions {
    display: flex;
    gap: 8px;
    padding-top: 4px;
}

.post-actions button,
.post-actions a {
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
    flex: 1;
    justify-content: center;
}

.post-actions button:hover,
.post-actions a:hover {
    background: #f0f2f5;
    color: #cc0000;
}

.post-actions button.liked {
    color: #cc0000;
}

/* ========== POST MENU - FIXED DROPDOWN ========== */
.post-menu {
    position: relative;
    margin-left: auto;
    cursor: pointer;
    z-index: 100;
}

.post-menu i {
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.post-menu i:hover {
    background: #f0f2f5;
}

.post-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #cc0000;
    border-radius: 12px;
    min-width: 150px;
    display: none;
    z-index: 1002;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.post-menu:hover .post-menu-dropdown {
    display: block;
}

.post-menu-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #cc0000;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
    white-space: nowrap;
}

.post-menu-dropdown a:hover {
    background: #ffe6e6;
}

/* ========== PROFILE DROPDOWN - FIXED ========== */
.profile-dropdown {
    position: relative;
    display: inline-block;
    z-index: 100;
}

.profile-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #cc0000;
    border-radius: 12px;
    min-width: 150px;
    display: none;
    z-index: 1002;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.profile-dropdown:hover .profile-dropdown-menu {
    display: block;
}

.profile-dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #cc0000;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
    white-space: nowrap;
}

.profile-dropdown-menu a:hover {
    background: #ffe6e6;
}

/* ========== COMMENTS SECTION ========== */
.comments-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e4e6eb;
}

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.comment-content {
    flex: 1;
    background: #f0f2f5;
    padding: 8px 12px;
    border-radius: 18px;
}

.comment-user {
    font-weight: 600;
    color: #cc0000;
    text-decoration: none;
    font-size: 12px;
}

.comment-content p {
    margin: 4px 0;
    font-size: 13px;
    color: #333;
    word-wrap: break-word;
}

.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

.comment-actions button {
    background: none;
    border: none;
    font-size: 11px;
    color: #65676b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-actions button.liked {
    color: #cc0000;
}

.comment-time {
    font-size: 10px;
    color: #65676b;
}

.replies-section {
    margin-top: 8px;
    margin-left: 30px;
    padding-left: 10px;
    border-left: 2px solid #cc0000;
}

.reply-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.reply-content {
    flex: 1;
    background: #e8e8e8;
    padding: 6px 10px;
    border-radius: 16px;
}

.reply-user {
    font-weight: 600;
    color: #cc0000;
    text-decoration: none;
    font-size: 11px;
}

.reply-content p {
    margin: 3px 0;
    font-size: 12px;
    word-wrap: break-word;
}

.reply-time {
    font-size: 9px;
    color: #999;
}

.reply-input-area {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.reply-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #cc0000;
    border-radius: 16px;
    outline: none;
    font-size: 12px;
    font-family: inherit;
}

.submit-reply {
    background: #cc0000;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 11px;
}

.comment-input-area {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.comment-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #cc0000;
    border-radius: 20px;
    outline: none;
    font-size: 13px;
    background: #f0f2f5;
    font-family: inherit;
}

.comment-input:focus {
    background: white;
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.1);
}

.submit-comment {
    background: #cc0000;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.submit-comment:hover {
    background: #a30000;
}

/* ========== MENTION DROPDOWN ========== */
.mention-dropdown {
    position: fixed;
    background: white;
    border: 1px solid #cc0000;
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.mention-item:hover {
    background: #ffe6e6;
}

.mention-item strong {
    color: #cc0000;
    font-size: 13px;
}

.mention-item small {
    color: #666;
    font-size: 11px;
}

/* Hide search on non-homepage */
.nav-search[style*="visibility:hidden"] {
    visibility: hidden;
    pointer-events: none;
}

/* ========== NOTIFICATIONS - UPDATED FOR MOBILE ========== */
.notif-icon {
    position: relative;
    cursor: pointer;
}

.badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #cc0000;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

/* Desktop notification dropdown */
.notif-dropdown {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 360px;
    background: white;
    border: 1px solid #cc0000;
    border-radius: 12px;
    max-height: 450px;
    overflow-y: auto;
    z-index: 99999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: none;
}

/* Mobile notification dropdown - FIXED */
@media (max-width: 768px) {
    .notif-dropdown {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        max-height: 70vh;
        border-radius: 16px;
        z-index: 10001;
    }
    
    /* For bottom navigation bell on mobile */
    .bottom-notif-icon .notif-dropdown {
        position: fixed;
        bottom: 70px;
        top: auto;
        left: 10px;
        right: 10px;
        max-height: 60vh;
    }
}

/* Desktop hover effect */
@media (min-width: 769px) {
    .notif-icon:hover .notif-dropdown {
        display: block;
    }
}

.notif-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notif-item:hover, 
.notif-item:active {
    background: #f5f5f5;
}

.notif-item.unread {
    background: #ffe6e6;
}

.notif-item i {
    color: #cc0000;
    font-size: 18px;
    margin-top: 2px;
    min-width: 24px;
}

.notif-content {
    flex: 1;
}

.notif-message {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    word-break: break-word;
}

.notif-time {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

/* ========== DROPDOWN ========== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #cc0000;
    border-radius: 12px;
    min-width: 160px;
    display: none;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #cc0000;
    text-decoration: none;
    font-size: 14px;
}

.dropdown-menu a:hover {
    background: #ffe6e6;
}

/* ========== BUTTONS ========== */
.btn-red {
    background: #cc0000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-red:hover {
    background: #a30000;
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

.btn-small {
    background: #cc0000;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.btn-small:hover {
    background: #a30000;
}

.btn-outline {
    background: transparent;
    color: #cc0000;
    border: 2px solid #cc0000;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
}

.btn-outline:hover {
    background: #cc0000;
    color: white;
}

.btn-disabled {
    background: #ccc;
    color: #666;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: not-allowed;
}

.btn-green {
    background: #006600;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-green:hover {
    background: #004d00;
}

.btn-danger {
    background: #990000;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-warning {
    background: #ff9900;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-icon {
    background: transparent;
    border: 1px solid #cc0000;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    color: #cc0000;
}

.btn-icon:hover {
    background: #ffe6e6;
}

/* ========== AVATARS ========== */
.avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #cc0000;
    background: white;
}

.avatar-medium {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #cc0000;
    background: white;
}

.avatar-tiny {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #cc0000;
    background: white;
}

/* ========== AUTH PAGES ========== */
.auth-page {
    background: linear-gradient(135deg, #fff 0%, #ffe6e6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(204, 0, 0, 0.15);
    padding: 40px 30px;
    border: 1px solid #cc0000;
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo h1 {
    color: #cc0000;
    font-size: 28px;
}

.auth-logo p {
    color: #666;
    font-size: 14px;
    margin-top: 8px;
}

.auth-form .input-group {
    display: flex;
    align-items: center;
    border: 1px solid #cc0000;
    border-radius: 12px;
    margin-bottom: 16px;
    background: white;
}

.auth-form .input-group:focus-within {
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.2);
}

.auth-form .input-group i {
    padding: 12px 15px;
    color: #cc0000;
    font-size: 18px;
}

.auth-form .input-group input {
    flex: 1;
    padding: 12px 15px 12px 0;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

.error-msg, .success-msg {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.error-msg {
    background: #ffe6e6;
    color: #cc0000;
    border: 1px solid #cc0000;
}

.success-msg {
    background: #e6ffe6;
    color: #006600;
    border: 1px solid #006600;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.auth-footer a {
    color: #cc0000;
    text-decoration: none;
    font-weight: 600;
}

/* ========== PROFILE PAGE - BIGGER DESIGN ========== */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

.profile-header {
    background: white;
    border: 1px solid #cc0000;
    border-radius: 20px;
    overflow: visible;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, #cc0000, #ff4444);
}

.profile-info {
    padding: 0 30px 30px;
    position: relative;
    text-align: center;
}

.profile-avatar {
    margin-top: -60px;
    margin-bottom: 15px;
}

.profile-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-details h1 {
    color: #cc0000;
    font-size: 26px;
    margin: 0;
}

.username {
    color: #65676b;
    margin: 5px 0;
    font-size: 14px;
}

.bio {
    margin: 15px 0;
    color: #333;
    font-size: 14px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    word-wrap: break-word;
}

.join-info {
    font-size: 13px;
    color: #65676b;
    margin: 5px 0;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 20px 0;
}

.profile-stats div {
    text-align: center;
}

.profile-stats strong {
    display: block;
    font-size: 20px;
    color: #cc0000;
}

.profile-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Profile Posts Section - BIGGER */
.profile-posts {
    margin: 20px 0;
}

.profile-posts h3 {
    color: #cc0000;
    margin-bottom: 15px;
    font-size: 20px;
}

.profile-posts .post-card {
    margin-bottom: 20px;
    padding: 20px;
}

.profile-posts .post-header {
    margin-bottom: 15px;
}

.profile-posts .post-content {
    font-size: 15px;
    margin-bottom: 15px;
}

.profile-posts .post-stats {
    padding: 10px 0;
}

.profile-posts .post-actions button,
.profile-posts .post-actions a {
    padding: 10px 15px;
    font-size: 14px;
}

.profile-posts .comments-section {
    margin-top: 15px;
    padding-top: 15px;
}

.no-posts {
    text-align: center;
    padding: 50px;
    background: white;
    border: 1px solid #cc0000;
    border-radius: 16px;
    color: #999;
}

/* Blocked Warning */
.blocked-warning-card {
    text-align: center;
    padding: 50px;
    background: white;
    border: 1px solid #cc0000;
    border-radius: 20px;
    margin: 50px auto;
    max-width: 500px;
}

.blocked-warning-card i {
    font-size: 60px;
    color: #cc0000;
    margin-bottom: 20px;
}

/* ========== CHAT PAGE - FIXED INPUT NOT SCROLLING ========== */
.chat-container {
    max-width: 800px;
    margin: 20px auto;
    background: white;
    border: 1px solid #cc0000;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #cc0000;
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    flex-shrink: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafafa;
}

.message {
    display: flex;
    flex-direction: column;
}

.message-sent {
    align-items: flex-end;
}

.message-received {
    align-items: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 16px;
    border-radius: 20px;
    position: relative;
    word-wrap: break-word;
}

.message-sent .message-bubble {
    background: #cc0000;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-received .message-bubble {
    background: #e4e6eb;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
}

.message-sender {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #cc0000;
}

/* FIXED: Chat input area - stable, no scrolling */
.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid #cc0000;
    display: flex;
    gap: 10px;
    background: white;
    flex-shrink: 0;
    position: relative;
    margin-bottom: 60px;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #cc0000;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    background: white;
}

.chat-input-area input:focus {
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.1);
}

.chat-input-area button {
    background: #cc0000;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-area button:hover {
    background: #a30000;
    transform: scale(1.05);
}

/* ========== MESSENGER PAGE ========== */
.messenger-container {
    display: flex;
    height: calc(100vh - 70px);
    background: white;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.conversations-sidebar {
    width: 320px;
    border-right: 1px solid #cc0000;
    background: white;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.conversations-header {
    padding: 16px;
    border-bottom: 1px solid #cc0000;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.conversations-header h3 {
    color: #cc0000;
    margin: 0;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conv-section-title {
    padding: 12px 16px 8px;
    color: #cc0000;
    font-weight: 600;
    font-size: 13px;
    border-top: 1px solid #eee;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.conv-item:hover {
    background: #f0f2f5;
}

.conv-item.active {
    background: #ffe6e6;
    border-left: 3px solid #cc0000;
}

.conv-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.group-avatar-conv {
    width: 48px;
    height: 48px;
    background: #cc0000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.conv-details {
    flex: 1;
    min-width: 0;
}

.conv-name {
    font-weight: 600;
    color: #cc0000;
    font-size: 14px;
}

.conv-last-msg {
    font-size: 12px;
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    font-size: 10px;
    color: #999;
    flex-shrink: 0;
}

.unread-dot {
    width: 10px;
    height: 10px;
    background: #cc0000;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-area-messenger {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    overflow: hidden;
}

.chat-header-messenger {
    padding: 12px 20px;
    border-bottom: 1px solid #cc0000;
    background: white;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.back-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #cc0000;
}

.chat-messages-messenger {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* FIXED: Messenger input area - stable, no scrolling */
.messenger-input-area {
    padding: 15px 20px;
    border-top: 1px solid #cc0000;
    display: flex;
    gap: 10px;
    background: white;
    flex-shrink: 0;
    margin-bottom: 60px;
}

.messenger-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #cc0000;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
}

.messenger-input-area input:focus {
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.1);
}

.messenger-input-area button {
    background: #cc0000;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.messenger-input-area button:hover {
    background: #a30000;
    transform: scale(1.05);
}

.no-chat-selected {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #999;
}

.no-chat-selected i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #cc0000;
}

@media (max-width: 768px) {
    .conversations-sidebar {
        position: fixed;
        left: -100%;
        top: 70px;
        width: 85%;
        max-width: 300px;
        height: calc(100vh - 140px);
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        border-right: 1px solid #cc0000;
    }
    .conversations-sidebar.open {
        left: 0;
    }
    .back-btn {
        display: block;
    }
    .chat-area-messenger {
        width: 100%;
    }
    .messenger-container {
        margin-top: 70px;
        height: calc(100vh - 140px);
    }
    /* Mobile input margin fix */
    .chat-input-area,
    .messenger-input-area {
        margin-bottom: 0;
        padding: 12px 15px;
    }
}

/* ========== GROUPS PAGE ========== */
.groups-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
}

.create-group-card {
    background: white;
    border: 1px solid #cc0000;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.create-group-card h3 {
    color: #cc0000;
    margin-bottom: 15px;
}

.create-group-card input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cc0000;
    border-radius: 12px;
    margin-bottom: 15px;
    outline: none;
}

.create-group-card input:focus {
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.1);
}

.groups-list h3 {
    color: #cc0000;
    margin-bottom: 15px;
}

.group-card {
    background: white;
    border: 1px solid #cc0000;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    transition: all 0.2s;
}

.group-card:hover {
    transform: translateX(5px);
    background: #ffe6e6;
}

.group-icon {
    width: 50px;
    height: 50px;
    background: #cc0000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.group-name {
    font-weight: 600;
    color: #cc0000;
}

.group-members {
    font-size: 12px;
    color: #65676b;
}

.no-groups {
    text-align: center;
    padding: 40px;
    background: white;
    border: 1px solid #cc0000;
    border-radius: 16px;
    color: #999;
}

/* ========== FORM PAGES ========== */
.form-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 0 20px;
}

.form-card {
    background: white;
    border: 1px solid #cc0000;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.form-card h2 {
    color: #cc0000;
    margin-bottom: 20px;
}

.form-card .input-group {
    margin-bottom: 20px;
}

.form-card .input-group label {
    display: block;
    margin-bottom: 8px;
    color: #cc0000;
    font-weight: 500;
}

.form-card .input-group input,
.form-card .input-group textarea,
.form-card .input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cc0000;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
}

.form-card .input-group input:focus,
.form-card .input-group textarea:focus,
.form-card .input-group select:focus {
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.1);
}

/* ========== BLOCKED USERS PAGE ========== */
.blocked-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.blocked-container h2 {
    color: #cc0000;
    margin-bottom: 20px;
}

.blocked-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.blocked-item {
    background: white;
    border: 1px solid #cc0000;
    border-radius: 16px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.blocked-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.blocked-info {
    flex: 1;
}

.blocked-name {
    font-weight: 600;
    color: #cc0000;
}

.blocked-username {
    font-size: 12px;
    color: #65676b;
}

.no-blocked {
    text-align: center;
    padding: 50px;
    background: white;
    border: 1px solid #cc0000;
    border-radius: 16px;
    color: #999;
}

/* ========== GROUP CHAT LAYOUT ========== */
.group-chat-container {
    display: flex;
    height: calc(100vh - 70px);
    background: white;
}

.group-sidebar {
    width: 300px;
    border-right: 1px solid #cc0000;
    background: white;
    overflow-y: auto;
    flex-shrink: 0;
}

.group-info-header {
    padding: 16px;
    border-bottom: 1px solid #cc0000;
    text-align: center;
    flex-shrink: 0;
}

.group-info-header i {
    font-size: 40px;
    color: #cc0000;
}

.group-actions {
    padding: 16px;
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.group-members-list {
    padding: 16px;
}

.group-members-list h4 {
    color: #cc0000;
    margin-bottom: 15px;
}

.group-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    color: #cc0000;
}

.remove-member {
    color: #cc0000;
    text-decoration: none;
}

.creator-badge {
    background: #cc0000;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
}

.chat-container-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    overflow: hidden;
}

/* FIXED: Group chat input area - stable */
.group-chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid #cc0000;
    display: flex;
    gap: 10px;
    background: white;
    flex-shrink: 0;
    margin-bottom: 60px;
}

.group-chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #cc0000;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
}

.group-chat-input-area input:focus {
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.1);
}

.group-chat-input-area button {
    background: #cc0000;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .group-chat-container {
        flex-direction: column;
        height: calc(100vh - 140px);
        margin-top: 70px;
    }
    .group-sidebar {
        width: 100%;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid #cc0000;
    }
    .group-chat-input-area {
        margin-bottom: 0;
        padding: 12px 15px;
    }
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 25px;
    border: 2px solid #cc0000;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    color: #cc0000;
    margin-bottom: 15px;
}

.modal-content input,
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cc0000;
    border-radius: 10px;
    margin-bottom: 15px;
    outline: none;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #cc0000;
}

.close:hover {
    transform: scale(1.1);
}

.users-list-to-add {
    max-height: 400px;
    overflow-y: auto;
}

.user-add-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #e4e6eb;
    text-decoration: none;
    color: inherit;
}

.user-add-item:hover {
    background: #ffe6e6;
}

.no-users {
    text-align: center;
    padding: 30px;
    color: #999;
}

.group-add-item {
    display: block;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #cc0000;
    border-radius: 10px;
    text-decoration: none;
    color: #cc0000;
    text-align: center;
}

.group-add-item:hover {
    background: #ffe6e6;
}

/* ========== LOADING & EMPTY STATES ========== */
.loading, .no-messages, .no-conversations, .no-requests {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* ========== BACK BUTTON STYLES ========== */
.back-button-container {
    padding: 10px 0;
    margin-bottom: 5px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #cc0000;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    text-decoration: none;
}

.back-button:hover {
    background: #ffe6e6;
}

.back-button i {
    font-size: 18px;
}

/* Hide back button on homepage */
.home-page .back-button-container {
    display: none;
}

/* ========== RESPONSIVE FIXES ========== */
@media (max-width: 768px) {
    .post-actions {
        flex-wrap: wrap;
        gap: 5px;
    }
    .post-actions button,
    .post-actions a {
        font-size: 12px;
        padding: 6px 10px;
    }
    .profile-avatar img {
        width: 90px;
        height: 90px;
    }
    .profile-info {
        padding: 0 15px 20px;
    }
    .profile-details h1 {
        font-size: 22px;
    }
    .comment-item {
        flex-wrap: wrap;
    }
    .replies-section {
        margin-left: 15px;
    }
    .profile-posts .post-card {
        padding: 15px;
    }
    /* Chat input responsive */
    .chat-input-area,
    .messenger-input-area,
    .group-chat-input-area {
        padding: 12px 15px;
    }
    .chat-input-area input,
    .messenger-input-area input,
    .group-chat-input-area input {
        padding: 10px 14px;
        font-size: 13px;
    }
    .chat-input-area button,
    .messenger-input-area button,
    .group-chat-input-area button {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .nav-icons {
        gap: 12px;
    }
    .nav-icons a {
        font-size: 16px;
    }
    .post-card {
        padding: 12px;
    }
    .message-bubble {
        max-width: 85%;
    }
    .profile-stats {
        gap: 20px;
    }
    .profile-stats strong {
        font-size: 16px;
    }
    .profile-posts .post-card {
        padding: 12px;
    }
    /* Chat input extra small */
    .chat-input-area,
    .messenger-input-area,
    .group-chat-input-area {
        padding: 10px 12px;
        gap: 8px;
    }
    .chat-input-area button,
    .messenger-input-area button,
    .group-chat-input-area button {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
}