/* Post Menu Styles */
.post-menu {
    position: relative;
}

.post-menu-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    font-size: 20px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.post-menu-btn:hover {
    background-color: rgba(0,0,0,0.05);
}

.post-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
}

.post-menu-dropdown.show {
    display: block;
}

.post-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
}

.post-menu-item:hover {
    background-color: #f5f5f5;
}

.post-menu-item i {
    font-size: 16px;
    color: #666;
}

.menu-edit i {
    color: #007aff;
}

.menu-delete i {
    color: #ff3b30;
}

/* Menu backdrop for mobile */
.menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
}

.menu-backdrop.show {
    display: block;
}

/* Ensure post cards have proper z-index */
.post-card {
    position: relative;
    z-index: 1;
}

.post-card .post-menu-dropdown {
    z-index: 1000;
}
/* Add to your CSS for global menu support */
.post-menu {
    position: relative;
    margin-left: auto; /* Push to right side */
}

.post-menu-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.post-menu-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

.post-menu-dropdown {
    display: none;
    position: fixed; /* Use fixed positioning for global access */
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 9999;
    animation: menuFadeIn 0.2s ease;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-menu-dropdown.show {
    display: block;
}

.post-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

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

.post-menu-item:hover {
    background-color: #f5f5f5;
}

.post-menu-item i {
    font-size: 16px;
    min-width: 20px;
}

.menu-edit i {
    color: #007aff;
}

.menu-delete i {
    color: #ff3b30;
}

/* Ensure post headers have proper layout */
.post-header {
    display: flex;
    align-items: center;
    width: 100%;
}

.post-user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Make sure menu button is visible on all post cards */
.card-header .post-header {
    position: relative;
}
